Debian Codegraph @

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

raw
1 \def\pgfcircversion{0.9.6}
2 \def\pgfcircversiondate{2019/11/09}
3 \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
4
5 \usemodule[tikz]
6
7 \startmodule[circuitikz-0.9.6]
8 \usetikzlibrary[calc]
9 \usetikzlibrary[arrows.meta, bending]
10
11 \unprotect
12
13 \edef\tikzatcode{\the\catcode`\@}
14 \edef\tikzbarcode{\the\catcode`\|}
15 \edef\tikzexclaimcode{\the\catcode`\!}
16 \catcode`\@=11
17 \catcode`\|=12
18 \catcode`\!=12
19
20 %%%%%%%%%%% Springe nach tex/pgfcirc.defines
21 %%%---------- open: tex/pgfcirc.defines.tex
22 %% Key managements
23
24 \long\def\pgf@circ@comment#1{}
25
26 \def\circuitikzbasekey{/tikz/circuitikz}
27
28 \pgfkeys{\circuitikzbasekey/.is family}
29
30 \def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
31 \let\ctikzset\circuitikzset
32 \def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
33 \def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
34
35 %% Temporary Counters
36
37 \newcount\pgf@circ@count@a
38 \newcount\pgf@circ@count@b
39 \newcount\pgf@circ@count@c
40 %%%%%%%%%%%%
41 %% Dimensions
42
43 % coordinates
44 \newdimen\pgf@circ@res@up
45 \newdimen\pgf@circ@res@down
46 \newdimen\pgf@circ@res@zero
47 \newdimen\pgf@circ@res@left
48 \newdimen\pgf@circ@res@right
49 \newdimen\pgf@circ@res@other
50 \newdimen\pgf@circ@res@step
51 \newdimen\pgf@circ@res@temp
52 % inital thickness
53 \newdimen \pgfstartlinewidth
54
55 % arrow tips, ported over old arrows library (deprecated)
56 % see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
57 % this was the original definition of latex' tips, renamed to avoid clashes
58 %
59 \pgfarrowsdeclare{latexslim}{latexslim}
60 {
61 \pgfutil@tempdima=0.28pt%
62 \advance\pgfutil@tempdima by.3\pgflinewidth%
63 \pgfarrowsleftextend{+-4\pgfutil@tempdima}
64 \pgfarrowsrightextend{+6\pgfutil@tempdima}
65 }
66 {
67 \pgfutil@tempdima=0.28pt%
68 \advance\pgfutil@tempdima by.3\pgflinewidth%
69 \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
70 \pgfpathcurveto
71 {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
72 {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
73 {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
74 \pgfpathcurveto
75 {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
76 {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
77 {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
78 \pgfpathcurveto
79 {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
80 {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
81 {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
82 \pgfpathclose
83 \pgfusepathqfill
84 }
85
86 \pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
87
88 \def\pgf@circ@setifdefinedfill#1#2{%
89 % if \ctikzclass is defined and \ctikzclass/fill is defined and is not none:
90 % set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2}
91 \ifdefined\ctikzclass
92 \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}%
93 {% yes, it's defined
94 \edef\@@tmp{\ctikzvalof{\ctikzclass/fill}}\edef\@@none{none}%
95 \ifx\@@tmp\@@none % but it's none
96 \pgfusepath{#2}%
97 \else
98 \pgfsetfillcolor{\@@tmp}%
99 \pgfusepath{#1}%
100 \fi
101 }{% the class is defined but the fill key not; use #2
102 \pgfusepath{#2}%
103 }
104 \else
105 \pgfusepath{#2}%
106 \fi
107 }
108
109 %% Macro to fill or draw
110
111 \def\pgf@circ@draworfill{%
112 \ifx\tikz@fillcolor\pgfutil@empty
113 \pgf@circ@setifdefinedfill{draw,fill}{draw}
114 \else
115 \pgfsetfillcolor{\tikz@fillcolor}
116 \pgfusepath{draw, fill}
117 \fi
118 }
119
120 \def\pgf@circ@draworfillandclip{%
121 \ifx\tikz@fillcolor\pgfutil@empty
122 \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
123 \pgfusepath{draw, clip}
124 \else
125 \pgfsetfillcolor{\tikz@fillcolor}
126 \pgfusepath{draw, clip, fill}
127 \fi
128 }
129
130 \def\pgf@circ@maybefill{%
131 \ifx\tikz@fillcolor\pgfutil@empty
132 \pgf@circ@setifdefinedfill{fill}{discard}
133 \else
134 \pgfsetfillcolor{\tikz@fillcolor}
135 \pgfusepath{fill}
136 \fi
137 }
138
139 %% Macros for setting linewidth
140 % #1 is the legacy class (bipoles, tripoles) etc
141 % #2 is the reference linewidth
142 \def\pgf@circ@setlinewidth#1#2{%
143 \ifdefined\ctikzclass
144 \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/thickness}%
145 {% yes, it's defined
146 \edef\@@tmp{\ctikzvalof{\ctikzclass/thickness}}\edef\@@none{none}%
147 \ifx\@@tmp\@@none % but it's none
148 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% passthrough legacy class
149 \else
150 \pgfsetlinewidth{\@@tmp #2}%
151 \fi
152 }{ % key not defined, do the legacy thing
153 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
154 }% Ok, do nothing
155 \else % no class
156 \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
157 \fi
158 }
159 % use \pgf@circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case
160 \ctikzset{none/thickness/.initial=1.0} % do not touch
161
162 %% font changes compatible with plain/LaTeX/ConTeXt
163 %% thanks to Henri Menke https://github.com/circuitikz/circuitikz/issues/285#issuecomment-537224605
164
165 \ifpgfutil@format@is@latex
166 \long\def\pgf@circ@font@tiny{\tiny}
167 \long\def\pgf@circ@font@small{\small}
168 \long\def\pgf@circ@font@bold{\textbf}
169 \long\def\pgf@circ@font@boldmath{\boldmath}
170 \long\def\pgf@circ@font@sixbm{\fontsize{6}{7}\selectfont\boldmath}
171 \long\def\pgf@circ@font@tenbm{\fontsize{10}{12}\selectfont\boldmath}
172 \long\def\pgf@circ@font@twelve{\fontsize{12}{14}\selectfont}
173 \else\ifpgfutil@format@is@plain
174 \long\def\pgf@circ@font@tiny{\fiverm}
175 \long\def\pgf@circ@font@small{\sevenrm}
176 \long\def\pgf@circ@font@bold#1{{\bf#1}}
177 \long\def\pgf@circ@font@boldmath{\bf} % to be tested
178 \long\def\pgf@circ@font@sixbm{\sevenrm\bf} %
179 \long\def\pgf@circ@font@tenbm{\tenrm\bf} %
180 \long\def\pgf@circ@font@twelve{\twelverm} %
181 \else\ifpgfutil@format@is@context
182 \long\def\pgf@circ@font@tiny{\tfxx}
183 \long\def\pgf@circ@font@small{\tfx}
184 \long\def\pgf@circ@font@bold{\bold}
185 \long\def\pgf@circ@font@boldmath{\bold} % to be tested
186 \long\def\pgf@circ@font@sixbm{\tfx\bold} %
187 \long\def\pgf@circ@font@tenbm{\normal\bold}%
188 \long\def\pgf@circ@font@twelve{\tfa} %
189 \fi\fi\fi
190
191
192 % voltage options
193
194 \newif\ifpgf@circ@siunitx
195 \newif\ifpgf@circuit@compat
196 \newif\ifpgf@circ@oldvoltagedirection % default false
197 \newif\ifpgf@circ@explicitvdir
198 \newif\ifpgf@circ@fixbatteries
199
200 \ctikzset{voltage dir/.is choice}
201 \ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
202 \ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
203 \ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
204 \ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
205 \tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
206
207 % Option ">" for twoports
208 \newif\ifpgf@circuit@inputarrow
209 \ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
210 \ctikzset{inputarrow/.is choice}
211 \ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
212 \ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
213
214 % Option "boxed" for nodes and twoports
215 \newif\ifpgf@circuit@boxed
216 \pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
217 \ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
218 \pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
219 \ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
220
221 % Option "dashed" for nodes and twoports
222 \newif\ifpgf@circuit@dashed
223 \pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
224 \ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
225
226 % Option "t=*" for nodes
227 \pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
228
229 \ctikzset{current arrow scale/.initial=16}
230
231 \ctikzset{bipoles/.is family}
232 \ctikzset{bipoles/border margin/.initial=1.1}
233 \ctikzset{bipoles/thickness/.initial=2}
234 \ctikzset{tripoles/thickness/.initial=2}
235 \ctikzset{quadpoles/thickness/.initial=2}
236 \ctikzset{nodes width/.initial=.04}
237
238 % Base len for all circuitikz
239 \newdimen\pgf@circ@Rlen
240 % scaled length for internal use in scalable shapes
241 \newdimen\pgf@circ@scaled@Rlen
242 \ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}}
243 \pgf@circ@Rlen = 1.4cm
244 % by default scale is 1.0
245 \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
246
247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
248 %% main style definitions
249 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
250
251
252
253 % load a style file: search ctikzstyle-NAME.tex in path
254 \def\ctikzloadstyle#1{%
255 \edef\pgf@temp{#1}%
256 % guard against re-loading
257 \expandafter\ifx\csname pgf@circ@style@\pgf@temp @loaded\endcsname\relax%
258 \expandafter\global\expandafter\let\csname pgf@circ@style@\pgf@temp @loaded\endcsname=\pgfutil@empty
259 \pgfutil@InputIfFileExists{ctikzstyle-#1}{}{%
260 \tikzerror{I did not find the circuitikz style #1}}%
261 \fi
262 }
263
264 % load and enact a style
265 \def\ctikzsetstyle#1{%
266 \ctikzloadstyle{#1}%
267 \tikzset{#1 circuit style}%
268 }
269
270 % global style parameters
271 \ctikzset{default/scale/.initial=1.0} % do not touch
272 \ctikzset{default/fill/.initial=none} % do not touch
273 \ctikzset{default/thickness/.initial=none} % do not touch
274 % default is use as the generic default style for bipoles
275
276 % mostly bipoles:
277
278 \ctikzset{resistors/scale/.initial=1.0}
279 \ctikzset{resistors/fill/.initial=none}
280 \ctikzset{resistors/thickness/.initial=none}
281
282 \ctikzset{capacitors/scale/.initial=1.0}
283 \ctikzset{capacitors/fill/.initial=none}
284 \ctikzset{capacitors/thickness/.initial=none}
285
286 \ctikzset{inductors/scale/.initial=1.0}
287 \ctikzset{inductors/fill/.initial=none}
288 \ctikzset{inductors/thickness/.initial=none}
289
290 \ctikzset{diodes/scale/.initial=1.0}
291 \ctikzset{diodes/fill/.initial=none}
292 \ctikzset{diodes/thickness/.initial=none}
293
294 \ctikzset{batteries/scale/.initial=1.0}
295 \ctikzset{batteries/fill/.initial=none}
296 \ctikzset{batteries/thickness/.initial=none}
297
298 \ctikzset{sources/scale/.initial=1.0}
299 \ctikzset{sources/fill/.initial=none}
300 \ctikzset{sources/thickness/.initial=none}
301
302 \ctikzset{csources/scale/.initial=1.0}
303 \ctikzset{csources/fill/.initial=none}
304 \ctikzset{csources/thickness/.initial=none}
305
306 \ctikzset{instruments/scale/.initial=1.0}
307 \ctikzset{instruments/fill/.initial=none}
308 \ctikzset{instruments/thickness/.initial=none}
309
310 \ctikzset{mechanicals/scale/.initial=1.0}
311 \ctikzset{mechanicals/fill/.initial=none}
312 \ctikzset{mechanicals/thickness/.initial=none}
313
314 \ctikzset{misc/scale/.initial=1.0}
315 \ctikzset{misc/fill/.initial=none}
316 \ctikzset{misc/thickness/.initial=none}
317
318 \ctikzset{blocks/scale/.initial=1.0}
319 \ctikzset{blocks/fill/.initial=none}
320 \ctikzset{blocks/thickness/.initial=none}
321
322 % mostly nodes
323
324 \ctikzset{grounds/scale/.initial=1.0}
325 \ctikzset{grounds/fill/.initial=none}
326 \ctikzset{grounds/thickness/.initial=none}
327
328 \ctikzset{power supplies/scale/.initial=1.0}
329 \ctikzset{power supplies/fill/.initial=none}
330 \ctikzset{power supplies/thickness/.initial=none}
331
332 \ctikzset{transistors/scale/.initial=1.0}
333 \ctikzset{transistors/fill/.initial=none}
334 \ctikzset{transistors/thickness/.initial=none}
335
336 \ctikzset{tubes/scale/.initial=1.0}
337 \ctikzset{tubes/fill/.initial=none}
338 \ctikzset{tubes/thickness/.initial=none}
339
340 \ctikzset{RF/scale/.initial=1.0}
341 \ctikzset{RF/fill/.initial=none}
342 \ctikzset{RF/thickness/.initial=none}
343
344 \ctikzset{electromechanicals/scale/.initial=1.0}
345 \ctikzset{electromechanicals/fill/.initial=none}
346 \ctikzset{electromechanicals/thickness/.initial=none}
347
348 % transformers go with inductors
349 \ctikzset{amplifiers/scale/.initial=1.0}
350 \ctikzset{amplifiers/fill/.initial=none}
351 \ctikzset{amplifiers/thickness/.initial=none}
352
353 \ctikzset{switches/scale/.initial=1.0}
354 \ctikzset{switches/fill/.initial=none}
355 \ctikzset{switches/thickness/.initial=none}
356
357 \ctikzset{logic ports/scale/.initial=1.0}
358 \ctikzset{logic ports/fill/.initial=none}
359 \ctikzset{logic ports/thickness/.initial=none}
360
361 \ctikzset{chips/scale/.initial=1.0}
362 \ctikzset{chips/fill/.initial=none}
363 \ctikzset{chips/thickness/.initial=none}
364
365 \ctikzset{displays/scale/.initial=1.0}
366 \ctikzset{displays/fill/.initial=none}
367 \ctikzset{displays/thickness/.initial=none}
368
369 % grounds and power supplies
370
371 \ctikzset{monopoles/.is family}
372 \ctikzset{monopoles/ground/width/.initial=.25}
373 \ctikzset{monopoles/ground/connectionthickness/.initial=1}
374 \ctikzset{monopoles/ground/thickness/.initial=2}
375 \ctikzset{monopoles/rground/thickness/.initial=2}
376 \ctikzset{monopoles/tground/thickness/.initial=3}
377 \ctikzset{monopoles/vcc/width/.initial=.2}
378 \ctikzset{monopoles/vcc/arrow/.initial=legacy}
379 \ctikzset{monopoles/vee/arrow/.initial=legacy}
380 \ctikzset{monopoles/match/width/.initial=.4}
381 \ctikzset{monopoles/chassis/width/.initial=.25}
382 \ctikzset{monopoles/alternative chassis/width/.initial=.25}
383 \ctikzset{monopoles/equipotentiality/width/.initial=.25}
384 \ctikzset{monopoles/antenna/width/.initial=.25}
385 \ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
386 \ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
387 \ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
388 \ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
389 \ctikzset{monopoles/txantenna/width/.initial=.25}
390 \ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
391 \ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
392 \ctikzset{monopoles/rxantenna/width/.initial=.25}
393 \ctikzset{monopoles/bareantenna/width/.initial=.25}
394 \ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
395 \ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
396 \ctikzset{monopoles/waves/width/.initial=0.5}
397
398 % microstrips
399 \ctikzset{bipoles/mstline/height/.initial=0.3}
400 \ctikzset{bipoles/mstline/width/.initial=1.2}
401 \pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
402 \ctikzset{monopoles/msport/width/.initial=.5}
403 \ctikzset{monopoles/msrstub/height/.initial=1.0}
404 \ctikzset{monopoles/msrstub/width/.initial=0.6}
405
406 % microphone and loudspeaker
407 \ctikzset{bipoles/loudspeaker/height/.initial=.8}
408 \ctikzset{bipoles/loudspeaker/depth/.initial=.3}
409 \ctikzset{bipoles/loudspeaker/width/.initial=.8}
410 \ctikzset{bipoles/mic/height/.initial=1.2}
411 \ctikzset{bipoles/mic/depth/.initial=.0}
412 \ctikzset{bipoles/mic/width/.initial=.8}
413
414 % Zig Zag resistors
415 \ctikzset{resistors/zigs/.initial=3}
416 \ctikzset{resistors/width/.code={%
417 \ctikzset{bipoles/resistor/width=#1}%
418 \ctikzset{bipoles/vresistor/width=#1}%
419 \ctikzset{bipoles/potentiometer/width=#1}%
420 \ctikzset{bipoles/resistivesens/width=#1}%
421 \ctikzset{bipoles/photoresistor/width=#1}%
422 \ctikzset{bipoles/thermistor/width=#1}%
423 \ctikzset{bipoles/thermistorntc/width=#1}%
424 \ctikzset{bipoles/thermistorptc/width=#1}%
425 \ctikzset{bipoles/varistor/width=#1}%
426 \ctikzset{bipoles/generic/width=#1}%
427 \ctikzset{bipoles/generic potentiometer/width=#1}%
428 \ctikzset{bipoles/ageneric/width=#1}%
429 \ctikzset{bipoles/tgeneric/width=#1}%
430 }}
431 \ctikzset{wiper pos/.code={%
432 \ctikzset{bipoles/potentiometer/wiper pos=#1}%
433 \ctikzset{bipoles/generic potentiometer/wiper pos=#1}%
434 }}
435 % zigzag resistor
436 \ctikzset{bipoles/resistor/height/.initial=.3}
437 \ctikzset{bipoles/resistor/width/.initial=.8}
438 \ctikzset{bipoles/potentiometer/height/.initial=.8}
439 \ctikzset{bipoles/potentiometer/height 2/.initial=.3}
440 \ctikzset{bipoles/potentiometer/width/.initial=.8}
441 \ctikzset{bipoles/potentiometer/wiper pos/.initial=.5}
442 \ctikzset{bipoles/vresistor/height/.initial=.6}
443 \ctikzset{bipoles/vresistor/width/.initial=.8}
444 \ctikzset{bipoles/resistivesens/height/.initial=.6}
445 \ctikzset{bipoles/resistivesens/width/.initial=.8}
446 % square resistors
447 \ctikzset{bipoles/photoresistor/height/.initial=.6}
448 \ctikzset{bipoles/photoresistor/height 2/.initial=.3}
449 \ctikzset{bipoles/photoresistor/width/.initial=.8}
450 \ctikzset{bipoles/thermistor/main/.initial=.7}
451 \ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
452 \ctikzset{bipoles/thermistorntc/width/.initial=.8}
453 \ctikzset{bipoles/thermistorntc/main/.initial=.7}
454 \ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
455 \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
456 \ctikzset{bipoles/thermistorptc/width/.initial=.8}
457 \ctikzset{bipoles/thermistorptc/main/.initial=.7}
458 \ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
459 \ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
460 \ctikzset{bipoles/thermistor/width/.initial=.8}
461 \ctikzset{bipoles/varistor/main/.initial=.7}
462 \ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
463 \ctikzset{bipoles/varistor/width/.initial=.8}
464 \ctikzset{bipoles/generic/height/.initial=.30}
465 \ctikzset{bipoles/generic/width/.initial=.80}
466 \ctikzset{bipoles/generic potentiometer/height/.initial=.80}
467 \ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
468 \ctikzset{bipoles/generic potentiometer/width/.initial=.80}
469 \ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5}
470 \ctikzset{bipoles/ageneric/height/.initial=.30}
471 \ctikzset{bipoles/tgeneric/height/.initial=.70}
472 \ctikzset{bipoles/tgeneric/width/.initial=.80}
473 \ctikzset{bipoles/ageneric/width/.initial=.80}
474
475 %% Capacitors
476 \ctikzset{bipoles/capacitor/height/.initial=.6}
477 \ctikzset{bipoles/capacitor/width/.initial=.2}
478 \ctikzset{bipoles/ecapacitor/height/.initial=.5}
479 \ctikzset{bipoles/ecapacitor/width/.initial=.2}
480 \ctikzset{bipoles/ecapacitor/font/.initial=\pgf@circ@font@sixbm}
481 %%% pcapacitor is deprecated
482 \ctikzset{bipoles/pcapacitor/height/.initial=.6}
483 \ctikzset{bipoles/pcapacitor/width/.initial=.2}
484 \ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
485 \ctikzset{bipoles/ccapacitor/height/.initial=.6}
486 \ctikzset{bipoles/ccapacitor/width/.initial=.12}
487 \ctikzset{bipoles/ccapacitor/bend width/.initial=1.1}
488 \ctikzset{bipoles/vcapacitor/height/.initial=.6}
489 \ctikzset{bipoles/vcapacitor/width/.initial=.5}
490 \ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
491 \ctikzset{bipoles/piezoelectric/height/.initial=.7}
492 \ctikzset{bipoles/piezoelectric/width/.initial=.5}
493
494 % Inductors
495 \ctikzset{inductors/coils/.code={%
496 \ctikzset{bipoles/cuteinductor/coils=#1}%
497 \ctikzset{bipoles/cutechoke/coils=#1}%
498 \ctikzset{bipoles/americaninductor/coils=#1}%
499 \ctikzset{bipoles/vcuteinductor/coils=#1}%
500 \ctikzset{bipoles/vamericaninductor/coils=#1}%
501 }}
502 \ctikzset{inductors/width/.code={%
503 \ctikzset{bipoles/cuteinductor/width=#1}%
504 \ctikzset{bipoles/cutechoke/width=#1}%
505 \ctikzset{bipoles/americaninductor/width=#1}%
506 \ctikzset{bipoles/vcuteinductor/width=#1}%
507 \ctikzset{bipoles/vamericaninductor/width=#1}%
508 \ctikzset{bipoles/fullgeneric/width=#1}%
509 \ctikzset{bipoles/tfullgeneric/width=#1}%
510 }}
511 \ctikzset{bipoles/cuteinductor/height/.initial=.3}
512 \ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
513 \ctikzset{bipoles/cuteinductor/width/.initial=.6}
514 \ctikzset{bipoles/cuteinductor/coils/.initial=5}
515 \ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
516 %% Cute choke settings
517 \ctikzset{bipoles/cutechoke/height/.initial=.3}
518 \ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
519 \ctikzset{bipoles/cutechoke/width/.initial=.6}
520 \ctikzset{bipoles/cutechoke/coils/.initial=5}
521 \ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
522 \ctikzset{bipoles/cutechoke/cstep/.initial=.3}
523 \ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
524 \ctikzset{bipoles/cutechoke/cthick/.initial=1}
525 \newif\ifpgf@circuit@bipole@twolineschoke
526 \pgf@circuit@bipole@twolineschokefalse
527 \pgfkeys{/tikz/onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
528 \ctikzset{onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}}
529 \pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
530 \ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}}
531 %
532 \ctikzset{bipoles/americaninductor/height/.initial=.3}
533 \ctikzset{bipoles/americaninductor/height 2/.initial=.1}
534 \ctikzset{bipoles/americaninductor/width/.initial=.8}
535 \ctikzset{bipoles/americaninductor/coils/.initial=4}
536 \ctikzset{bipoles/americaninductor/coil height/.initial=.15}
537 \ctikzset{bipoles/vcuteinductor/height/.initial=.6}
538 \ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
539 \ctikzset{bipoles/vcuteinductor/width/.initial=.6}
540 \ctikzset{bipoles/vcuteinductor/coils/.initial=5}
541 \ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
542 \ctikzset{bipoles/vamericaninductor/height/.initial=.6}
543 \ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
544 \ctikzset{bipoles/vamericaninductor/width/.initial=.8}
545 \ctikzset{bipoles/vamericaninductor/coils/.initial=4}
546 \ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
547 \ctikzset{bipoles/tfullgeneric/height/.initial=.70}
548 \ctikzset{bipoles/tfullgeneric/width/.initial=.80}
549 \ctikzset{bipoles/fullgeneric/height/.initial=.30}
550 \ctikzset{bipoles/fullgeneric/width/.initial=.80}
551
552 % Sources
553
554 \ctikzset{bipoles/esource/height/.initial=.60}
555 \ctikzset{bipoles/esource/width/.initial=.60}
556 \ctikzset{bipoles/pvsource/height/.initial=.60}
557 \ctikzset{bipoles/pvsource/width/.initial=.60}
558 \ctikzset{bipoles/isource/height/.initial=.60}
559 \ctikzset{bipoles/isource/width/.initial=.60}
560 \ctikzset{bipoles/oosource/height/.initial=.60}
561 \ctikzset{bipoles/oosource/width/.initial=.60}
562 \ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
563 \ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
564 \ctikzset{bipoles/dcisource/angle/.initial=80}
565 \ctikzset{bipoles/dcisource/height/.initial=.60}
566 \ctikzset{bipoles/dcisource/width/.initial=.60}
567 \ctikzset{bipoles/dcvsource/height/.initial=.60}
568 \ctikzset{bipoles/dcvsource/width/.initial=.60}
569 \ctikzset{bipoles/vsourcetri/height/.initial=.60}
570 \ctikzset{bipoles/vsourcetri/width/.initial=.60}
571 \ctikzset{bipoles/isourceam/height/.initial=.60}
572 \ctikzset{bipoles/isourceam/width/.initial=.60}
573 \ctikzset{bipoles/vsource/height/.initial=.60}
574 \ctikzset{bipoles/vsource/width/.initial=.60}
575 \ctikzset{bipoles/vsourceam/height/.initial=.60}
576 \ctikzset{bipoles/vsourceam/width/.initial=.60}
577 \ctikzset{bipoles/vsourceam/margin/.initial=.7}
578 \ctikzset{bipoles/isourcesin/height/.initial=.60}
579 \ctikzset{bipoles/isourcesin/width/.initial=.60}
580 \ctikzset{bipoles/vsourcesin/height/.initial=.60}
581 \ctikzset{bipoles/vsourcesin/width/.initial=.60}
582 \ctikzset{bipoles/vsourcesquare/height/.initial=.60}
583 \ctikzset{bipoles/vsourcesquare/width/.initial=.60}
584 \ctikzset{bipoles/cisource/height/.initial=.7}
585 \ctikzset{bipoles/cisource/width/.initial=.7}
586 \ctikzset{bipoles/cisourceam/height/.initial=.7}
587 \ctikzset{bipoles/cisourceam/width/.initial=.7}
588 \ctikzset{bipoles/ecsource/height/.initial=.7}
589 \ctikzset{bipoles/ecsource/width/.initial=.7}
590 \ctikzset{bipoles/cvsource/height/.initial=.7}
591 \ctikzset{bipoles/cvsource/width/.initial=.7}
592 \ctikzset{bipoles/cvsourceam/height/.initial=.7}
593 \ctikzset{bipoles/cvsourceam/width/.initial=.7}
594 \ctikzset{bipoles/cvsourceam/margin/.initial=.7}
595 \ctikzset{bipoles/cvsourceam/text scale/.initial=1}
596 \ctikzset{bipoles/cisourcesin/width/.initial=.7}
597 \ctikzset{bipoles/cvsourcesin/height/.initial=.7}
598 \ctikzset{bipoles/cvsourcesin/width/.initial=.7}
599 \ctikzset{bipoles/battery/height/.initial=.6}
600 \ctikzset{bipoles/battery/width/.initial=.3}
601 \ctikzset{bipoles/battery1/height/.initial=.6}
602 \ctikzset{bipoles/battery1/width/.initial=.3}
603 \ctikzset{bipoles/battery2/height/.initial=.6}
604 \ctikzset{bipoles/battery2/width/.initial=.3}
605
606 % diodes
607
608 \ctikzset{bipoles/diode/height/.initial=.50}
609 \ctikzset{bipoles/diode/width/.initial=.40}
610 \ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
611 \ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
612 \ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
613 \ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
614 \ctikzset{bipoles/varcap/height/.initial=.50}
615 \ctikzset{bipoles/varcap/width/.initial=.45}
616
617 % switches
618
619 \ctikzset{bipoles/spst/height/.initial=.35}
620 \ctikzset{bipoles/spst/width/.initial=.35}
621 \ctikzset{bipoles/spst/depth/.initial=.2}
622 \ctikzset{bipoles/nos/height/.initial=.3}
623 \ctikzset{bipoles/nos/width/.initial=.35}
624 \ctikzset{bipoles/nos/depth/.initial=.2}
625 \ctikzset{bipoles/ncs/height/.initial=.35}
626 \ctikzset{bipoles/ncs/width/.initial=.35}
627 \ctikzset{bipoles/ncs/depth/.initial=.2}
628
629 % misc
630
631 \ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
632 \ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
633 \ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
634 \ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
635 \ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
636 \ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
637 \ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
638 \ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
639 \ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
640 \ctikzset{bipoles/fuse/height/.initial=.20}
641 \ctikzset{bipoles/fuse/width/.initial=.50}
642 \ctikzset{bipoles/afuse/height/.initial=.20}
643 \ctikzset{bipoles/afuse/width/.initial=.50}
644 \ctikzset{bipoles/memristor/height/.initial=.30}
645 \ctikzset{bipoles/memristor/wave height/.initial=.5}
646 \ctikzset{bipoles/memristor/width/.initial=.80}
647 \ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
648 \ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
649 \ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
650 \ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
651 \ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
652 \ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
653 %\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
654 %\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
655 \ctikzset{bipoles/ammeter/height/.initial=.60}
656 \ctikzset{bipoles/ammeter/width/.initial=.60}
657 \ctikzset{bipoles/ohmmeter/height/.initial=.60}
658 \ctikzset{bipoles/ohmmeter/width/.initial=.60}
659 \ctikzset{bipoles/voltmeter/height/.initial=.60}
660 \ctikzset{bipoles/voltmeter/width/.initial=.60}
661 \ctikzset{bipoles/smeter/height/.initial=.60}
662 \ctikzset{bipoles/smeter/width/.initial=.60}
663 \ctikzset{bipoles/qmeter/depth/.initial=.40}
664 \ctikzset{bipoles/qmeter/height/.initial=.80}
665 \ctikzset{bipoles/qmeter/width/.initial=.60}
666 \ctikzset{bipoles/iloop/width/.initial=.40}
667 \ctikzset{bipoles/iloop/height/.initial=.60}
668 \ctikzset{bipoles/oscope/height/.initial=.60}
669 \ctikzset{bipoles/oscope/width/.initial=.60}
670 \ctikzset{bipoles/buffer/height/.initial=1}
671 \ctikzset{bipoles/buffer/width/.initial=1}
672 \ctikzset{bipoles/not port/width/.initial=1}
673 \ctikzset{bipoles/not port/height/.initial=.8}
674 \ctikzset{bipoles/not port/circle width/.initial=.15}
675 \ctikzset{bipoles/lamp/height/.initial=.60}
676 \ctikzset{bipoles/lamp/width/.initial=.60}
677 \ctikzset{bipoles/bulb/height/.initial=.8}
678 \ctikzset{bipoles/bulb/width/.initial=.8}
679 \ctikzset{bipoles/tline/height/.initial=.3}
680 \ctikzset{bipoles/tline/width/.initial=.8}
681 \ctikzset{bipoles/squid/height/.initial=.60}
682 \ctikzset{bipoles/squid/width/.initial=.60}
683 \ctikzset{bipoles/barrier/height/.initial=.60}
684 \ctikzset{bipoles/barrier/width/.initial=.60}
685 \ctikzset{bipoles/thermocouple/height/.initial=.250}
686 \ctikzset{bipoles/thermocouple/height 2/.initial=.60}
687 \ctikzset{bipoles/thermocouple/width/.initial=.140}
688 \ctikzset{bipoles/pushbutton/height/.initial=.5}
689 \ctikzset{bipoles/pushbutton/height 2/.initial=.2}
690 \ctikzset{bipoles/pushbutton/width/.initial=.50}
691
692 \ctikzset{bipoles/twoport/width/.initial=.7}
693 \ctikzset{bipoles/twoport/height/.initial=.7}
694 \ctikzset{bipoles/twoport/text/.initial=}
695 \ctikzset{bipoles/vco/width/.initial=.7}
696 \ctikzset{bipoles/bandpass/width/.initial=.7}
697 \ctikzset{bipoles/bandstop/width/.initial=.7}
698 \ctikzset{bipoles/highpass/width/.initial=.7}
699 \ctikzset{bipoles/lowpass/width/.initial=.7}
700 \ctikzset{bipoles/adc/width/.initial=.7}
701 \ctikzset{bipoles/dac/width/.initial=.7}
702 \ctikzset{bipoles/dsp/width/.initial=.7}
703 \ctikzset{bipoles/fft/width/.initial=.7}
704 \ctikzset{bipoles/amp/width/.initial=.7}
705 \ctikzset{bipoles/vamp/width/.initial=.7}
706 \ctikzset{bipoles/piattenuator/width/.initial=.7}
707 \ctikzset{bipoles/vpiattenuator/width/.initial=.7}
708 \ctikzset{bipoles/tattenuator/width/.initial=.7}
709 \ctikzset{bipoles/vtattenuator/width/.initial=.7}
710 \ctikzset{bipoles/phaseshifter/width/.initial=.7}
711 \ctikzset{bipoles/vphaseshifter/width/.initial=.7}
712 \ctikzset{bipoles/detector/width/.initial=.7}
713
714 % crossing wires
715 \ctikzset{bipoles/crossing/size/.initial=.2}
716
717 % Transistors starts here
718
719 \newif\ifpgf@circuit@trans@depletiontype
720 \pgf@circuit@trans@depletiontypefalse
721
722 \newif\ifpgf@circuit@mos@arrows
723 \ctikzset{tripoles/mos style/.is choice}
724 \ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
725 \ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
726 \pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}}
727 \pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}}
728
729 % Option solderdot for fet
730 \newif\ifpgf@circuit@fet@solderdot
731 \pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
732 \ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
733 \pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
734 \ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
735
736 % Option bodydiode for fet
737 \newif\ifpgf@circuit@fet@bodydiode
738 \pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
739 \ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
740 \pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
741 \ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
742
743 % Option draw fet without gate connection
744 \newif\ifpgf@circuit@bpt@drawgate
745 \pgf@circuit@bpt@drawgatetrue
746 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
747 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
748 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
749 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
750
751 % Option draw bpt without base connection
752 \newif\ifpgf@circuit@bpt@drawbase
753 \pgf@circuit@bpt@drawbasetrue
754 \pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
755 \ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
756 \pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
757 \ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
758
759 % Option draw bpt with optical input
760 \newif\ifpgf@circuit@bpt@drawphoto
761 \pgf@circuit@bpt@drawphotofalse
762 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
763 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
764 \pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
765 \ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
766
767 % Option draw fet without bulk connection -- Added by Burak Kelleci
768 \newif\ifpgf@circuit@bpt@drawbulk
769 \pgfkeys{/tikz/bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
770 \ctikzset{bulk/.add code={}{\pgf@circuit@bpt@drawbulktrue}}
771 \pgfkeys{/tikz/nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
772 \ctikzset{nobulk/.add code={}{\pgf@circuit@bpt@drawbulkfalse}}
773
774 % Option draw pmos with empty circle
775 \newif\ifpgf@circuit@pmos@emptycircle
776 \pgf@circuit@pmos@emptycirclefalse
777 \ctikzset{tripoles/pmos style/.is choice}
778 \pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
779 \ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
780 % Option draw pmos with no circle
781 \newif\ifpgf@circuit@pmos@nocircle
782 \pgf@circuit@pmos@nocirclefalse
783 \pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
784 \ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}}
785 % back to normal
786 \pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
787 \ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}}
788 % arrows at the end, the correct way
789 \newif\ifpgf@circuit@trans@arrowatend
790 \pgf@circuit@trans@arrowatendfalse
791 \ctikzset{transistors/arrow pos/.is choice}
792 \ctikzset{transistors/arrow pos/legacy/.code={\pgf@circuit@trans@arrowatendfalse}}
793 \ctikzset{transistors/arrow pos/end/.code={\pgf@circuit@trans@arrowatendtrue}}
794
795 \newif\ifpgf@circuit@trans@ntype
796 \pgf@circuit@trans@ntypetrue %default true
797 %\newif\ifpgf@circuit@trans@ptype
798 %\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
799 \ctikzset{tripoles/nmos/width/.initial=.7}
800 \ctikzset{tripoles/nmos/gate height/.initial=.35}
801 \ctikzset{tripoles/nmos/base height/.initial=.5}
802 \ctikzset{tripoles/nmos/conn height/.initial=0}
803 \ctikzset{tripoles/nmos/height/.initial=1.1}
804 \ctikzset{tripoles/nmos/base width/.initial=.5}
805 \ctikzset{tripoles/nmos/gate width/.initial=.62}
806 \ctikzset{tripoles/nmos/arrow pos/.initial=.6}
807 \ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
808 \ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
809 \ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
810 \ctikzset{tripoles/nmos/curr direction/.initial=1}
811
812 \ctikzset{tripoles/pmos/width/.initial=.7}
813 \ctikzset{tripoles/pmos/gate height/.initial=.35}
814 \ctikzset{tripoles/pmos/base height/.initial=.5}
815 \ctikzset{tripoles/pmos/conn height/.initial=0}
816 \ctikzset{tripoles/pmos/height/.initial=1.1}
817 \ctikzset{tripoles/pmos/base width/.initial=.5}
818 \ctikzset{tripoles/pmos/gate width/.initial=.62}
819 \ctikzset{tripoles/pmos/arrow pos/.initial=.4}
820 \ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
821 \ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
822 \ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
823 \ctikzset{tripoles/pmos/curr direction/.initial=-1}
824
825 \ctikzset{tripoles/hemt/width/.initial=.7}
826 \ctikzset{tripoles/hemt/gate height/.initial=.35}
827 \ctikzset{tripoles/hemt/base height/.initial=.5}
828 \ctikzset{tripoles/hemt/conn height/.initial=0}
829 \ctikzset{tripoles/hemt/height/.initial=1.1}
830 \ctikzset{tripoles/hemt/base width/.initial=.5}
831 \ctikzset{tripoles/hemt/gate width/.initial=.62}
832 \ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
833 \ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
834 \ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
835 \ctikzset{tripoles/hemt/curr direction/.initial=1}
836
837 \ctikzset{tripoles/nfet/width/.initial=.7}
838 \ctikzset{tripoles/nfet/gate height/.initial=.35}
839 \ctikzset{tripoles/nfet/base height/.initial=.5}
840 \ctikzset{tripoles/nfet/conn height/.initial=0}
841 \ctikzset{tripoles/nfet/height/.initial=1.1}
842 \ctikzset{tripoles/nfet/base width/.initial=.5}
843 \ctikzset{tripoles/nfet/gate width/.initial=.62}
844 \ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
845 \ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
846 \ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
847 \ctikzset{tripoles/nfet/curr direction/.initial=1}
848
849 \ctikzset{tripoles/pfet/width/.initial=.7}
850 \ctikzset{tripoles/pfet/gate height/.initial=.35}
851 \ctikzset{tripoles/pfet/base height/.initial=.5}
852 \ctikzset{tripoles/pfet/conn height/.initial=0}
853 \ctikzset{tripoles/pfet/height/.initial=1.1}
854 \ctikzset{tripoles/pfet/base width/.initial=.5}
855 \ctikzset{tripoles/pfet/gate width/.initial=.62}
856 \ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
857 \ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
858 \ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
859 \ctikzset{tripoles/pfet/curr direction/.initial=-1}
860
861 \ctikzset{tripoles/nigfete/width/.initial=.7}
862 \ctikzset{tripoles/nigfete/gate height/.initial=.35}
863 \ctikzset{tripoles/nigfete/base height/.initial=.5}
864 \ctikzset{tripoles/nigfete/conn height/.initial=.35}
865 \ctikzset{tripoles/nigfete/height/.initial=1.1}
866 \ctikzset{tripoles/nigfete/base width/.initial=.5}
867 \ctikzset{tripoles/nigfete/gate width/.initial=.62}
868 \ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
869 \ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
870 \ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
871 \ctikzset{tripoles/nigfete/curr direction/.initial=1}
872
873 \ctikzset{tripoles/nigfetd/width/.initial=.7}
874 \ctikzset{tripoles/nigfetd/gate height/.initial=.35}
875 \ctikzset{tripoles/nigfetd/base height/.initial=.5}
876 \ctikzset{tripoles/nigfetd/conn height/.initial=.35}
877 \ctikzset{tripoles/nigfetd/height/.initial=1.1}
878 \ctikzset{tripoles/nigfetd/base width/.initial=.5}
879 \ctikzset{tripoles/nigfetd/gate width/.initial=.62}
880 \ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
881 \ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
882 \ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
883 \ctikzset{tripoles/nigfetd/curr direction/.initial=1}
884
885 \ctikzset{tripoles/nigfetebulk/width/.initial=.7}
886 \ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
887 \ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
888 \ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
889 \ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
890 \ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
891 \ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
892 \ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
893 \ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
894 \ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
895 \ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
896
897 \ctikzset{tripoles/pigfete/width/.initial=.7}
898 \ctikzset{tripoles/pigfete/gate height/.initial=.35}
899 \ctikzset{tripoles/pigfete/base height/.initial=.5}
900 \ctikzset{tripoles/pigfete/conn height/.initial=.35}
901 \ctikzset{tripoles/pigfete/height/.initial=1.1}
902 \ctikzset{tripoles/pigfete/base width/.initial=.5}
903 \ctikzset{tripoles/pigfete/gate width/.initial=.62}
904 \ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
905 \ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
906 \ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
907 \ctikzset{tripoles/pigfete/curr direction/.initial=-1}
908
909 \ctikzset{tripoles/pigfetd/width/.initial=.7}
910 \ctikzset{tripoles/pigfetd/gate height/.initial=.35}
911 \ctikzset{tripoles/pigfetd/base height/.initial=.5}
912 \ctikzset{tripoles/pigfetd/conn height/.initial=.35}
913 \ctikzset{tripoles/pigfetd/height/.initial=1.1}
914 \ctikzset{tripoles/pigfetd/base width/.initial=.5}
915 \ctikzset{tripoles/pigfetd/gate width/.initial=.62}
916 \ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
917 \ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
918 \ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
919 \ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
920
921 \ctikzset{tripoles/pigfetebulk/width/.initial=.7}
922 \ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
923 \ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
924 \ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
925 \ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
926 \ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
927 \ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
928 \ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
929 \ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
930 \ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
931 \ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
932
933 \ctikzset{tripoles/npn/width/.initial=.6}
934 \ctikzset{tripoles/npn/base height/.initial=.45}
935 \ctikzset{tripoles/npn/base height 2/.initial=.15}
936 \ctikzset{tripoles/npn/base height/.initial=.4}
937 \ctikzset{tripoles/npn/conn height/.initial=0}
938 \ctikzset{tripoles/npn/height/.initial=1.1}
939 \ctikzset{tripoles/npn/base width/.initial=.5}
940 \ctikzset{tripoles/npn/arrow pos/.initial=.5}
941 \ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
942 \ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
943 \ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
944 \ctikzset{tripoles/npn/curr direction/.initial=1}
945
946 \ctikzset{tripoles/pnp/width/.initial=.6}
947 \ctikzset{tripoles/pnp/base height/.initial=.45}
948 \ctikzset{tripoles/pnp/base height 2/.initial=.15}
949 \ctikzset{tripoles/pnp/base height/.initial=.4}
950 \ctikzset{tripoles/pnp/conn height/.initial=0}
951 \ctikzset{tripoles/pnp/height/.initial=1.1}
952 \ctikzset{tripoles/pnp/base width/.initial=.5}
953 \ctikzset{tripoles/pnp/arrow pos/.initial=.5}
954 \ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
955 \ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
956 \ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
957 \ctikzset{tripoles/pnp/curr direction/.initial=-1}
958
959 \ctikzset{tripoles/pigbt/width/.initial=.6}
960 \ctikzset{tripoles/pigbt/gate height/.initial=.45}
961 \ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
962 \ctikzset{tripoles/pigbt/base height/.initial=.4}
963 \ctikzset{tripoles/pigbt/conn height/.initial=0}
964 \ctikzset{tripoles/pigbt/height/.initial=1.1}
965 \ctikzset{tripoles/pigbt/gate width/.initial=.62}
966 \ctikzset{tripoles/pigbt/base width/.initial=.5}
967 \ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
968 \ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
969 \ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
970 \ctikzset{tripoles/pigbt/curr direction/.initial=-1}
971
972 \ctikzset{tripoles/nigbt/width/.initial=.6}
973 \ctikzset{tripoles/nigbt/gate height/.initial=.45}
974 \ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
975 \ctikzset{tripoles/nigbt/base height/.initial=.4}
976 \ctikzset{tripoles/nigbt/conn height/.initial=0}
977 \ctikzset{tripoles/nigbt/height/.initial=1.1}
978 \ctikzset{tripoles/nigbt/gate width/.initial=.62}
979 \ctikzset{tripoles/nigbt/base width/.initial=.5}
980 \ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
981 \ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
982 \ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
983 \ctikzset{tripoles/nigbt/curr direction/.initial=1}
984
985 \ctikzset{tripoles/Lpigbt/width/.initial=.6}
986 \ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
987 \ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
988 \ctikzset{tripoles/Lpigbt/base height/.initial=.4}
989 \ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
990 \ctikzset{tripoles/Lpigbt/height/.initial=1.1}
991 \ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
992 \ctikzset{tripoles/Lpigbt/base width/.initial=.5}
993 \ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
994 \ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
995 \ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
996 \ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
997
998 \ctikzset{tripoles/Lnigbt/width/.initial=.6}
999 \ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
1000 \ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
1001 \ctikzset{tripoles/Lnigbt/base height/.initial=.4}
1002 \ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
1003 \ctikzset{tripoles/Lnigbt/height/.initial=1.1}
1004 \ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
1005 \ctikzset{tripoles/Lnigbt/base width/.initial=.5}
1006 \ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
1007 \ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
1008 \ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
1009 \ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
1010
1011 \ctikzset{tripoles/njfet/width/.initial=.7}
1012 \ctikzset{tripoles/njfet/gate height/.initial=.5}
1013 \ctikzset{tripoles/njfet/gate height 2/.initial=.35}
1014 \ctikzset{tripoles/njfet/gate width/.initial=.5}
1015 \ctikzset{tripoles/njfet/conn height/.initial=.35}
1016 \ctikzset{tripoles/njfet/height/.initial=1.1}
1017 \ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
1018 \ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
1019 \ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
1020 \ctikzset{tripoles/njfet/curr direction/.initial=1}
1021
1022 \ctikzset{tripoles/pjfet/width/.initial=.7}
1023 \ctikzset{tripoles/pjfet/gate height/.initial=.5}
1024 \ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
1025 \ctikzset{tripoles/pjfet/gate width/.initial=.5}
1026 \ctikzset{tripoles/pjfet/conn height/.initial=.35}
1027 \ctikzset{tripoles/pjfet/height/.initial=1.1}
1028 \ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
1029 \ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
1030 \ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
1031 \ctikzset{tripoles/pjfet/curr direction/.initial=-1}
1032
1033 \ctikzset{tripoles/isfet/width/.initial=1}
1034 \ctikzset{tripoles/isfet/gate height/.initial=.35}
1035 \ctikzset{tripoles/isfet/base height/.initial=.5}
1036 \ctikzset{tripoles/isfet/height/.initial=1.1}
1037 \ctikzset{tripoles/isfet/base width/.initial=.3}
1038 \ctikzset{tripoles/isfet/gate width/.initial=.5}
1039 \ctikzset{tripoles/isfet/conn height/.initial=0}
1040 \ctikzset{tripoles/isfet/wave width/.initial=.16}
1041 \ctikzset{tripoles/isfet/wave amp/.initial=.06}
1042 \ctikzset{tripoles/isfet/waves y sep/.initial=.22}
1043 \ctikzset{tripoles/isfet/waves x sep/.initial=.8}
1044 \ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
1045 \ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
1046 \ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
1047 \ctikzset{tripoles/isfet/curr direction/.initial=1}
1048 %
1049 % multi-emitter and multi-collector BJTs by Romano Giannetti
1050 %
1051 \ctikzset{tripoles/bjt/emitters/.initial=1}
1052 \ctikzset{tripoles/bjt/collectors/.initial=1}
1053 \pgfkeys{/tikz/emitters/.add code={}{\ctikzset{tripoles/bjt/emitters=#1}}}
1054 \pgfkeys{/tikz/collectors/.add code={}{\ctikzset{tripoles/bjt/collectors=#1}}}
1055 \ctikzset{tripoles/bjt/pins width/.initial=0.3}
1056 \pgfkeys{/tikz/bjt pins width/.add code={}{\ctikzset{tripoles/bjt/pins width=#1}}}
1057 \ctikzset{tripoles/bjt/multi height/.initial=.5}
1058 \pgfkeys{/tikz/bjt multi height/.add code={}{\ctikzset{tripoles/bjt/multi height/.initial=#1}}}
1059 %
1060 \ctikzset{tripoles/bjt/width/.initial=.3}
1061 \ctikzset{tripoles/bjt/base height 2/.initial=.4}
1062 \ctikzset{tripoles/bjt/base height/.initial=1.1}
1063 \ctikzset{tripoles/bjt/height/.initial=.4}
1064 \ctikzset{tripoles/bjt/base width/.initial=1}
1065 \ctikzset{tripoles/bjt/arrow pos/.initial=.5}
1066 % do NOT touch these two!
1067 \ctikzset{tripoles/bjt/npn/curr direction/.initial=1}
1068 \ctikzset{tripoles/bjt/pnp/curr direction/.initial=-1}
1069
1070 %% transistors stop here
1071
1072 %% Logic ports
1073
1074 \newif\ifpgf@circuit@europeanlogicport
1075 \ctikzset{logic ports/.is choice}
1076 \ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
1077 \tikzset{and port/.style={shape=european and port}}%
1078 \tikzset{or port/.style={shape=european or port}}%
1079 \tikzset{xor port/.style={shape=european xor port}}%
1080 \tikzset{buffer port/.style={shape=european buffer port}}%
1081 \tikzset{not port/.style={shape=european not port}}%
1082 \tikzset{nand port/.style={shape=european nand port}}%
1083 \tikzset{nor port/.style={shape=european nor port}}%
1084 \tikzset{xnor port/.style={shape=european xnor port}}%
1085 }}
1086 \ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
1087 \tikzset{and port/.style={shape=american and port}}%
1088 \tikzset{or port/.style={shape=american or port}}%
1089 \tikzset{xor port/.style={shape=american xor port}}%
1090 \tikzset{buffer port/.style={shape=american buffer port}}%
1091 \tikzset{not port/.style={shape=american not port}}%
1092 \tikzset{nand port/.style={shape=american nand port}}%
1093 \tikzset{nor port/.style={shape=american nor port}}%
1094 \tikzset{xnor port/.style={shape=american xnor port}}%
1095 }}
1096
1097 \ctikzset{logic ports origin/.is choice}
1098 \ctikzset{logic ports origin/legacy/.code={
1099 \ctikzset{tripoles/american and port/origin/.initial=0.8}%
1100 \ctikzset{tripoles/american nand port/origin/.initial=0.8}%
1101 \ctikzset{tripoles/american nor port/origin/.initial=0.8}%
1102 \ctikzset{tripoles/american or port/origin/.initial=0.8}%
1103 \ctikzset{tripoles/american xor port/origin/.initial=0.8}%
1104 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}%
1105 \ctikzset{tripoles/european and port/origin/.initial=0.8}%
1106 \ctikzset{tripoles/european nand port/origin/.initial=0.8}%
1107 \ctikzset{tripoles/european or port/origin/.initial=0.8}%
1108 \ctikzset{tripoles/european nor port/origin/.initial=0.8}%
1109 \ctikzset{tripoles/european xor port/origin/.initial=0.8}%
1110 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}%
1111 \ctikzset{tripoles/european buffer port/origin/.initial=0.8}%
1112 \ctikzset{tripoles/european not port/origin/.initial=0.8}%
1113 }%
1114 }
1115 \ctikzset{logic ports origin/center/.code={%
1116 \ctikzset{tripoles/american and port/origin/.initial=0}%
1117 \ctikzset{tripoles/american nand port/origin/.initial=0}%
1118 \ctikzset{tripoles/american nor port/origin/.initial=0}%
1119 \ctikzset{tripoles/american or port/origin/.initial=0}%
1120 \ctikzset{tripoles/american xor port/origin/.initial=0}%
1121 \ctikzset{tripoles/american xnor port/origin/.initial=0}%
1122 \ctikzset{tripoles/european and port/origin/.initial=0}%
1123 \ctikzset{tripoles/european nand port/origin/.initial=0}%
1124 \ctikzset{tripoles/european or port/origin/.initial=0}%
1125 \ctikzset{tripoles/european nor port/origin/.initial=0}%
1126 \ctikzset{tripoles/european xor port/origin/.initial=0}%
1127 \ctikzset{tripoles/european xnor port/origin/.initial=0}%
1128 \ctikzset{tripoles/european buffer port/origin/.initial=0}%
1129 \ctikzset{tripoles/european not port/origin/.initial=0}%
1130 }%
1131 }
1132
1133
1134 \ctikzset{tripoles/american and port/width/.initial=1.1}
1135 \ctikzset{tripoles/american and port/height/.initial=.8}
1136 \ctikzset{tripoles/american and port/port width/.initial=.7}
1137 \ctikzset{tripoles/american and port/input height/.initial=.5}
1138 \ctikzset{tripoles/american nand port/width/.initial=1.1}
1139 \ctikzset{tripoles/american nand port/height/.initial=.8}
1140 \ctikzset{tripoles/american nand port/port width/.initial=.7}
1141 \ctikzset{tripoles/american nand port/circle width/.initial=.15}
1142 \ctikzset{tripoles/american nand port/input height/.initial=.5}
1143 \ctikzset{tripoles/american or port/width/.initial=1.1}
1144 \ctikzset{tripoles/american or port/height/.initial=.8}
1145 \ctikzset{tripoles/american or port/port width/.initial=.7}
1146 \ctikzset{tripoles/american or port/input height/.initial=.5}
1147 \ctikzset{tripoles/american or port/input skip/.initial=.25}
1148 \ctikzset{tripoles/american or port/aaa/.initial=.6}
1149 \ctikzset{tripoles/american or port/bbb/.initial=.4}
1150 \ctikzset{tripoles/american or port/ccc/.initial=.5}
1151 \ctikzset{tripoles/american or port/ddd/.initial=.0}
1152 \ctikzset{tripoles/american nor port/width/.initial=1.1}
1153 \ctikzset{tripoles/american nor port/height/.initial=.8}
1154 \ctikzset{tripoles/american nor port/port width/.initial=.7}
1155 \ctikzset{tripoles/american nor port/input height/.initial=.5}
1156 \ctikzset{tripoles/american nor port/input skip/.initial=.25}
1157 \ctikzset{tripoles/american nor port/circle width/.initial=.15}
1158 \ctikzset{tripoles/american nor port/aaa/.initial=.6}
1159 \ctikzset{tripoles/american nor port/bbb/.initial=.4}
1160 \ctikzset{tripoles/american nor port/ccc/.initial=.5}
1161 \ctikzset{tripoles/american nor port/ddd/.initial=.0}
1162 \ctikzset{tripoles/american xor port/width/.initial=1.1}
1163 \ctikzset{tripoles/american xor port/height/.initial=.8}
1164 \ctikzset{tripoles/american xor port/port width/.initial=.7}
1165 \ctikzset{tripoles/american xor port/input height/.initial=.5}
1166 \ctikzset{tripoles/american xor port/input skip/.initial=.15}
1167 \ctikzset{tripoles/american xor port/distance/.initial=.1}
1168 \ctikzset{tripoles/american xnor port/width/.initial=1.1}
1169 \ctikzset{tripoles/american xnor port/height/.initial=.8}
1170 \ctikzset{tripoles/american xnor port/port width/.initial=.7}
1171 \ctikzset{tripoles/american xnor port/input height/.initial=.5}
1172 \ctikzset{tripoles/american xnor port/input skip/.initial=.15}
1173 \ctikzset{tripoles/american xnor port/distance/.initial=.1}
1174 \ctikzset{tripoles/american xnor port/circle width/.initial=.15}
1175 \ctikzset{tripoles/american and port/origin/.initial=0.8}
1176 \ctikzset{tripoles/american and port/inputs/.initial=2}
1177 % variable number of inputs
1178 \ctikzset{tripoles/american nand port/origin/.initial=0.8}
1179 \ctikzset{tripoles/american nand port/inputs/.initial=2}
1180 \ctikzset{tripoles/american nor port/origin/.initial=0.8}
1181 \ctikzset{tripoles/american nor port/inputs/.initial=2}
1182 \ctikzset{tripoles/american nor port/angle/.initial=70}
1183 \ctikzset{tripoles/american nor port/inner/.initial=0.3}
1184 \ctikzset{tripoles/american or port/origin/.initial=0.8}
1185 \ctikzset{tripoles/american or port/inputs/.initial=2}
1186 \ctikzset{tripoles/american or port/angle/.initial=70}
1187 \ctikzset{tripoles/american or port/inner/.initial=0.3}
1188 \ctikzset{tripoles/american xor port/origin/.initial=0.8}
1189 \ctikzset{tripoles/american xor port/inputs/.initial=2}
1190 \ctikzset{tripoles/american xor port/angle/.initial=70}
1191 \ctikzset{tripoles/american xor port/inner/.initial=0.3}
1192 \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
1193 \ctikzset{tripoles/american xnor port/inputs/.initial=2}
1194 \ctikzset{tripoles/american xnor port/angle/.initial=70}
1195 \ctikzset{tripoles/american xnor port/inner/.initial=0.3}
1196
1197 \ctikzset{tripoles/european and port/width/.initial=1.4}
1198 \ctikzset{tripoles/european and port/height/.initial=.65}
1199 \ctikzset{tripoles/european and port/reserved/.initial=.6}
1200 \ctikzset{tripoles/european and port/input height/.initial=.6}
1201 \ctikzset{tripoles/european or port/width/.initial=1.4}
1202 \ctikzset{tripoles/european or port/height/.initial=.65}
1203 \ctikzset{tripoles/european or port/reserved/.initial=.6}
1204 \ctikzset{tripoles/european or port/input height/.initial=.6}
1205 \ctikzset{tripoles/european xor port/width/.initial=1.4}
1206 \ctikzset{tripoles/european xor port/height/.initial=.65}
1207 \ctikzset{tripoles/european xor port/reserved/.initial=.6}
1208 \ctikzset{tripoles/european xor port/input height/.initial=.6}
1209 \ctikzset{tripoles/european nand port/width/.initial=1.4}
1210 \ctikzset{tripoles/european nand port/not height/.initial=.3}
1211 \ctikzset{tripoles/european nand port/not width/.initial=.8}
1212 \ctikzset{tripoles/european nand port/height/.initial=.65}
1213 \ctikzset{tripoles/european nand port/reserved/.initial=.6}
1214 \ctikzset{tripoles/european nand port/input height/.initial=.6}
1215 \ctikzset{tripoles/european buffer port/width/.initial=1.4}
1216 \ctikzset{tripoles/european buffer port/not height/.initial=.3}
1217 \ctikzset{tripoles/european buffer port/not width/.initial=.8}
1218 \ctikzset{tripoles/european buffer port/height/.initial=.65}
1219 \ctikzset{tripoles/european buffer port/reserved/.initial=.6}
1220 \ctikzset{tripoles/european buffer port/input height/.initial=0}
1221 \ctikzset{tripoles/european not port/width/.initial=1.4}
1222 \ctikzset{tripoles/european not port/not height/.initial=.3}
1223 \ctikzset{tripoles/european not port/not width/.initial=.8}
1224 \ctikzset{tripoles/european not port/height/.initial=.65}
1225 \ctikzset{tripoles/european not port/reserved/.initial=.6}
1226 \ctikzset{tripoles/european not port/input height/.initial=0}
1227 \ctikzset{tripoles/european xnor port/width/.initial=1.4}
1228 \ctikzset{tripoles/european xnor port/not height/.initial=.3}
1229 \ctikzset{tripoles/european xnor port/not width/.initial=.8}
1230 \ctikzset{tripoles/european xnor port/height/.initial=.65}
1231 \ctikzset{tripoles/european xnor port/reserved/.initial=.6}
1232 \ctikzset{tripoles/european xnor port/input height/.initial=.6}
1233 \ctikzset{tripoles/european nor port/width/.initial=1.4}
1234 \ctikzset{tripoles/european nor port/not height/.initial=.3}
1235 \ctikzset{tripoles/european nor port/not width/.initial=.8}
1236 \ctikzset{tripoles/european nor port/height/.initial=.65}
1237 \ctikzset{tripoles/european nor port/reserved/.initial=.6}
1238 \ctikzset{tripoles/european nor port/input height/.initial=.6}
1239 % variable number of inputs
1240 \ctikzset{tripoles/european and port/origin/.initial=0.8}
1241 \ctikzset{tripoles/european and port/inputs/.initial=2}
1242 \ctikzset{tripoles/european nand port/origin/.initial=0.8}
1243 \ctikzset{tripoles/european nand port/inputs/.initial=2}
1244 \ctikzset{tripoles/european or port/origin/.initial=0.8}
1245 \ctikzset{tripoles/european or port/inputs/.initial=2}
1246 \ctikzset{tripoles/european nor port/origin/.initial=0.8}
1247 \ctikzset{tripoles/european nor port/inputs/.initial=2}
1248 \ctikzset{tripoles/european xor port/origin/.initial=0.8}
1249 \ctikzset{tripoles/european xor port/inputs/.initial=2}
1250 \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
1251 \ctikzset{tripoles/european xnor port/inputs/.initial=2}
1252 \ctikzset{tripoles/european buffer port/origin/.initial=0.8}
1253 \ctikzset{tripoles/european buffer port/inputs/.initial=1}%
1254 \ctikzset{tripoles/european not port/origin/.initial=0.8}
1255 \ctikzset{tripoles/european not port/inputs/.initial=1}%
1256 %%% parameters that are not used anymore after multi-input
1257 %%% gates --- left for compatibility of source code.
1258 \ctikzset{tripoles/american xor port/aaa/.initial=.6}
1259 \ctikzset{tripoles/american xor port/bbb/.initial=.4}
1260 \ctikzset{tripoles/american xor port/ccc/.initial=.5}
1261 \ctikzset{tripoles/american xor port/ddd/.initial=.0}
1262 \ctikzset{tripoles/american xnor port/aaa/.initial=.6}
1263 \ctikzset{tripoles/american xnor port/bbb/.initial=.4}
1264 \ctikzset{tripoles/american xnor port/ccc/.initial=.5}
1265 \ctikzset{tripoles/american xnor port/ddd/.initial=.0}
1266 % switches for logic gates
1267 %
1268 \pgfkeys{/tikz/number inputs/.initial=0}
1269 \pgfkeys{/tikz/number inputs/.default=0}
1270 %
1271 % switches for op amps
1272 % changing input polarity
1273 %
1274 \newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
1275 \pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1276 \ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
1277 \pgfkeys{/tikz/noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1278 \ctikzset{noinv input down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
1279 %
1280 % changing output polarity (for fully diff objects)
1281 %
1282 \newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
1283 \pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1284 \ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
1285 \pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1286 \ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
1287
1288 % Operational amplifier
1289 \ctikzset{tripoles/op amp/width/.initial=1.7} % Total width
1290 \ctikzset{tripoles/op amp/port width/.initial=.7} % Terminals length
1291 \ctikzset{tripoles/op amp/height/.initial=1.4} % Total height
1292 \ctikzset{tripoles/op amp/input height/.initial=.5} % Input port vertical separation
1293 \ctikzset{tripoles/op amp/up pos/.initial=.45} % Top and bottom anchor position
1294 \ctikzset{tripoles/op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1295
1296 % Fully differential operational amplifier
1297 \ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width
1298 \ctikzset{tripoles/fd op amp/port width/.initial=.7} % Terminals length
1299 \ctikzset{tripoles/fd op amp/height/.initial=1.4} % Total height
1300 \ctikzset{tripoles/fd op amp/input height/.initial=.5} % Input port vertical separation
1301 \ctikzset{tripoles/fd op amp/output height/.initial=.5} % Output port vertical separation
1302 \ctikzset{tripoles/fd op amp/up pos/.initial=.45} % Top and bottom anchor position
1303 \ctikzset{tripoles/fd op amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1304
1305 \ctikzset{tripoles/en amp/width/.initial=1.7}
1306 \ctikzset{tripoles/en amp/port width/.initial=.7}
1307 \ctikzset{tripoles/en amp/height/.initial=1.6}
1308 \ctikzset{tripoles/en amp/input height/.initial=.3}
1309 \ctikzset{tripoles/en amp/up pos/.initial=.45}
1310 \ctikzset{tripoles/en amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1311 \ctikzset{tripoles/en amp/font2/.initial=\pgf@circ@font@twelve} % Absolute font size needed!
1312 \ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
1313 \tikzset{
1314 en amp text/.code = {%
1315 \ctikzsetvalof{tripoles/en amp/text}{#1}%
1316 },
1317 en amp text A/.code = {%
1318 \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}%
1319 },
1320 }
1321
1322 % Transconductance amplifier
1323 \ctikzset{tripoles/gm amp/width/.initial=1.7} % Total width
1324 \ctikzset{tripoles/gm amp/port width/.initial=.7} % Terminals length
1325 \ctikzset{tripoles/gm amp/height/.initial=1.4} % Left side of the trapezoid
1326 \ctikzset{tripoles/gm amp/height 2/.initial=0.5} % Right side of the trapezoid
1327 \ctikzset{tripoles/gm amp/input height/.initial=.5} % Input port vertical separation
1328 \ctikzset{tripoles/gm amp/up pos/.initial=.45} % Top and bottom anchor position
1329 \ctikzset{tripoles/gm amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1330
1331 % Instrumentation amplifier
1332 \ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width
1333 \ctikzset{tripoles/inst amp/port width/.initial=.7} % Terminals length
1334 \ctikzset{tripoles/inst amp/height/.initial=1.4} % Left side of the trapezoid
1335 \ctikzset{tripoles/inst amp/height 2/.initial=0.6} % Right side of the trapezoid
1336 \ctikzset{tripoles/inst amp/input height/.initial=.5} % Input ports vertical separation
1337 \ctikzset{tripoles/inst amp/up pos/.initial=.4} % Top and bottom anchor position
1338 \ctikzset{tripoles/inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
1339 \ctikzset{tripoles/inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1340
1341 % Instrumentation amplifier with differential output
1342 \ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width
1343 \ctikzset{tripoles/fd inst amp/port width/.initial=.7} % Terminals length
1344 \ctikzset{tripoles/fd inst amp/height/.initial=1.4} % Left side of the trapezoid
1345 \ctikzset{tripoles/fd inst amp/height 2/.initial=0.6} % Right side of the trapezoid
1346 \ctikzset{tripoles/fd inst amp/input height/.initial=.5} % Input ports vertical separation
1347 \ctikzset{tripoles/fd inst amp/output height/.initial=.5} % Output ports vertical separation
1348 \ctikzset{tripoles/fd inst amp/up pos/.initial=.4} % Top and bottom anchor position
1349 \ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
1350 \ctikzset{tripoles/fd inst amp/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1351
1352 % Instrumentation amplifier with gain resistor terminals
1353 \ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width
1354 \ctikzset{tripoles/inst amp ra/port width/.initial=.7} % Terminals length
1355 \ctikzset{tripoles/inst amp ra/height/.initial=2.9} % Left side of the trapezoid
1356 \ctikzset{tripoles/inst amp ra/height 2/.initial=0.4} % Right side of the trapezoid
1357 \ctikzset{tripoles/inst amp ra/input height/.initial=.7} % Input ports vertical separation
1358 \ctikzset{tripoles/inst amp ra/up pos/.initial=.4} % Top and bottom anchor position
1359 \ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} % Top and bottom voltage reference position
1360 \ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} % Gain resistor terminals vertical separation
1361 \ctikzset{tripoles/inst amp ra/font/.initial=\pgf@circ@font@tenbm} % Absolute font size needed!
1362
1363 % Plain amplifier
1364 \ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width
1365 \ctikzset{tripoles/plain amp/port width/.initial=.7} % Terminals length
1366 \ctikzset{tripoles/plain amp/height/.initial=1.4} % Total height
1367 \ctikzset{tripoles/plain amp/input height/.initial=.5} % Input ports vertical separation
1368 \ctikzset{tripoles/plain amp/up pos/.initial=.45} % Top and bottom anchor position
1369
1370 \ctikzset{tripoles/thyristor/height/.initial=1.10}
1371 \ctikzset{tripoles/thyristor/height 2/.initial=.5}
1372 \ctikzset{tripoles/thyristor/width/.initial=1.0}
1373 \ctikzset{tripoles/thyristor/diode height/.initial=.5}
1374 \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
1375 \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
1376
1377 \ctikzset{tripoles/triac/height/.initial=1.1}
1378 \ctikzset{tripoles/triac/width/.initial=1}
1379 \ctikzset{tripoles/triac/diode width left/.initial=.3}
1380 \ctikzset{tripoles/triac/diode width right/.initial=.3}
1381
1382 %% Cute switches
1383 \ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
1384 \ctikzset{bipoles/cuteswitch/height/.initial=.6}
1385 \ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
1386 \ctikzset{bipoles/cuteswitch/width/.initial=.50}
1387 \ctikzset{bipoles/cuteswitch/thickness/.initial=1}
1388
1389 \ctikzset{tripoles/spdt/width/.initial=.85}
1390 \ctikzset{tripoles/spdt/height/.initial=.45}
1391 \ctikzset{tripoles/spdt/margin/.initial=.45}
1392
1393 \ctikzset{tripoles/toggleswitch/height/.initial=.8}
1394 \ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
1395 \ctikzset{tripoles/toggleswitch/width/.initial=.80}
1396
1397 \ctikzset{tripoles/mixer/width/.initial=0.7}
1398 \ctikzset{tripoles/adder/width/.initial=0.7}
1399 \ctikzset{tripoles/circulator/width/.initial=.7}
1400 \ctikzset{tripoles/oscillator/width/.initial=.7}
1401
1402
1403 \ctikzset{tripoles/wilkinson/height/.initial=1.3}
1404 \ctikzset{tripoles/wilkinson/width/.initial=1.3}
1405
1406 \ctikzset{quadpoles/transformer/inner/.initial=0.4}
1407 \ctikzset{quadpoles/transformer/width/.initial=1.5}
1408 \ctikzset{quadpoles/transformer/width1/.initial=.4}
1409 \ctikzset{quadpoles/transformer/height/.initial=1.5}
1410 \ctikzset{quadpoles/transformer/height1/.initial=.8}
1411 \ctikzset{quadpoles/transformer core/inner/.initial=0.4}
1412 \ctikzset{quadpoles/transformer core/width/.initial=1.5}
1413 \ctikzset{quadpoles/transformer core/height/.initial=1.5}
1414 \ctikzset{quadpoles/transformer core/core height/.initial=.5}
1415 \ctikzset{quadpoles/transformer core/core width/.initial=.05}
1416 \ctikzset{quadpoles/gyrator/inner/.initial=0.4}
1417 \ctikzset{quadpoles/gyrator/width/.initial=1.5}
1418 \ctikzset{quadpoles/gyrator/height/.initial=1.5}
1419 \ctikzset{quadpoles/fourport/width/.initial=1.3}
1420 \ctikzset{quadpoles/fourport/height/.initial=1.3}
1421 \ctikzset{quadpoles/coupler/width/.initial=1.3}
1422 \ctikzset{quadpoles/coupler/height/.initial=1.3}
1423 \ctikzset{quadpoles/coupler2/width/.initial=1.3}
1424 \ctikzset{quadpoles/coupler2/height/.initial=1.3}
1425
1426 \ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
1427
1428 \ctikzset{quadpoles style/.is choice}
1429 \ctikzset{quadpoles style/inward/.code={% default value
1430 \ctikzset{quadpoles/transformer/inner=0.4}%
1431 \ctikzset{quadpoles/transformer/width=1.5}%
1432 \ctikzset{quadpoles/transformer core/inner=0.4}%
1433 \ctikzset{quadpoles/transformer core/width=1.5}%
1434 \ctikzset{quadpoles/gyrator/inner=0.4}%
1435 \ctikzset{quadpoles/gyrator/width=1.5}%
1436 }%
1437 }
1438 \ctikzset{quadpoles style/inline/.code={% now horizontal baffle
1439 \ctikzset{quadpoles/transformer/inner=1}%
1440 \ctikzset{quadpoles/transformer/width=0.6}%
1441 \ctikzset{quadpoles/transformer core/inner=1}%
1442 \ctikzset{quadpoles/transformer core/width=0.6}%
1443 \ctikzset{quadpoles/gyrator/inner=1} % FIXME
1444 \ctikzset{quadpoles/gyrator/width=0.6}%
1445 }%
1446 }
1447
1448 %
1449 % multipoles
1450 %
1451 \ctikzset{multipoles/thickness/.initial=2}
1452 \ctikzset{multipoles/font/.initial=\pgf@circ@font@tiny}
1453 % DIP (dual in line package) chips
1454 \ctikzset{multipoles/dipchip/width/.initial=1.2}
1455 \ctikzset{multipoles/dipchip/num pins/.initial=8}
1456 \ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
1457 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
1458 % QFP (quad flat package) chips
1459 \ctikzset{multipoles/qfpchip/num pins/.initial=8}
1460 \ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
1461 \pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
1462 % chip numbers
1463 \newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
1464 \pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1465 \ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
1466 \pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1467 \ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
1468 \newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
1469 \pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1470 \ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
1471 \pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1472 \ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
1473 % external chip pins
1474 \ctikzset{multipoles/external pins thickness/.initial=1}
1475 \ctikzset{multipoles/external pins width/.initial=0.2}
1476 \ctikzset{multipoles/external pad fraction/.initial=0}
1477 \pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
1478 \pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
1479 % topmarks
1480 \newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
1481 \pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1482 \ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
1483 \pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1484 \ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
1485
1486 % rotary switch by Romano
1487 \ctikzset{multipoles/rotary/thickness/.initial=1}
1488 \ctikzset{multipoles/rotary/shape/.initial=ocirc}
1489 \ctikzset{multipoles/rotary/channels/.initial=5}
1490 \ctikzset{multipoles/rotary/angle/.initial=60}
1491 \ctikzset{multipoles/rotary/wiper/.initial=20}
1492 \ctikzset{multipoles/rotary/arrow/.is choice}
1493 \newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
1494 \newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
1495 \newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
1496 \ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
1497 \ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
1498 \ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
1499 \ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
1500
1501 \tikzset{%
1502 rotary switch/.style args={#1in#2wiper#3}{%
1503 shape=rotaryswitch,
1504 /tikz/circuitikz/multipoles/rotary/channels=#1,
1505 /tikz/circuitikz/multipoles/rotary/angle=#2,
1506 /tikz/circuitikz/multipoles/rotary/wiper=#3,
1507 },
1508 rotary switch -/.style args={#1in#2wiper#3}{
1509 rotary switch=#1 in #2 wiper #3,
1510 /tikz/circuitikz/multipoles/rotary/arrow=none,
1511 },
1512 rotary switch <-/.style args={#1in#2wiper#3}{
1513 rotary switch=#1 in #2 wiper #3,
1514 /tikz/circuitikz/multipoles/rotary/arrow=ccw,
1515 },
1516 rotary switch ->/.style args={#1in#2wiper#3}{
1517 rotary switch=#1 in #2 wiper #3,
1518 /tikz/circuitikz/multipoles/rotary/arrow=cw,
1519 },
1520 rotary switch <->/.style args={#1in#2wiper#3}{
1521 rotary switch=#1 in #2 wiper #3,
1522 /tikz/circuitikz/multipoles/rotary/arrow=both,
1523 },
1524 % Notice that these should be the same as the initial values of the keys
1525 rotary switch/.default={5 in 60 wiper 20},
1526 rotary switch -/.default={5 in 60 wiper 20},
1527 rotary switch <-/.default={5 in 60 wiper 20},
1528 rotary switch ->/.default={5 in 60 wiper 20},
1529 rotary switch <->/.default={5 in 60 wiper 20},
1530 }
1531
1532 % %Mechanical section
1533 \ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
1534 \ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
1535 \ctikzset{bipoles/spring/height/.initial=.5}
1536 \ctikzset{bipoles/spring/width/.initial=.5}
1537 \ctikzset{bipoles/mass/height/.initial=.55}
1538 \ctikzset{bipoles/mass/box height/.initial=.4}
1539 \ctikzset{bipoles/mass/width/.initial=.5}
1540
1541 \ctikzset{bipoles/damper/height/.initial=.35}
1542 \ctikzset{bipoles/damper/length/.initial=.3}
1543 \ctikzset{bipoles/damper/width/.initial=.4}
1544
1545
1546 \ctikzset{bipole/.is family}
1547 \ctikzset{bipole/kind/.initial=}
1548 \ctikzset{bipole/name/.initial=}
1549 \newif\ifpgf@circuit@bipole@isvoltage
1550 \ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
1551 \newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
1552 \ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
1553 \newif\ifpgf@circuit@bipole@strokedsymbol
1554 \ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
1555 \newif\ifpgf@circuit@bipole@iscurrent
1556 \ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
1557
1558 \ctikzset{bipole/voltage/.is family}
1559 \newif\ifpgf@circuit@bipole@voltage@backward
1560 \ctikzset{bipole/voltage/direction/.is choice}
1561 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
1562 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
1563 \newif\ifpgf@circuit@bipole@voltage@below
1564 \ctikzset{bipole/voltage/position/.is choice}
1565 \ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
1566 \ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
1567
1568 \ctikzset{bipole/voltage/label/unit/.initial=}
1569 \ctikzset{bipole/voltage/label/name/.initial=}
1570
1571 \ctikzset{bipole/current/.is family}
1572 \newif\ifpgf@circuit@bipole@current@backward
1573 \ctikzset{bipole/current/direction/.is choice}
1574 \ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
1575 \ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
1576 \newif\ifpgf@circuit@bipole@current@before
1577 \ctikzset{bipole/current/x position/.is choice}
1578 \ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
1579 \ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
1580 \newif\ifpgf@circuit@bipole@current@below
1581 \ctikzset{bipole/current/y position/.is choice}
1582 \ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
1583 \ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
1584 \ctikzset{bipole/current/label/unit/.initial=}
1585 \ctikzset{bipole/current/label/name/.initial=}
1586
1587 \ctikzset{bipole/flow/.is family}
1588 \newif\ifpgf@circuit@bipole@flow@backward
1589 \ctikzset{bipole/flow/direction/.is choice}
1590 \ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
1591 \ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
1592 \newif\ifpgf@circuit@bipole@flow@before
1593 \ctikzset{bipole/flow/x position/.is choice}
1594 \ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
1595 \ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
1596 \newif\ifpgf@circuit@bipole@flow@below
1597 \ctikzset{bipole/flow/y position/.is choice}
1598 \ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
1599 \ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
1600 \ctikzset{bipole/flow/label/unit/.initial=}
1601 \ctikzset{bipole/flow/label/name/.initial=}
1602 \ctikzset{flow/distance/.initial = .5}
1603 \ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
1604
1605 \ctikzset{bipole/label/.is family}
1606 \ctikzset{bipole/label/position/.initial=90}
1607 \ctikzset{bipole/label/unit/.initial=}
1608 \ctikzset{bipole/label/name/.initial=}
1609 \ctikzset{bipole/annotation/.is family}
1610 \ctikzset{bipole/annotation/position/.initial=-90}
1611 \ctikzset{bipole/annotation/unit/.initial=}
1612 \ctikzset{bipole/annotation/name/.initial=}
1613
1614 \newif\ifpgf@circuit@europeanresistor
1615 \ctikzset{resistor/.is choice}
1616 \ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
1617 \ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
1618
1619 \ctikzset{inductor/.is choice}
1620 \ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
1621 \ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
1622 \ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
1623
1624 \newif\ifpgf@circuit@strokediode
1625 \newif\ifpgf@circuit@fulldiode
1626 \pgf@circuit@strokediodefalse
1627 \pgf@circuit@fulldiodefalse
1628
1629 \ctikzset{diode/.is choice}
1630 \ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
1631 \ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
1632 \ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
1633
1634 \tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}}
1635 \tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}}
1636 \tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}}
1637
1638 \ctikzset{thickness/.initial=2}
1639 \ctikzset{color/.initial=black}
1640 \pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
1641
1642 \newif\ifpgf@circ@siunitx
1643 \newif\ifpgf@circ@siunitx@res
1644
1645 \ctikzset{straight/.is choice}
1646 \ctikzset{straightvoltage value/.initial=true}
1647 \ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
1648 \ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
1649 \ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
1650 \newif\ifpgf@circuit@bipole@voltage@straight
1651 \ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
1652
1653
1654 \ctikzset{voltage/.is family}
1655 \ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
1656 \ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
1657 \ctikzset{voltage/bump a/.initial=1.2}
1658 \ctikzset{voltage/bump b/.initial=1.5}
1659 \ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
1660 \ctikzset{voltage shift/.style={voltage/shift=#1}}
1661 \tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
1662 \ctikzset{voltage/european label distance/.initial=1.4}
1663 \ctikzset{voltage/american label distance/.initial=1.1}
1664 % shaping the +/- sign, see pgfcircvoltage.tex
1665 \ctikzset{voltage/american font/.initial={}}
1666 \ctikzset{voltage/american plus/.initial={$+$}}
1667 \ctikzset{voltage/american minus/.initial={$-$}}
1668
1669 % special cases
1670 \ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
1671 \ctikzset{bipoles/generic/voltage/bump b/.initial=2}
1672 \ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
1673 %\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
1674 \ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
1675 \ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
1676 \ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
1677 \ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
1678 \ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
1679 \ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
1680 \ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
1681 \ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
1682 \ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
1683 \ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
1684 \ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
1685 %\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
1686 \ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
1687 \ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
1688 %\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
1689 \ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
1690 \ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
1691 %\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
1692 \ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
1693 \ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
1694 %\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
1695 \ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
1696 \ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
1697 %\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
1698 \ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
1699 %\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
1700 \ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
1701
1702 \ctikzset{current/.is family}
1703 \ctikzset{current/distance/.initial = .5}
1704
1705
1706 \tikzset{american currents/.style = {\circuitikzbasekey/current = american}}
1707 \tikzset{european currents/.style = {\circuitikzbasekey/current = european}}
1708 \tikzset{american voltages/.style = {\circuitikzbasekey/voltage = american}}
1709 \tikzset{european voltages/.style = {\circuitikzbasekey/voltage = european}}
1710 \tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}}
1711 \tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}
1712
1713 \newif\ifpgf@circuit@europeangfsurgearrester
1714 \ctikzset{gas filled surge arrester choice/.is choice}
1715 \ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue}}
1716 \ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse}}
1717
1718 \tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}}
1719 \tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}}
1720 \tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}}
1721 \tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}}
1722 \tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}}
1723 \tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}}
1724 \tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}}
1725 \tikzset{european/.style = {european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set}}
1726 \tikzset{american/.style = {american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set}}
1727 \tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}}
1728
1729 % I should try to make the tree clearer (this voltage conflicts with the options above)
1730
1731 \newif\ifpgf@circuit@europeanvoltage
1732 \ctikzset{voltage/.is choice}
1733 \ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse}}
1734 \ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue}}
1735
1736 \newif\ifpgf@circuit@europeancurrent
1737 \ctikzset{current/.is choice}
1738 \ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse}
1739 \ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue}
1740
1741 % noise sources
1742 \ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
1743
1744 \ctikzset{label/align/.is choice}
1745 \ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
1746 \ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
1747 \ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
1748
1749 % seven segment displays by RGtti
1750
1751 \newif\ifpgf@circ@sevenseg@dot
1752 \newif\ifpgf@circ@sevenseg@box
1753 \def\pgf@circ@sevenseg@dotstate{empty}
1754 \ctikzset{seven seg/.is family}
1755 \ctikzset{seven seg/dot/.is choice}
1756 % none means no dot, not space for it. Empty means no dot, but space
1757 \ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
1758 \ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
1759 \ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
1760 \ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
1761 %
1762 \ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
1763 \ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
1764 \ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
1765 \ctikzset{seven seg/box sep/.initial=1pt}% external box gap
1766 \ctikzset{seven seg/color on/.initial=red}% color for segment "on"
1767 \ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
1768 \ctikzset{seven seg/box/.is choice}
1769 \ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
1770 \ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
1771
1772 \ctikzset{seven seg/bits/.initial=0000000}
1773
1774 \ctikzset{seven seg/value/.code={%
1775 \edef\@@tmp{#1}%
1776 \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
1777 \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
1778 \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
1779 \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
1780 \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
1781 \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
1782 \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
1783 \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
1784 \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
1785 \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
1786 \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1787 \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1788 \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1789 \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1790 \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1791 \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1792 \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1793 \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1794 \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1795 \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1796 \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1797 \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1798 \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
1799 \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
1800 \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
1801 \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
1802 \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
1803 \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
1804 \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
1805 }}
1806
1807 \tikzset{%
1808 seven segment val/.style args={#1dot#2box#3}{%
1809 shape=bare7seg,
1810 /tikz/circuitikz/seven seg/value=#1,
1811 /tikz/circuitikz/seven seg/dot=#2,
1812 /tikz/circuitikz/seven seg/box=#3,
1813 },
1814 seven segment bits/.style args={#1dot#2box#3}{%
1815 shape=bare7seg,
1816 /tikz/circuitikz/seven seg/bits=#1,
1817 /tikz/circuitikz/seven seg/dot=#2,
1818 /tikz/circuitikz/seven seg/box=#3,
1819 },
1820 }
1821
1822
1823 %%%%%%%%%% new
1824 \pgfkeys{\circuitikzbasekey/.search also={/tikz}}
1825
1826 % Electronic tubes: diodetube, triode, tetrode and pentode
1827 \ctikzset{tubes/width/.initial=1} % relative width
1828 \ctikzset{tubes/height/.initial=1.4} % relative height
1829 \ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
1830 \ctikzset{tubes/anode distance/.initial=0.40} % distance from center
1831 \ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
1832 \ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
1833 \ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
1834 \ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
1835 \ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
1836 \ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
1837 \ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
1838 \ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
1839 \ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
1840 \ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
1841 \ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
1842
1843 \newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
1844 \pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
1845 \ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
1846 \newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
1847 \pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
1848 \ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
1849 \newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
1850 \pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
1851 \ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
1852
1853 %%%---------- close: tex/pgfcirc.defines
1854 %%%%%%%%%%% Springe nach tex/pgfcircutils
1855 %%%---------- open: tex/pgfcircutils.tex
1856 % Copyright 2007-2009 by Massimo Redaelli
1857 %
1858 % This file may be distributed and/or modified
1859 %
1860 % 1. under the LaTeX Project Public License and/or
1861 % 2. under the GNU Public License.
1862 %
1863 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
1864
1865 %\def\pgf@circ@handleSI#1{%
1866 % \pgf@circ@siunitx@resfalse
1867 %
1868 % \edef\len{\stringlength[e]{#1}}
1869 %\testmatchingchar[e]{#1}{\len}{>}%
1870 %\ifmatchingchar%
1871 % \ifnum\findchars{#1}{<}=0
1872 % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
1873 %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
1874 %\pgf@circ@siunitx@restrue
1875 % \else
1876 % \fi
1877 %\else
1878 %\fi
1879 %}
1880
1881 \def\pgf@circ@handleSI#1{
1882 \noexpandarg
1883 \def\pgf@temp{}
1884 \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
1885 \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
1886
1887 \ifnum\pgf@circ@handleSI@unit@len=0
1888 \pgf@circ@siunitx@resfalse
1889 \else
1890 \IfEndWith{#1}{>}{
1891 \pgf@circ@siunitx@restrue
1892 \noexpandarg
1893 \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
1894 %\typeout{si |#1|}
1895 }{
1896 \pgf@circ@siunitx@resfalse
1897 %\typeout{no si |#1|}
1898 }
1899 \fi
1900 }
1901
1902 \def\pgf@circ@ifkeyempty#1{
1903 \pgfextra{
1904 \ctikzset{#1/.get=\pgf@circ@temp}
1905 \edef\pgf@temp{}
1906 }
1907 \ifx\pgf@circ@temp\pgf@temp
1908 }
1909
1910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1911 %% Math routines
1912
1913 \def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
1914
1915 %%%---------- close: tex/pgfcircutils
1916
1917 %%%%%%%%%%% Springe nach tex/pgfcircshapes
1918 %%%---------- open: tex/pgfcircshapes.tex
1919 % Copyright 2007-2009 by Massimo Redaelli
1920 %
1921 % This file may be distributed and/or modified
1922 %
1923 % 1. under the LaTeX Project Public License and/or
1924 % 2. under the GNU Public License.
1925 %
1926 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
1927
1928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1929 %% Other shapes
1930
1931 %% Nothing
1932
1933 \pgfdeclareshape{emptyshape}{
1934 \savedanchor{\northeast}{%
1935 \pgf@x=.5\wd\pgfnodeparttextbox%
1936 \pgf@y=.5\ht\pgfnodeparttextbox%
1937 }
1938 \anchor{north}{\northeast\pgf@x=0cm\relax}
1939 \anchor{east}{\northeast\pgf@y=0cm\relax}
1940 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
1941 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
1942 \anchor{north east}{\northeast}
1943 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
1944 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
1945 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
1946 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
1947 \anchor{center}{
1948 \pgfpointorigin
1949 }
1950 }
1951
1952 %% Full terminal
1953
1954 \pgfdeclareshape{circ}{
1955 \anchor{center}{
1956 \pgfpointorigin
1957 }
1958 \savedanchor\northwest{%
1959 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
1960 \pgf@x=-\pgf@y
1961 }
1962 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
1963 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1964 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
1965 \anchor{west}{ \northwest \pgf@y=0pt }
1966 \anchor{w}{ \northwest \pgf@y=0pt }
1967 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1968 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
1969 \anchor{north}{ \northwest \pgf@x=0pt }
1970 \anchor{n}{ \northwest \pgf@x=0pt }
1971 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
1972 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
1973 \anchor{north west}{ \northwest }
1974 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
1975 \anchorborder{
1976 \pgf@circ@res@left=\pgf@x
1977 \pgf@circ@res@up=\pgf@y
1978 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
1979 }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
1980 }
1981 \behindforegroundpath{
1982
1983 \pgfscope
1984 \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
1985 \pgfsetcolor{\ctikzvalof{color}}
1986 \pgfsetfillopacity{1.0}
1987 \pgfusepath{draw,fill}
1988 \endpgfscope
1989
1990 }
1991 }
1992
1993 %% Empty terminal
1994
1995 \pgfdeclareshape{ocirc}{
1996 \anchor{center}{
1997 \pgfpointorigin
1998 }
1999 \savedanchor\northwest{%
2000 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2001 \pgf@x=-\pgf@y
2002 }
2003 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2004 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2005 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2006 \anchor{west}{ \northwest \pgf@y=0pt }
2007 \anchor{w}{ \northwest \pgf@y=0pt }
2008 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2009 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2010 \anchor{north}{ \northwest \pgf@x=0pt }
2011 \anchor{n}{ \northwest \pgf@x=0pt }
2012 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2013 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2014 \anchor{north west}{ \northwest }
2015 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2016 \anchorborder{
2017 \pgf@circ@res@left=\pgf@x
2018 \pgf@circ@res@up=\pgf@y
2019 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2020 }{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2021 }
2022
2023 \behindforegroundpath{
2024
2025 \pgfscope
2026 \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2027 \pgfsetcolor{\ctikzvalof{color}}
2028 \ifx\tikz@fillcolor\pgfutil@empty
2029 % set the default fill color to white
2030 \pgfsetfillcolor{white}
2031 % ...but override it if the class is defined!
2032 % note that this element has no class, but will inherit it when used
2033 % into another component
2034 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2035 \else
2036 \pgfsetfillcolor{\tikz@fillcolor}
2037 \fi
2038 \pgfsetfillopacity{1.0}
2039 \pgfusepath{draw,fill}
2040 \endpgfscope
2041
2042 }
2043 }
2044
2045 %% Diamond terminal
2046
2047 \pgfdeclareshape{diamondpole}{
2048 \anchor{center}{
2049 \pgfpointorigin
2050 }
2051 \savedanchor\northwest{%
2052 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2053 \pgf@x=-\pgf@y
2054 }
2055 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2056 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2057 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2058 \anchor{west}{ \northwest \pgf@y=0pt }
2059 \anchor{w}{ \northwest \pgf@y=0pt }
2060 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2061 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2062 \anchor{north}{ \northwest \pgf@x=0pt }
2063 \anchor{n}{ \northwest \pgf@x=0pt }
2064 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2065 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2066 \anchor{north west}{ \northwest }
2067 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2068 \anchorborder{
2069 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2070 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2071 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2072 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2073 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2074 \pgfextracty{\pgf@circ@res@up}{\northwest}
2075 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2076 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2077 \pgfpointintersectionoflines
2078 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2079 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2080 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2081 \pgf@x=\@@switchx\pgf@x
2082 \pgf@y=\@@switchy\pgf@y
2083 }
2084 \behindforegroundpath{
2085 \pgfscope
2086 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2087 \pgftransformrotate{45}
2088 \pgfpathrectanglecorners
2089 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2090 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2091 \pgfsetcolor{\ctikzvalof{color}}
2092 \pgfsetfillopacity{1.0}
2093 \pgfusepath{draw,fill}
2094 \endpgfscope
2095 }
2096 }
2097
2098 %% Diamond terminal, unfilled
2099
2100 \pgfdeclareshape{odiamondpole}{
2101 \anchor{center}{
2102 \pgfpointorigin
2103 }
2104 \savedanchor\northwest{%
2105 \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2106 \pgf@x=-\pgf@y
2107 }
2108 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2109 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2110 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2111 \anchor{west}{ \northwest \pgf@y=0pt }
2112 \anchor{w}{ \northwest \pgf@y=0pt }
2113 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2114 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2115 \anchor{north}{ \northwest \pgf@x=0pt }
2116 \anchor{n}{ \northwest \pgf@x=0pt }
2117 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2118 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2119 \anchor{north west}{ \northwest }
2120 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2121 \anchorborder{
2122 % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
2123 \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
2124 \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
2125 \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
2126 \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
2127 \pgfextracty{\pgf@circ@res@up}{\northwest}
2128 % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
2129 % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
2130 \pgfpointintersectionoflines
2131 {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
2132 {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
2133 % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
2134 \pgf@x=\@@switchx\pgf@x
2135 \pgf@y=\@@switchy\pgf@y
2136 }
2137 \behindforegroundpath{
2138 \pgfscope
2139 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2140 \pgftransformrotate{45}
2141 \pgfpathrectanglecorners
2142 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2143 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2144 \pgfsetcolor{\ctikzvalof{color}}
2145 \ifx\tikz@fillcolor\pgfutil@empty
2146 % set the default fill color to white
2147 \pgfsetfillcolor{white}
2148 % ...but override it if the class is defined!
2149 % note that this element has no class, but will inherit it when used
2150 % into another component
2151 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2152 \else
2153 \pgfsetfillcolor{\tikz@fillcolor}
2154 \fi
2155 \pgfsetfillopacity{1.0}
2156 \pgfusepath{draw,fill}
2157 \endpgfscope
2158 }
2159 }
2160
2161 %% square terminal, filled
2162
2163 \pgfdeclareshape{squarepole}{
2164 \anchor{center}{
2165 \pgfpointorigin
2166 }
2167 \savedanchor\northwest{%
2168 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2169 \pgf@x=-\pgf@y
2170 }
2171 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2172 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2173 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2174 \anchor{west}{ \northwest \pgf@y=0pt }
2175 \anchor{w}{ \northwest \pgf@y=0pt }
2176 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2177 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2178 \anchor{north}{ \northwest \pgf@x=0pt }
2179 \anchor{n}{ \northwest \pgf@x=0pt }
2180 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2181 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2182 \anchor{north west}{ \northwest }
2183 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2184 \anchorborder{
2185 \pgf@xa=\pgf@x
2186 \pgf@ya=\pgf@y
2187 \pgfextracty{\pgf@circ@res@up}{\northwest}
2188 \pgfpointborderrectangle
2189 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2190 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2191 }
2192 \behindforegroundpath{
2193 \pgfscope
2194 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2195 \pgfpathrectanglecorners
2196 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2197 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2198 \pgfsetcolor{\ctikzvalof{color}}
2199 \pgfsetfillopacity{1.0}
2200 \pgfusepath{draw,fill}
2201 \endpgfscope
2202 }
2203 }
2204 %% square terminal, unfilled
2205
2206 \pgfdeclareshape{osquarepole}{
2207 \anchor{center}{
2208 \pgfpointorigin
2209 }
2210 \savedanchor\northwest{%
2211 \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2212 \pgf@x=-\pgf@y
2213 }
2214 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2215 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2216 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2217 \anchor{west}{ \northwest \pgf@y=0pt }
2218 \anchor{w}{ \northwest \pgf@y=0pt }
2219 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2220 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2221 \anchor{north}{ \northwest \pgf@x=0pt }
2222 \anchor{n}{ \northwest \pgf@x=0pt }
2223 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2224 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2225 \anchor{north west}{ \northwest }
2226 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2227 \anchorborder{
2228 \pgf@xa=\pgf@x
2229 \pgf@ya=\pgf@y
2230 \pgfextracty{\pgf@circ@res@up}{\northwest}
2231 \pgfpointborderrectangle
2232 {\pgfqpoint{\pgf@xa}{\pgf@ya}}
2233 {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
2234 }
2235 \behindforegroundpath{
2236 \pgfscope
2237 \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
2238 \pgfpathrectanglecorners
2239 {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
2240 {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
2241 \pgfsetcolor{\ctikzvalof{color}}
2242 \ifx\tikz@fillcolor\pgfutil@empty
2243 % set the default fill color to white
2244 \pgfsetfillcolor{white}
2245 % ...but override it if the class is defined!
2246 % note that this element has no class, but will inherit it when used
2247 % into another component
2248 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
2249 \else
2250 \pgfsetfillcolor{\tikz@fillcolor}
2251 \fi
2252 \pgfsetfillopacity{1.0}
2253 \pgfusepath{draw,fill}
2254 \endpgfscope
2255 }
2256 }
2257 % BNC connector
2258
2259 \pgfdeclareshape{bnc}{
2260 \anchor{center}{
2261 \pgfpointorigin
2262 }
2263 % BNC size is 2.5 times the size of the internal "ocirc"
2264 \savedanchor\northwest{%
2265 \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
2266 \pgf@y=2.5\pgf@y
2267 \pgf@x=-\pgf@y
2268 }
2269 % center is on the opening
2270 \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2271 \anchor{zero}{ \pgfpointorigin }
2272 \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2273 \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2274 % geo-anchors
2275 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2276 \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2277 \anchor{west}{ \northwest \pgf@y=0pt }
2278 \anchor{left}{ \northwest \pgf@y=0pt }
2279 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2280 \anchor{north}{ \northwest \pgf@x=0pt }
2281 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2282 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2283 \anchor{north west}{ \northwest }
2284 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2285 % put the node text above and centered
2286 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
2287 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
2288 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
2289 }
2290 }
2291 \anchorborder{
2292 \pgf@circ@res@left=\pgf@x
2293 \pgf@circ@res@up=\pgf@y
2294 \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
2295 }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
2296 }
2297 \behindforegroundpath{
2298 \pgfextracty{\pgf@circ@res@other}{\northwest}
2299 \pgf@circ@res@step=\ctikzvalof{nodes width}\pgf@circ@Rlen
2300 \pgfscope
2301 \pgfstartlinewidth=\pgflinewidth
2302 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
2303 \pgfsetcolor{\ctikzvalof{color}}
2304 % external circle
2305 \pgfscope
2306 % clipping path: first a rectangle bigger then the shape
2307 % to avoid problems with the line thickness
2308 \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
2309 {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
2310 % next the opening to the right
2311 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
2312 {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
2313 % do the difference and clip before drawing
2314 \pgfseteorule
2315 \pgfusepath{clip}
2316 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
2317 \pgfusepath{draw}
2318 \endpgfscope
2319 % internal circle
2320 \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
2321 \pgf@circ@draworfill
2322 % and the contact line to the right
2323 \pgfsetlinewidth{\pgfstartlinewidth}
2324 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2325 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
2326 \pgfusepath{draw}
2327 \endpgfscope
2328 }
2329 }
2330
2331 %% Fill for correct rectangular joins
2332
2333 \pgfdeclareshape{rectjoinfill}{
2334 \savedanchor{\northeast}{%
2335 \pgf@x=.5\pgflinewidth%
2336 \pgf@y=.5\pgflinewidth%
2337 }
2338 \anchor{north}{\northeast\pgf@x=0cm\relax}
2339 \anchor{east}{\northeast\pgf@y=0cm\relax}
2340 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2341 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2342 \anchor{north east}{\northeast}
2343 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2344 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2345 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2346 \anchor{center}{
2347 \pgfpointorigin
2348 }
2349 \anchorborder{
2350 \pgf@circ@res@left=\pgf@x
2351 \pgf@circ@res@up=\pgf@y
2352 }
2353 \behindforegroundpath{
2354 \pgfscope
2355 \pgfpathrectanglecorners
2356 {\pgfpoint{0}{.5\pgflinewidth}}
2357 {\pgfpoint{0}{-.5\pgflinewidth}}
2358 \pgfsetcolor{\ctikzvalof{color}}
2359 \pgfusepath{draw,fill}
2360 \endpgfscope
2361 }
2362 }
2363
2364 %% transistor arrow
2365
2366 \def\pgf@circ@find@linescale{
2367 % find the scale inverse of the scale factor: line width do not scale
2368 % with scale=..., transform shape so we have to counteract it.
2369 \iftikz@fullytransformed % this is true if `transform shape` is active
2370 % from @Circumscribe https://tex.stackexchange.com/a/474035/38080
2371 % Note that this trick is not working inside a `spy` environment...
2372 \pgfgettransformentries{\scaleA}{\scaleB}{\scaleC}{\scaleD}{\whatevs}{\whatevs}%
2373 \pgfmathsetmacro{\@@factor}{1.0/sqrt(abs(\scaleA*\scaleD-\scaleB*\scaleC))}%
2374 \else
2375 \pgfmathsetmacro{\@@factor}{1.0}
2376 \fi
2377 }
2378
2379 \pgfdeclareshape{trarrow}{%
2380 % this arrow is only filled but grows with the linewidth, more or less
2381 % like currarrow do
2382 \savedanchor{\northeast}{%
2383 \pgf@circ@res@step = \pgf@circ@Rlen
2384 \pgf@circ@find@linescale
2385 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2386 \pgfpoint{0.7*\pgf@circ@res@step +0.5*\@@factor*\pgflinewidth}
2387 {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
2388 }
2389 % The arrow size should be more or less the same of a currarrow, which is
2390 % both filled and stroke, for backward output compatibility (more or less)
2391 %
2392 % angle \beta W is \pgf@circ@Rlen/\ctikzvalof{current arrow scale}
2393 % |-\__ currarrow as the tip at (W,0)
2394 % | | and the upper tail at (-0.7*W, 0.8*W)
2395 % | \__ it then "overshoot" do to the linew width L
2396 % | \__ xangle \alpha
2397 % ---0------->
2398 %
2399 % \beta = atan(0.7/0.8) \alpha=atan(0.8/1.7)
2400 % tip overshoot is (L/2)/sin(\alpha) = 1.743*L only in x direction
2401 % tail overshoot is -(L/2) in x, and (L/2)/sin(\beta) = 0.7539*L in y
2402 %
2403 \savedanchor{\northwest}{%
2404 \pgf@circ@res@step = \pgf@circ@Rlen
2405 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2406 \pgf@circ@find@linescale
2407 \pgfpoint{-0.7*\pgf@circ@res@step -0.5*\@@factor*\pgflinewidth}
2408 {0.8*\pgf@circ@res@step+0.7593*\@@factor*\pgflinewidth}
2409 }
2410 \savedanchor{\tip}{%
2411 \pgf@circ@res@step = \pgf@circ@Rlen
2412 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2413 \pgf@circ@find@linescale
2414 \pgfpoint{\pgf@circ@res@step + 1.743*\@@factor*\pgflinewidth}{0pt}
2415 }
2416 \anchor{north}{\northeast\pgf@x=0cm\relax}
2417 \anchor{east}{\northeast\pgf@y=0cm\relax}
2418 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2419 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2420 \anchor{north east}{\northeast}
2421 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2422 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2423 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2424 \anchor{center}{
2425 \pgfpointorigin
2426 }
2427 \anchor{tip}{
2428 \tip
2429 }
2430 \anchor{btip}{% this anchor is behind the tip of half a linewidth
2431 \tip
2432 \pgf@circ@find@linescale
2433 \pgf@circ@res@temp=\@@factor\pgflinewidth
2434 \advance\pgf@x by -.5\pgf@circ@res@temp
2435 }
2436 \behindforegroundpath{
2437 \pgfscope
2438 \northwest
2439 \pgf@circ@res@up=\pgf@y
2440 \pgf@circ@res@left=\pgf@x
2441 \tip
2442 \pgf@circ@res@step = \pgf@x
2443 %
2444 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2445 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
2446 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2447 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
2448 \pgfpathclose
2449 \pgfsetcolor{\ctikzvalof{color}}
2450 \pgfusepath{fill} % just fill
2451 \endpgfscope
2452 }
2453 }
2454
2455 %% Current arrow
2456
2457 \pgfdeclareshape{currarrow}{
2458 \savedanchor{\northeast}{%
2459 \pgf@circ@res@step = \pgf@circ@Rlen
2460 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2461 \pgf@x=.5\pgf@circ@res@step
2462 \pgf@y=\pgf@x%
2463 }
2464 \anchor{north}{\northeast\pgf@x=0cm\relax}
2465 \anchor{east}{\northeast\pgf@y=0cm\relax}
2466 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2467 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2468 \anchor{north east}{\northeast}
2469 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2470 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2471 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2472 \anchor{center}{
2473 \pgfpointorigin
2474 }
2475 \anchor{tip}{
2476 \pgfpointorigin
2477 \pgf@circ@res@step = \pgf@circ@Rlen
2478 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2479 \pgf@x =\pgf@circ@res@step
2480 }
2481 \behindforegroundpath{
2482 \pgfscope
2483 \pgf@circ@res@step = \pgf@circ@Rlen
2484 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2485
2486 \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2487 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2488 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
2489 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2490 \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
2491 \pgfsetcolor{\ctikzvalof{color}}
2492 \pgfusepath{draw,fill}
2493
2494 \endpgfscope
2495 }
2496 }
2497
2498 %% Flow arrow
2499
2500 \pgfdeclareshape{flowarrow}{
2501 \savedanchor{\northeast}{%
2502 \pgf@circ@res@step = \pgf@circ@Rlen
2503 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2504 \pgf@y=.5\pgf@circ@res@step
2505 \pgf@circ@res@step = \pgf@circ@Rlen
2506 \divide \pgf@circ@res@step by 4
2507 \pgf@x=\pgf@circ@res@step%
2508 }
2509 \anchor{north}{\northeast\pgf@x=0cm\relax}
2510 \anchor{east}{\northeast\pgf@y=0cm\relax}
2511 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2512 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2513 \anchor{north east}{\northeast}
2514 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2515 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
2516 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2517 \anchor{text}{% text centered above
2518 \pgfpointorigin
2519 \pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}
2520 }
2521 \anchor{center}{
2522 \pgfpointorigin
2523 }
2524 \anchor{tip}{
2525 \pgfpointorigin
2526 \pgf@circ@res@step = \pgf@circ@Rlen
2527 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2528 \pgf@x =\pgf@circ@res@step
2529 }
2530 \behindforegroundpath{
2531 \pgfscope
2532 \pgf@circ@res@step = \pgf@circ@Rlen
2533 \divide \pgf@circ@res@step by 4
2534 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
2535 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
2536 \pgfsetcolor{\ctikzvalof{color}}
2537 \pgfusepath{draw}
2538 \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
2539 \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
2540 \endpgfscope
2541 }
2542 }
2543
2544 %% Input arrow
2545
2546 \pgfdeclareshape{inputarrow}{
2547 \savedanchor{\northeast}{% this is really not northeast, really -northwest
2548 \pgf@circ@res@step = \pgf@circ@Rlen
2549 \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
2550 \pgf@y=.5\pgf@circ@res@step
2551 \pgf@x=1.7\pgf@circ@res@step
2552 }
2553 \anchor{north}{\northeast\pgf@x=0cm\relax}
2554 \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
2555 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
2556 \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
2557 \anchor{north east}{\northeast\pgf@x=0cm\relax}
2558 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2559 \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
2560 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
2561 \savedanchor{\tip}{
2562 \pgfpointorigin
2563 }
2564 \anchor{center}{
2565 \tip
2566 }
2567 \anchor{tip}{
2568 \tip
2569 }
2570 \behindforegroundpath{
2571
2572 \pgfscope
2573 \pgf@circ@res@step = \pgf@circ@Rlen
2574 \divide \pgf@circ@res@step by 16
2575
2576 \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2577 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
2578 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
2579 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2580 \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
2581 \pgfsetcolor{\ctikzvalof{color}}
2582 \pgfusepath{fill}
2583
2584 \endpgfscope
2585 }
2586 }
2587
2588
2589 %% box
2590
2591 \pgfdeclareshape{box}{
2592 \anchor{center}{
2593 \pgfpointorigin
2594 }
2595 \behindforegroundpath{
2596
2597 \pgfscope
2598 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
2599 \pgf@circ@res@step = 0.5\pgf@circ@res@step
2600 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
2601 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
2602 \pgf@circ@draworfill
2603 \endpgfscope
2604 }
2605 }
2606
2607 %% box scaled with blocks
2608
2609 \pgfdeclareshape{blockbox}{
2610 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}}
2611 \anchor{center}{
2612 \pgfpointorigin
2613 }
2614 \behindforegroundpath{
2615 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}
2616 \pgfscope
2617 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
2618 \pgf@circ@res@step = 0.5\pgf@circ@res@step
2619 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
2620 \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
2621 \pgf@circ@draworfill
2622 \endpgfscope
2623 }
2624 }
2625
2626 % full nodes for wire crossing
2627
2628 \pgfdeclareshape{jump crossing}
2629 {
2630 \savedanchor\northwest{%
2631 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2632 \pgf@y=.5\pgf@y
2633 \pgf@x=-\pgf@y
2634 }
2635 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2636 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2637 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2638 \anchor{west}{ \northwest \pgf@y=0pt }
2639 \anchor{w}{ \northwest \pgf@y=0pt }
2640 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2641 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2642 \anchor{north}{ \northwest \pgf@x=0pt }
2643 \anchor{n}{ \northwest \pgf@x=0pt }
2644 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2645 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2646 \anchor{north west}{ \northwest }
2647 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2648 \behindbackgroundpath{
2649 \northwest
2650 \pgf@circ@res@up = \pgf@y
2651 \pgf@circ@res@down = -\pgf@y
2652 \pgf@circ@res@right = -\pgf@x
2653 \pgf@circ@res@left = \pgf@x
2654 % horizontal jumper
2655 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2656 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
2657 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
2658 \pgfsetbeveljoin
2659 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
2660 % vertical, broken path
2661 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
2662 \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
2663 \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
2664 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
2665 \pgfusepath{draw}
2666
2667 }
2668 }
2669 \pgfdeclareshape{plain crossing}
2670 {
2671 \savedanchor\northwest{%
2672 \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
2673 \pgf@y=.5\pgf@y
2674 \pgf@x=-\pgf@y
2675 }
2676 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
2677 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2678 \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
2679 \anchor{west}{ \northwest \pgf@y=0pt }
2680 \anchor{w}{ \northwest \pgf@y=0pt }
2681 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2682 \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
2683 \anchor{north}{ \northwest \pgf@x=0pt }
2684 \anchor{n}{ \northwest \pgf@x=0pt }
2685 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
2686 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
2687 \anchor{north west}{ \northwest }
2688 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
2689 \behindbackgroundpath{
2690 \northwest
2691 \pgf@circ@res@up = \pgf@y
2692 \pgf@circ@res@down = -\pgf@y
2693 \pgf@circ@res@right = -\pgf@x
2694 \pgf@circ@res@left = \pgf@x
2695 % horizontal jumper
2696 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
2697 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
2698 % vertical, broken path
2699 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
2700 \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
2701 \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
2702 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
2703 \pgfusepath{draw}
2704
2705 }
2706 }
2707
2708 %%%---------- close: tex/pgfcircshapes
2709 %%%%%%%%%%% Springe nach tex/pgfcircmonopoles
2710 %%%---------- open: tex/pgfcircmonopoles.tex
2711 % Copyright 2007-2009 by Massimo Redaelli
2712 %
2713 % This file may be distributed and/or modified
2714 %
2715 % 1. under the LaTeX Project Public License and/or
2716 % 2. under the GNU Public License.
2717 %
2718 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
2719
2720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2721 %% Monopoles
2722 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2723
2724 %%%%%%%%%%%%%
2725 %% Grounds
2726 %%%%%%%%%%%%%
2727
2728
2729 %% Ground symbol
2730 % #1 -> name
2731 % #2 -> width
2732 % #3 -> depth
2733 % #4 -> code
2734 \long\def\pgf@circ@declareground#1#2#3#4{
2735 \pgfdeclareshape{#1}{
2736 \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
2737 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
2738 \savedanchor{\southeast}{
2739 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
2740 \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
2741 \pgf@x=#2\pgf@x
2742 \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
2743 \pgf@y=-#3\pgf@y
2744 }
2745 \anchor{north}{\pgfpointorigin}
2746 \anchor{north east}{\southeast\pgf@y=0pt\relax}
2747 \anchor{east}{\southeast\pgf@y=.5\pgf@y}
2748 \anchor{south east}{\southeast}
2749 \anchor{south}{\southeast\pgf@x=0pt\relax}
2750 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
2751 \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
2752 \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
2753 \anchor{left}{\pgfpointorigin}
2754 \anchor{right}{\pgfpointorigin}
2755 \anchor{center}{\pgfpointorigin}
2756 \behindforegroundpath{
2757 \pgf@circ@scaled@Rlen=\scaledRlen
2758 \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
2759 \pgfscope
2760 \pgfstartlinewidth=\pgflinewidth
2761 #4
2762 \endpgfscope
2763 }
2764 }
2765 }
2766
2767
2768 \pgf@circ@declareground{ground}{0.6}{1.6}{
2769 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2770 \pgfpathmoveto{\pgfpointorigin}
2771 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
2772 \pgfusepath{draw}
2773 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
2774 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2775 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2776 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2777 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2778 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2779 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2780 \pgfusepath{draw}
2781 }
2782
2783 \pgf@circ@declareground{tlground}{0.6}{0.4}{
2784 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
2785 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
2786 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
2787 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
2788 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
2789 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
2790 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}
2791 \pgfusepath{draw}
2792 }
2793
2794
2795 \pgf@circ@declareground{rground}{0.6}{1}{
2796 \pgfpathmoveto{\pgfpointorigin}
2797 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2798 \pgfusepath{draw}
2799
2800 \pgfstartlinewidth=\pgflinewidth
2801 \pgf@circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
2802
2803 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2804 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2805 \pgfsetroundcap\pgfusepath{draw}
2806 }
2807
2808 \pgf@circ@declareground{tground}{0.6}{0}{
2809 \pgfpathmoveto{\pgfpointorigin}
2810 \pgfusepath{draw}
2811
2812 \pgfstartlinewidth=\pgflinewidth
2813 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
2814
2815 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
2816 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
2817 \pgfusepath{draw}
2818 }
2819
2820 \pgf@circ@declareground{sground}{0.6}{1.8}{
2821 \pgfpathmoveto{\pgfpointorigin}
2822 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2823 \pgfusepath{draw}
2824
2825 \pgfstartlinewidth=\pgflinewidth
2826 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
2827
2828 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2829 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
2830 \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
2831 \pgfpathclose
2832 \pgf@circ@draworfill
2833 }
2834
2835 % noiseless ground
2836 \pgf@circ@declareground{nground}{0.9}{1.6}{
2837 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2838 \pgfpathmoveto{\pgfpointorigin}
2839 \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
2840 \pgfusepath{draw}
2841 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
2842 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2843 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2844 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2845 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2846 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2847 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2848 \pgfusepath{draw}
2849 \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
2850 \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
2851 \pgfusepath{draw}
2852 }
2853
2854 % protective ground
2855 \pgf@circ@declareground{pground}{0.9}{1.8}{
2856 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
2857 \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
2858 \pgf@circ@draworfill
2859 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2860 \pgfpathmoveto{\pgfpointorigin}
2861 \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
2862 \pgfusepath{draw}
2863 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
2864 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2865 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2866 \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2867 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
2868 \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2869 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
2870 \pgfusepath{draw}
2871 }
2872
2873 % chassis ground
2874 \pgf@circ@declareground{cground}{1}{2}{
2875 \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
2876 \pgfpathmoveto{\pgfpointorigin}
2877 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
2878 \pgfusepath{draw}
2879 \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
2880 \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2881 \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2882 \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2883 \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2884 \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
2885 \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
2886 \pgfusepath{draw}
2887 }
2888
2889 % Contributed by @fotesan https://github.com/fotesan
2890 % european ground
2891 \pgf@circ@declareground{eground}{1.1}{1.7}{
2892 \pgfpathmoveto{\pgfpointorigin}
2893 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2894 \pgfusepath{draw}
2895
2896 \pgfstartlinewidth=\pgflinewidth
2897 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
2898
2899 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2900 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2901 \pgfusepath{draw}
2902
2903 \pgfsetlinewidth{\pgfstartlinewidth}
2904 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2905 \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2906 \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2907 \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2908 \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2909 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2910 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2911 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2912 \pgfusepath{draw}
2913 }
2914
2915 \pgf@circ@declareground{eground2}{1.1}{1.7}{
2916 \pgfpathmoveto{\pgfpointorigin}
2917 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
2918 \pgfusepath{draw}
2919
2920 \pgfstartlinewidth=\pgflinewidth
2921 \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
2922
2923 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2924 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
2925 \pgfusepath{draw}
2926
2927 \pgfsetlinewidth{\pgfstartlinewidth}
2928 \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2929 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2930 \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2931 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2932 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
2933 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
2934 \pgfusepath{draw}
2935 }
2936
2937 %%%%%%%%%%%%%%%%%%
2938 %% Power supplies
2939 %%%%%%%%%%%%%%%%%%
2940
2941 % Vcc
2942 \pgfdeclareshape{vcc}{
2943 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
2944 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
2945 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
2946 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
2947 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
2948 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
2949 }
2950 \savedanchor{\northeast}{%
2951 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
2952 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
2953 \pgf@x=.5\pgf@circ@res@step
2954 \pgf@y=3\pgf@x%
2955 }
2956 \anchor{north}{\northeast\pgf@x=0cm\relax}
2957 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
2958 \anchor{south}{\pgfpointorigin}
2959 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
2960 \anchor{north east}{\northeast}
2961 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
2962 \anchor{south east}{\northeast\pgf@y=0pt\relax}
2963 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
2964 \anchor{center}{\pgfpointorigin}
2965 \anchor{left}{\pgfpointorigin}
2966 \anchor{right}{\pgfpointorigin}
2967 \anchor{text}{
2968 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
2969 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
2970 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
2971 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
2972 \pgf@x=0pt
2973 \pgf@y=2\pgf@circ@res@step
2974 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
2975 \pgf@x=-.5\wd\pgfnodeparttextbox
2976 }
2977 \behindforegroundpath{
2978 \pgf@circ@scaled@Rlen=\scaledRlen
2979 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
2980 \pgfscope
2981 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
2982 \ifx\pgf@temp\pgf@circ@temp
2983 \pgfstartlinewidth=\pgflinewidth
2984 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
2985
2986 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2987 \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
2988 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
2989 \pgfusepath{draw}
2990
2991 \pgfsetlinewidth{\pgfstartlinewidth}
2992 \else
2993 \pgfsetarrowsend{\pgf@circ@temp}
2994 \fi
2995 \pgfpathmoveto{\pgfpointorigin}
2996 \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
2997 \pgfusepath{draw}
2998 \endpgfscope
2999 }
3000 }
3001
3002 % Vee
3003 \pgfdeclareshape{vee}{
3004 \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
3005 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3006 \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
3007 \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
3008 \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
3009 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
3010 }
3011 \savedanchor{\northeast}{%
3012 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3013 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3014 \pgf@x=.5\pgf@circ@res@step
3015 \pgf@y=-3\pgf@x%
3016 }
3017 \anchor{south}{\northeast\pgf@x=0cm\relax}
3018 \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
3019 \anchor{north}{\pgfpointorigin}
3020 \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
3021 \anchor{south east}{\northeast}
3022 \anchor{south west}{\northeast\pgf@x=-\pgf@x}
3023 \anchor{north east}{\northeast\pgf@y=0pt\relax}
3024 \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3025 \anchor{center}{\pgfpointorigin}
3026 \anchor{left}{\pgfpointorigin}
3027 \anchor{right}{\pgfpointorigin}
3028 \anchor{text}{
3029 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3030 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3031 \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3032 \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
3033 \pgf@x=0pt
3034 \pgf@y=-2\pgf@circ@res@step
3035 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
3036 \pgf@x=-.5\wd\pgfnodeparttextbox
3037 }
3038
3039 \behindforegroundpath{
3040 \pgf@circ@scaled@Rlen=\scaledRlen
3041 \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
3042 \pgfscope
3043 \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
3044 \ifx\pgf@temp\pgf@circ@temp
3045
3046 \pgfstartlinewidth=\pgflinewidth
3047 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3048
3049 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3050 \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
3051 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
3052 \pgfusepath{draw}
3053 \pgfsetlinewidth{\pgfstartlinewidth}
3054 \else
3055 \pgfsetarrowsend{\pgf@circ@temp}
3056 \fi
3057 \pgfpathmoveto{\pgfpointorigin}
3058 \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
3059 \pgfusepath{draw}
3060 \endpgfscope
3061 }
3062 }
3063
3064 %%%%%%%%%%%%%%%%
3065 %% RF elements
3066 %%%%%%%%%%%%%%%%
3067
3068 % Legacy tlinestub
3069 % Contributed by Leonardo Azzinnari
3070 \pgfdeclareshape{tlinestub}{
3071 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3072 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3073 \savedanchor{\northeast}{%
3074 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3075 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3076 \pgf@x=1.2\pgf@circ@res@step
3077 \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3078 \pgf@y=.2\pgf@circ@res@step%
3079 }
3080 % the center is on the left side of the shape for facility of usage
3081 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
3082 \anchor{east}{\northeast\pgf@y=0cm\relax}
3083 \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
3084 \anchor{west}{\pgfpointorigin}
3085 \anchor{north east}{\northeast}
3086 \anchor{north west}{\northeast\pgf@x=0cm\relax}
3087 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
3088 \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
3089 \anchor{center}{\pgfpointorigin}
3090 \behindforegroundpath{
3091 \pgfstartlinewidth=\pgflinewidth
3092
3093 \pgf@circ@scaled@Rlen=\scaledRlen
3094 \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
3095 \pgf@circ@res@step=0.6\pgf@circ@scaled@Rlen
3096
3097 \pgfscope\begin{pgftransparencygroup}
3098 \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}}
3099 \pgf@circ@maybefill
3100 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
3101 \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
3102 \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
3103 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
3104 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3105 \pgf@circ@draworfill
3106 \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}}
3107 \pgfusepath{draw}
3108 \end{pgftransparencygroup} \endpgfscope
3109 \pgfpathmoveto{\pgfpointorigin}
3110 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
3111 \pgfusepath{draw}
3112 }
3113 }
3114
3115 %% New antennas without tails
3116
3117 % main body of antennas
3118 \def\pgf@circ@antennabody{%
3119 \pgfstartlinewidth=\pgflinewidth
3120 \pgf@circ@scaled@Rlen=\scaledRlen
3121 \pgfsetcolor{\ctikzvalof{color}}
3122 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3123 \pgfscope
3124 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3125 \pgfpathmoveto{\pgfpointorigin}
3126 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
3127 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
3128 \pgfsetbeveljoin
3129 \pgfpathclose
3130 \pgf@circ@draworfill
3131 \endpgfscope
3132 \pgfsetlinewidth{\pgfstartlinewidth}
3133 \pgfpathmoveto{\pgfpointorigin}
3134 \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
3135 \pgfusepath{draw}
3136 }
3137
3138 % Waves for the antennas.
3139 \def\pgf@circ@antennawaves{%
3140 \pgfscope
3141 % define a triangle for clipping the waves
3142 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
3143 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
3144 \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
3145 \pgfpathclose
3146 \pgfusepath{clip}
3147 % ...and build the waves as clipped circles
3148 \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step
3149 \pgfmathloop%
3150 \ifnum\pgf@circ@count@a>2
3151 \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other}
3152 \advance\pgf@circ@count@a-1\relax%
3153 \repeatpgfmathloop
3154 \pgfusepath{draw}
3155 \endpgfscope
3156 }
3157
3158 % additional shape with the waves
3159 \pgfdeclareshape{waves}{
3160 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3161 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3162 \anchor{center}{\pgfpointorigin}
3163 \savedanchor{\northeast}{
3164 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3165 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
3166 \pgf@x=\pgf@circ@res@step
3167 \pgf@y=\pgf@circ@res@step
3168 }
3169 \anchor{text}{
3170 \northeast
3171 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3172 }
3173 \anchor{top}{\northeast\pgf@x=0pt}
3174 \anchor{right}{\northeast\pgf@y=0pt}
3175 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
3176 \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
3177 \anchor{north}{\northeast\pgf@x=0pt}
3178 \anchor{north east}{\northeast}
3179 \anchor{east}{\northeast\pgf@y=0pt}
3180 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
3181 \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
3182 \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
3183 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
3184 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3185 \behindforegroundpath{
3186 \pgf@circ@scaled@Rlen=\scaledRlen
3187 \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
3188 \pgf@circ@res@step=0.5\pgf@circ@res@step
3189 \pgfsetcolor{\ctikzvalof{color}}
3190 \pgfscope
3191 % define a triangle for clipping the waves
3192 \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
3193 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
3194 \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
3195 \pgfpathclose
3196 \pgfusepath{clip}
3197 % ...and build the waves as clipped circles
3198 \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
3199 \pgfmathloop%
3200 \ifnum\c@pgf@counta>1
3201 \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
3202 \advance\c@pgf@counta-1\relax%
3203 \repeatpgfmathloop
3204 \pgfusepath{draw}
3205 \endpgfscope
3206 }
3207 }
3208
3209 % the three types of antennas: simple, TX, RX. Notice that you can flip them...
3210
3211 \pgfdeclareshape{bareantenna}{
3212 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3213 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3214 \anchor{center}{\pgfpointorigin}
3215 \savedanchor{\northeast}{
3216 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3217 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3218 \pgf@x=\pgf@circ@res@step
3219 \pgf@y=2\pgf@circ@res@step
3220 }
3221 \anchor{text}{
3222 \northeast
3223 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3224 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3225 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3226 }
3227 \anchor{top}{\northeast\pgf@x=0pt}
3228 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3229 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3230 \anchor{bottom}{\pgfpointorigin}
3231 \anchor{north}{\northeast\pgf@x=0pt}
3232 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3233 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3234 \anchor{south}{\pgfpointorigin}
3235 \anchor{north east}{\northeast}
3236 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3237 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3238 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3239 \behindforegroundpath{
3240 \pgf@circ@antennabody
3241 }
3242 }
3243
3244 \pgfdeclareshape{bareTXantenna}{
3245 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3246 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3247 \anchor{center}{\pgfpointorigin}
3248 \savedanchor{\northeast}{
3249 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3250 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3251 \pgf@x=\pgf@circ@res@step
3252 \pgf@y=2\pgf@circ@res@step
3253 }
3254 \savedanchor{\savedwaves}{
3255 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3256 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3257 \pgf@x=4.2\pgf@circ@res@step
3258 \pgf@y=\pgf@circ@res@step
3259 }
3260 \anchor{text}{
3261 \northeast
3262 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3263 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3264 \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
3265 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3266 }
3267 \anchor{waves}{\savedwaves}
3268 \anchor{top}{\northeast\pgf@x=0pt}
3269 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3270 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3271 \anchor{bottom}{\pgfpointorigin}
3272 \anchor{north}{\northeast\pgf@x=0pt}
3273 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3274 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3275 \anchor{south}{\pgfpointorigin}
3276 \anchor{north east}{\northeast}
3277 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3278 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3279 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3280 \behindforegroundpath{
3281 \pgf@circ@antennabody
3282 \pgf@circ@antennawaves
3283 }
3284 }
3285
3286 \pgfdeclareshape{bareRXantenna}{
3287 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3288 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3289 \anchor{center}{\pgfpointorigin}
3290 \savedanchor{\northeast}{
3291 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3292 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3293 \pgf@x=\pgf@circ@res@step
3294 \pgf@y=2\pgf@circ@res@step
3295 }
3296 \savedanchor{\savedwaves}{
3297 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3298 \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
3299 \pgf@x=-4.2\pgf@circ@res@step
3300 \pgf@y=\pgf@circ@res@step
3301 }
3302 \anchor{text}{
3303 \northeast
3304 \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
3305 \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
3306 \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3307 }
3308 \anchor{waves}{\savedwaves}
3309 \anchor{top}{\northeast\pgf@x=0pt}
3310 \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
3311 \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3312 \anchor{bottom}{\pgfpointorigin}
3313 \anchor{north}{\northeast\pgf@x=0pt}
3314 \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
3315 \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
3316 \anchor{south}{\pgfpointorigin}
3317 \anchor{north east}{\northeast}
3318 \anchor{north west}{\northeast\pgf@x=-\pgf@x}
3319 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3320 \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
3321 \behindforegroundpath{
3322 \pgf@circ@antennabody
3323 \pgftransformxshift{-5.2\pgf@circ@res@step}
3324 \pgf@circ@antennawaves
3325 }
3326 }
3327
3328 % Microstrip monopoles
3329
3330 \pgfdeclareshape{mslstub}{
3331 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3332 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3333 \savedanchor{\southeast}{
3334 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3335 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
3336 \pgf@x=.5\pgf@x
3337 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3338 \pgf@y=-.5\pgf@y
3339 }
3340 \savedanchor{\northwest}{
3341 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3342 \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
3343 \pgf@x=-.5\pgf@x
3344 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3345 \pgf@y=.5\pgf@y
3346 }
3347 \anchor{north}{\northwest\pgf@x=0pt\relax}
3348 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3349 \anchor{east}{\southeast\pgf@y=0pt\relax}
3350 \anchor{south east}{\southeast}
3351 \anchor{south}{\southeast\pgf@x=0pt\relax}
3352 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3353 \anchor{west}{\northwest\pgf@y=0pt\relax}
3354 \anchor{north west}{\northwest}
3355 %
3356 \anchor{center}{\northwest\pgf@y=0pt\relax}
3357 \anchor{left}{\northwest\pgf@y=0pt\relax}
3358 \anchor{right}{\southeast\pgf@y=0pt\relax}
3359 % put the node text above and centered
3360 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3361 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3362 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3363 }
3364 }
3365 \behindbackgroundpath{
3366 \pgfextracty{\pgf@circ@res@up}{\northwest}
3367 \pgfextractx{\pgf@circ@res@right}{\southeast}
3368 \pgfextractx{\pgf@circ@res@left}{\northwest}
3369 \pgfextracty{\pgf@circ@res@down}{\southeast}
3370 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3371 \pgfstartlinewidth=\pgflinewidth
3372 \pgfscope
3373 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3374 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3375 \pgf@circ@draworfill
3376 \endpgfscope
3377 }
3378 }
3379
3380 \pgfdeclareshape{msrstub}{
3381 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3382 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3383 \savedanchor{\southeast}{
3384 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3385 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
3386 \pgf@x=.5\pgf@x
3387 \pgf@y=0pt\relax
3388 }
3389 \savedanchor{\northwest}{
3390 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3391 \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
3392 \pgf@x=-.5\pgf@x
3393 \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@scaled@Rlen
3394 \pgf@y=.5\pgf@y
3395 }
3396 \anchor{north}{\northwest\pgf@x=0pt\relax}
3397 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3398 \anchor{east}{\southeast\pgf@y=0pt\relax}
3399 \anchor{south east}{\southeast}
3400 \anchor{south}{\southeast\pgf@x=0pt\relax}
3401 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3402 \anchor{west}{\northwest\pgf@y=0pt\relax}
3403 \anchor{north west}{\northwest}
3404 %
3405 \anchor{center}{\pgfpointorigin}
3406 \anchor{left}{\pgfpointorigin}
3407 \anchor{right}{\pgfpointorigin}
3408 % put the node text above and centered
3409 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3410 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3411 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
3412 }
3413 }
3414 \behindbackgroundpath{
3415 \pgfextracty{\pgf@circ@res@up}{\northwest}
3416 \pgfextractx{\pgf@circ@res@right}{\southeast}
3417 \pgfextractx{\pgf@circ@res@left}{\northwest}
3418 \pgfextracty{\pgf@circ@res@down}{\southeast}
3419 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
3420 \pgfstartlinewidth=\pgflinewidth
3421 \pgfscope
3422 \pgfpathmoveto{\pgfpointorigin}
3423 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
3424 \pgfusepath{draw}
3425 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3426 \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
3427 \pgfpatharc{135}{45}{\pgf@circ@res@step}
3428 \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
3429 \pgfpatharc{45}{135}{\pgf@circ@res@up}
3430 \pgfclosepath
3431 \pgf@circ@draworfill
3432 \endpgfscope
3433 }
3434 }
3435
3436 \pgfdeclareshape{msport}{
3437 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3438 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3439 \savedanchor{\southeast}{
3440 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3441 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
3442 \pgf@x=.5\pgf@x
3443 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3444 \pgf@y=-.5\pgf@y
3445 }
3446 \savedanchor{\northwest}{
3447 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3448 \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
3449 \pgf@x=-.5\pgf@x
3450 \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
3451 \pgf@y=.5\pgf@y
3452 }
3453 \anchor{north}{\northwest\pgf@x=0pt\relax}
3454 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
3455 \anchor{east}{\southeast\pgf@y=0pt\relax}
3456 \anchor{south east}{\southeast}
3457 \anchor{south}{\southeast\pgf@x=0pt\relax}
3458 \anchor{south west}{\southeast\pgf@x=-\pgf@x}
3459 \anchor{west}{\northwest\pgf@y=0pt\relax}
3460 \anchor{north west}{\northwest}
3461 %
3462 \anchor{center}{\northwest\pgf@y=0pt\relax}
3463 \anchor{left}{\northwest\pgf@y=0pt\relax}
3464 \anchor{right}{\southeast\pgf@y=0pt\relax}
3465 % put the node text above and centered
3466 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
3467 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
3468 \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
3469 }
3470 }
3471 \behindbackgroundpath{
3472 \pgfextracty{\pgf@circ@res@up}{\northwest}
3473 \pgfextractx{\pgf@circ@res@right}{\southeast}
3474 \pgfextractx{\pgf@circ@res@left}{\northwest}
3475 \pgfextracty{\pgf@circ@res@down}{\southeast}
3476 \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
3477 \pgfstartlinewidth=\pgflinewidth
3478 \pgfscope
3479 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3480 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
3481 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
3482 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
3483 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3484 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
3485 \pgfpathclose
3486 \pgf@circ@draworfill
3487 \endpgfscope
3488 }
3489 }
3490
3491 % Legacy antennas (with tails)
3492 \def\pgf@circ@shift@antenna@xy#1#2{%
3493 \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
3494 \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
3495 \relax}
3496
3497 % Legacy antenna
3498 \pgfdeclareshape{antenna}{
3499 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3500 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3501 \anchor{center}{\pgfpointorigin}
3502 \savedanchor{\northeast}{
3503 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3504 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3505 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3506 \pgf@y=4\pgf@circ@res@step
3507 }
3508 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
3509 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
3510 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
3511 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
3512 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
3513 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
3514 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
3515 \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}}
3516 \anchor{text}{
3517 \northeast
3518 \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
3519 \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
3520 }
3521 \behindforegroundpath{
3522 \pgfstartlinewidth=\pgflinewidth
3523 \pgf@circ@scaled@Rlen=\scaledRlen
3524 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3525
3526 \pgftransformxshift{ -4\pgf@circ@res@step }
3527
3528 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3529 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3530
3531 \pgfusepath{draw}
3532
3533 \pgfscope
3534 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3535 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3536 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3537 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3538 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3539 \pgfsetcolor{\ctikzvalof{color}}
3540 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3541 \pgfusepath{draw}
3542 \endpgfscope
3543 \pgfsetlinewidth{\pgfstartlinewidth}
3544
3545 }
3546 }
3547
3548 % Legacy TX antenna
3549 \pgfdeclareshape{txantenna}{
3550 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3551 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3552 \anchor{center}{\pgfpointorigin}
3553 \savedanchor{\northeast}{
3554 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3555 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3556 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3557 \pgf@y=4\pgf@circ@res@step
3558 }
3559 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
3560 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
3561 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
3562 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
3563 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
3564 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
3565 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
3566 \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}}
3567 \anchor{text}{
3568 \northeast
3569 \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
3570 \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
3571 }
3572 \behindforegroundpath{
3573 \pgfstartlinewidth=\pgflinewidth
3574 \pgf@circ@scaled@Rlen=\scaledRlen
3575 \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
3576
3577 \pgfpathmoveto{\pgfpointorigin}
3578 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
3579 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3580 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3581
3582 \pgfusepath{draw}
3583
3584 \pgfscope
3585 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3586 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3587 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3588 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3589 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3590 \pgfsetcolor{\ctikzvalof{color}}
3591 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3592 \pgfusepath{draw}
3593 \endpgfscope
3594 \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
3595 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
3596 \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
3597 \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
3598 \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
3599 \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
3600 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
3601 \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
3602 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
3603 \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
3604 \pgfusepath{draw}
3605 \pgfsetlinewidth{\pgfstartlinewidth}
3606
3607 }
3608 }
3609
3610 % Legacy RX antenna
3611 \pgfdeclareshape{rxantenna}{
3612 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3613 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3614 \anchor{center}{\pgfpointorigin}
3615 \savedanchor{\northeast}{
3616 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3617 \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
3618 \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
3619 \pgf@y=4\pgf@circ@res@step
3620 }
3621 \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
3622 \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
3623 \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
3624 \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
3625 \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
3626 \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
3627 \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
3628 \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}}
3629 \anchor{text}{
3630 \northeast
3631 \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
3632 \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
3633 }
3634 \behindforegroundpath{
3635 \pgfstartlinewidth=\pgflinewidth
3636 \pgf@circ@scaled@Rlen=\scaledRlen
3637 \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
3638
3639 \pgfpathmoveto{\pgfpointorigin}
3640 \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
3641 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{0pt}}
3642 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3643
3644 \pgfusepath{draw}
3645
3646 \pgfscope
3647 \pgfpathmoveto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3648 \pgfpathlineto{\pgfpoint{5\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3649 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{4\pgf@circ@res@step}}
3650 \pgfpathlineto{\pgfpoint{3\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3651 \pgfpathlineto{\pgfpoint{4\pgf@circ@[email protected]\pgflinewidth}{6\pgf@circ@res@step}}
3652 \pgfsetcolor{\ctikzvalof{color}}
3653 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3654 \pgfusepath{draw}
3655 \endpgfscope
3656
3657 \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
3658 % \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
3659 \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
3660 \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
3661 \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
3662 \pgfpatharc{150}{210}{3\pgf@circ@res@step}
3663 \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
3664 \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
3665 \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
3666 \pgfpatharc{150}{210}{2\pgf@circ@res@step}
3667 \pgfusepath{draw}
3668 \pgfsetlinewidth{\pgfstartlinewidth}
3669 }
3670 }
3671
3672 % Legacy match
3673 \pgfdeclareshape{match}{
3674 \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
3675 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3676 \savedanchor{\northeast}{%
3677 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3678 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
3679 \pgf@x=2\pgf@circ@res@step
3680 \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
3681 \pgf@y=.5\pgf@circ@res@step%
3682 }
3683 % the center is on the left side of the shape for facility of usage
3684 \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
3685 \anchor{east}{\northeast\pgf@y=0cm\relax}
3686 \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
3687 \anchor{west}{\pgfpointorigin}
3688 \anchor{north east}{\northeast}
3689 \anchor{north west}{\northeast\pgf@x=0cm\relax}
3690 \anchor{south east}{\northeast\pgf@y=0pt\relax}
3691 \anchor{south west}{\pgfpointorigin}
3692 \anchor{center}{
3693 \pgfpointorigin
3694 }
3695 \anchor{text}{
3696 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
3697 \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
3698 \pgf@x=1.5\pgf@x
3699 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
3700 \pgf@y=-1.5\ht\pgfnodeparttextbox
3701 }
3702 \behindforegroundpath{
3703 \pgf@circ@scaled@Rlen=\scaledRlen
3704 \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
3705
3706 \pgfscope
3707 \pgfpathmoveto{\pgfpointorigin}
3708 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
3709 \pgfusepath{draw}
3710
3711 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
3712 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
3713 \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
3714 \pgfusepath{fill}
3715
3716 \pgfsetlinewidth{\pgfstartlinewidth}
3717 \endpgfscope
3718 }
3719 }
3720
3721 %%%---------- close: tex/pgfcircmonopoles
3722 %%%%%%%%%%% Springe nach tex/pgfcircbipoles
3723 %%%---------- open: tex/pgfcircbipoles.tex
3724 % Copyright 2007-2009 by Massimo Redaelli
3725 %
3726 % This file may be distributed and/or modified
3727 %
3728 % 1. under the LaTeX Project Public License and/or
3729 % 2. under the GNU Public License.
3730 %
3731 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
3732
3733 %% Generic macro for defining a bipole shape
3734 % #1 - additional anchors
3735 % #2 - lower y-size of the bipole (from the center).
3736 % #3 - #shape is the name of the shape
3737 % #4 - upper y-size of the bipole (from the center)
3738 % #5 - width of the bipole
3739 % #6 - macros drawing the bipole
3740 %
3741 \long\def\pgfcircdeclarebipole{%
3742 \pgfcircdeclarebipolescaled{default}}
3743
3744 %% Generic macro for defining a bipole shape
3745 % #1 - scale factor
3746 % #2 - additional anchors
3747 % #3 - lower y-size of the bipole (from the center).
3748 % #4 - #shape is the name of the shape
3749 % #5 - upper y-size of the bipole (from the center)
3750 % #6 - width of the bipole
3751 % #7 - macros drawing the bipole
3752 %
3753 \long\def\pgfcircdeclarebipolescaled#1#2#3#4#5#6#7{
3754 \pgfdeclareshape{#4shape}{
3755 \savedmacro{\ctikzclass}{\edef\ctikzclass{#1}}
3756 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
3757 \savedanchor{\northeast}{
3758 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
3759 \pgf@y=#5\pgf@circ@scaled@Rlen
3760 \pgf@y=.5\pgf@y
3761 \pgf@x=#6\pgf@circ@scaled@Rlen
3762 \pgf@x=.5\pgf@x
3763 }
3764 \savedanchor{\northeastborder}{
3765 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
3766 \pgf@y=#5\pgf@circ@scaled@Rlen
3767 \pgf@y=.5\pgf@y
3768 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
3769 \pgf@x=#6\pgf@circ@scaled@Rlen
3770 \pgf@x=.5\pgf@x
3771 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
3772 }
3773 \savedanchor{\southwestborder}{
3774 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
3775 \pgf@y=-#3\pgf@circ@scaled@Rlen
3776 \pgf@y=.5\pgf@y
3777 \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
3778 \pgf@x=-#6\pgf@circ@scaled@Rlen
3779 \pgf@x=.5\pgf@x
3780 \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
3781 }
3782 \savedanchor{\southwest}{
3783 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
3784 \pgf@y=-#3\pgf@circ@scaled@Rlen
3785 \pgf@y=.5\pgf@y
3786 \pgf@x=-#6\pgf@circ@scaled@Rlen
3787 \pgf@x=.5\pgf@x
3788 }
3789 \savedanchor{\centerpoint}{
3790 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
3791 \pgf@circ@res@down=-#3\pgf@circ@scaled@Rlen
3792 \pgf@circ@res@up=#5\pgf@circ@scaled@Rlen
3793 \pgfpointorigin
3794 \pgf@y=\pgf@circ@res@up
3795 \advance\pgf@y by\pgf@circ@res@down
3796 \pgf@y=.5\pgf@y
3797 }
3798 \anchor{center}{\pgfpointorigin}
3799 \anchor{n}{
3800 \northeast
3801 \pgf@x=0cm
3802 }
3803 \anchor{north east}{
3804 \northeast
3805 }
3806 \anchor{north west}{
3807 \northeast
3808 \pgf@x=-\pgf@x
3809 }
3810 \anchor{ne}{
3811 \northeast
3812 }
3813 \anchor{nw}{
3814 \northeast
3815 \pgf@x=-\pgf@x
3816 }
3817 \anchor{e}{
3818 \northeast
3819 \pgf@y=0cm
3820 }
3821 \anchor{s}{
3822 \southwest
3823 \pgf@x=0cm
3824 }
3825 \anchor{south east}{
3826 \southwest
3827 \pgf@x=-\pgf@x
3828 }
3829 \anchor{south west}{
3830 \southwest
3831 }
3832 \anchor{se}{
3833 \southwest
3834 \pgf@x=-\pgf@x
3835 }
3836 \anchor{sw}{
3837 \southwest
3838 }
3839 \anchor{w}{
3840 \southwest
3841 \pgf@y=0cm
3842 }
3843 \anchor{north}{
3844 \northeast
3845 \pgf@x=0cm
3846 }
3847 \anchor{east}{
3848 \northeast
3849 \pgf@y=0cm
3850 }
3851 \anchor{south}{
3852 \southwest
3853 \pgf@x=0cm
3854 }
3855 \anchor{west}{
3856 \southwest
3857 \pgf@y=0cm
3858 }
3859 \anchor{right}{
3860 \northeast
3861 \pgf@y=0cm
3862 }
3863 \anchor{above}{
3864 \northeast
3865 \pgf@x=0cm
3866 }
3867 \anchor{left}{
3868 \southwest
3869 \pgf@y=0cm
3870 }
3871 \anchor{below}{
3872 \southwest
3873 \pgf@x=0cm
3874 }
3875 \anchor{a}{
3876 \northeast
3877 \pgf@y=0cm
3878 }
3879 \anchor{b}{
3880 \southwest
3881 \pgf@y=0cm
3882 }
3883 \savedanchor{\textanchor}{%
3884 \pgf@y=\ht\pgfnodeparttextbox
3885 \pgf@x=-.5\wd\pgfnodeparttextbox
3886 }
3887 \anchor{text}{
3888 \textanchor
3889 }
3890 \anchorborder{%
3891 \ifpgf@circuit@bipole@inverted
3892 \pgf@circ@res@left=-\pgf@x
3893 \pgf@circ@res@right=-\pgf@y
3894 \else
3895 \pgf@circ@res@left=\pgf@x
3896 \pgf@circ@res@right=\pgf@y
3897 \fi
3898 \ifdim\pgf@circ@res@right>0cm
3899 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
3900 \else
3901 \southwestborder
3902 \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
3903 \fi
3904 }
3905
3906 #2
3907
3908 \backgroundpath{
3909 \pgfsetcolor{\ctikzvalof{color}}
3910
3911 \northeast
3912 \pgf@circ@res@up = \pgf@y
3913 \pgf@circ@res@zero = 0cm
3914 \pgf@circ@res@left = -\pgf@x
3915 \pgf@circ@res@right = \pgf@x
3916 \southwest
3917 \pgf@circ@res@down = \pgf@y
3918 \pgf@circ@scaled@Rlen=\scaledRlen
3919 \pgfstartlinewidth=\pgflinewidth
3920 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
3921 #7
3922
3923 \pgfsetlinewidth{\pgfstartlinewidth}
3924 }
3925 }
3926 }
3927
3928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3929 %% Standard bipole shapes declarations
3930 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3931
3932 %%%%%%%%%%%%%%%%%%%%%%%%
3933 % Resistive components
3934 %%%%%%%%%%%%%%%%%%%%%%%%
3935
3936 %% Short circuit
3937
3938 %%% NOTICE that the short is really NOT drawn; we trust the fact that its
3939 %%% natural length is zero.
3940 \pgfcircdeclarebipole
3941 {}
3942 {0}
3943 {short}
3944 {0}
3945 {0}
3946 { }
3947
3948 %% Open circuit
3949 \pgfcircdeclarebipole
3950 {}
3951 {\ctikzvalof{bipoles/open/height}}
3952 {open}
3953 {\ctikzvalof{bipoles/open/height}}
3954 {\ctikzvalof{bipoles/open/width}}
3955 { }
3956
3957 %% Generic bipole - used as resistor by some (bleah)
3958 \pgfcircdeclarebipolescaled{resistors}
3959 {}
3960 {\ctikzvalof{bipoles/generic/height}}
3961 {generic}
3962 {\ctikzvalof{bipoles/generic/height}}
3963 {\ctikzvalof{bipoles/generic/width}}
3964 {
3965 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3966 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3967 \pgf@circ@draworfill
3968 }
3969
3970 %% Generic empty tunable
3971 \pgfcircdeclarebipolescaled{resistors}
3972 {}
3973 {\ctikzvalof{bipoles/tgeneric/height}}
3974 {tgeneric}
3975 {\ctikzvalof{bipoles/tgeneric/height}}
3976 {\ctikzvalof{bipoles/tgeneric/width}}
3977 {
3978 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
3979 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
3980 \pgf@circ@draworfill
3981 \pgfscope
3982 \pgfsetarrowsend{latexslim}
3983 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
3984 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
3985 \pgfusepath{draw}
3986 \endpgfscope
3987 }
3988
3989 %% Generic asymmetric bipole
3990 \pgfcircdeclarebipolescaled{resistors}
3991 {}
3992 {\ctikzvalof{bipoles/ageneric/height}}
3993 {ageneric}
3994 {\ctikzvalof{bipoles/ageneric/height}}
3995 {\ctikzvalof{bipoles/ageneric/width}}
3996 {
3997 \pgfscope
3998 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
3999 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4000 \pgf@circ@draworfill
4001 \endpgfscope
4002
4003 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4004 \pgfusepath{stroke,fill}
4005 }
4006
4007 %% Memristor
4008 \pgfcircdeclarebipolescaled{resistors}
4009 {}
4010 {\ctikzvalof{bipoles/memristor/height}}
4011 {memristor}
4012 {\ctikzvalof{bipoles/memristor/height}}
4013 {\ctikzvalof{bipoles/memristor/width}}
4014 {
4015 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
4016 \divide \pgf@circ@res@step by 14
4017
4018 \pgfscope
4019 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4020 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4021 \pgf@circ@draworfill
4022 \endpgfscope
4023 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4024 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
4025 \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4026 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4027 \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4028 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4029 \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4030 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
4031 \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
4032 \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
4033
4034 \pgfusepath{draw}
4035
4036 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4037 \pgfusepath{stroke,fill}
4038 }
4039
4040 %% Photoresistor
4041 \pgfcircdeclarebipolescaled{resistors}
4042 {}
4043 {\ctikzvalof{bipoles/photoresistor/height 2}}
4044 {photoresistor}
4045 {\ctikzvalof{bipoles/photoresistor/height}}
4046 {\ctikzvalof{bipoles/photoresistor/width}}
4047 {
4048 \pgfscope
4049 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
4050 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4051 \pgf@circ@draworfill
4052 \endpgfscope
4053
4054 \pgfscope
4055 \pgfsetarrowsend{latexslim}
4056 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
4057 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
4058 \pgfusepath{draw}
4059 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
4060 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
4061 \pgfusepath{draw}
4062 \endpgfscope
4063 }
4064
4065 %% Thermistor
4066 \pgfcircdeclarebipolescaled{resistors}
4067 {{% anchor for labelling the type of dependency
4068 \anchor{label}{%
4069 \southwest
4070 \pgf@x=0.4\pgf@x
4071 \pgf@y=1.2\pgf@y
4072 }%
4073 }}
4074 {\ctikzvalof{bipoles/thermistor/height}}
4075 {thermistor}
4076 {\ctikzvalof{bipoles/thermistor/height}}
4077 {\ctikzvalof{bipoles/thermistor/width}}
4078 {
4079 \pgfscope
4080 \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}}
4081 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4082 \pgf@circ@draworfill
4083 \endpgfscope
4084
4085 %\pgfscope
4086 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
4087 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
4088 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
4089 \pgfusepath{draw}
4090 %\endpgfscope
4091 }
4092
4093 %% Thermistor PTC
4094 \pgfcircdeclarebipolescaled{resistors}
4095 {}
4096 {\ctikzvalof{bipoles/thermistorptc/height 2}}
4097 {thermistorptc}
4098 {\ctikzvalof{bipoles/thermistorptc/height}}
4099 {\ctikzvalof{bipoles/thermistorptc/width}}
4100 {
4101 \pgfscope
4102 \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}}
4103 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4104 \pgf@circ@draworfill
4105 \endpgfscope
4106 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
4107 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
4108 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
4109 \pgfusepath{draw}
4110
4111 \pgfsetlinewidth{\pgfstartlinewidth}
4112 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
4113 \pgfsetarrowsend{latexslim}
4114 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
4115 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4116 \pgfusepath{draw}
4117 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
4118 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4119 \pgfusepath{draw}
4120 }
4121
4122 %% Thermistor NTC
4123 \pgfcircdeclarebipolescaled{resistors}
4124 {}
4125 {\ctikzvalof{bipoles/thermistorntc/height 2}}
4126 {thermistorntc}
4127 {\ctikzvalof{bipoles/thermistorntc/height}}
4128 {\ctikzvalof{bipoles/thermistorntc/width}}
4129 {
4130 \pgfscope
4131 \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}}
4132 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4133 \pgf@circ@draworfill
4134 \endpgfscope
4135
4136 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
4137 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
4138 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
4139 \pgfusepath{draw}
4140
4141 \pgfsetlinewidth{\pgfstartlinewidth}
4142 \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
4143 \pgfsetarrowsend{latexslim}
4144 \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
4145 \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4146 \pgfusepath{draw}
4147 \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
4148 \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
4149 \pgfusepath{draw}
4150 }
4151
4152 %% Generic tunable
4153 \pgfcircdeclarebipolescaled{resistors}
4154 {
4155 \savedanchor{\wiper}{
4156 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4157 \pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen
4158 \pgf@y=.5\pgf@ya
4159 \pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen
4160 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa}
4161 }
4162 \anchor{wiper}{\wiper}
4163 \anchor{W}{\wiper}
4164 }
4165 {\ctikzvalof{bipoles/generic potentiometer/height 2}}
4166 {genericpotentiometer}
4167 {\ctikzvalof{bipoles/generic potentiometer/height}}
4168 {\ctikzvalof{bipoles/generic potentiometer/width}}
4169 {
4170
4171 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen
4172 \divide \pgf@circ@res@step by 14
4173
4174 \pgfscope
4175 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4176 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4177 \pgf@circ@draworfill
4178 \endpgfscope
4179 \pgfscope
4180 %\pgfsetlinewidth{\pgfstartlinewidth}
4181 \pgfsetarrowsend{latexslim}
4182 \pgfextractx{\pgf@circ@res@other}{\wiper}
4183 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
4184 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
4185 \pgfusepath{draw}
4186 \endpgfscope
4187 }
4188
4189 %% Zig zag resistores
4190 \def\pgf@circ@zigzag#1{%
4191 \divide \pgf@circ@res@step by \numexpr4*\zigs\relax
4192
4193 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
4194 \pgf@circ@res@other = \pgf@circ@res@left
4195 \pgf@circ@count@a=\zigs\relax
4196 % first half zig
4197 \advance\pgf@circ@res@other by \pgf@circ@res@step
4198 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
4199 \pgfmathloop%
4200 \advance\pgf@circ@count@a by -1\relax% Loop zigs -1 times
4201 \ifnum\pgf@circ@count@a>0
4202 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4203 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
4204 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4205 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}}
4206 \repeatpgfmathloop%
4207 % last zig and a half
4208 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
4209 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
4210 \advance\pgf@circ@res@other by \pgf@circ@res@step
4211 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
4212 \pgfsetbeveljoin
4213 \pgfusepath{draw}
4214 }
4215
4216 %% Resistor
4217 \pgfcircdeclarebipolescaled{resistors}
4218 {
4219 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4220 }
4221 {\ctikzvalof{bipoles/resistor/height}}
4222 {resistor}
4223 {\ctikzvalof{bipoles/resistor/height}}
4224 {\ctikzvalof{bipoles/resistor/width}}
4225 {
4226 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4227 \pgftransformationadjustments
4228 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4229 \pgf@circ@zigzag{1}
4230 }
4231
4232
4233 %% Variable resistor
4234 \pgfcircdeclarebipolescaled{resistors}
4235 {
4236 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4237 }
4238 {\ctikzvalof{bipoles/vresistor/height}}
4239 {vresistor}
4240 {\ctikzvalof{bipoles/vresistor/height}}
4241 {\ctikzvalof{bipoles/vresistor/width}}
4242 {
4243 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4244 \pgftransformationadjustments
4245 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4246 \pgf@circ@zigzag{.5}
4247
4248 \pgfscope
4249 \pgfsetarrowsend{latexslim}
4250 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
4251 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
4252 \pgfusepath{draw}
4253 \endpgfscope
4254 }
4255
4256 %% Potentiometer
4257 \pgfcircdeclarebipolescaled{resistors}
4258 {
4259 \savedanchor{\wiper}{
4260 \pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen
4261 \pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen
4262 \pgf@y=.5\pgf@ya
4263 \pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen
4264 \pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa}
4265 }
4266 \anchor{wiper}{\wiper}
4267 \anchor{W}{\wiper}
4268 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4269 }
4270 {\ctikzvalof{bipoles/potentiometer/height 2}}
4271 {potentiometer}
4272 {\ctikzvalof{bipoles/potentiometer/height}}
4273 {\ctikzvalof{bipoles/potentiometer/width}}
4274 {
4275 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4276 \pgftransformationadjustments
4277 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4278 \pgf@circ@zigzag{1}
4279
4280 \pgfscope
4281 %\pgfsetlinewidth{\pgfstartlinewidth}
4282 \pgfsetarrowsend{latexslim}
4283 \pgfextractx{\pgf@circ@res@other}{\wiper}
4284 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
4285 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
4286 \pgfusepath{draw}
4287 \endpgfscope
4288 }
4289
4290 %% Resistive sensor
4291 \pgfcircdeclarebipolescaled{resistors}
4292 {% anchor for labelling the type of dependency
4293 \anchor{label}{\southwest\pgf@x=0.4\pgf@x}%
4294 \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
4295 }
4296 {\ctikzvalof{bipoles/resistivesens/height}}
4297 {resistivesens}
4298 {\ctikzvalof{bipoles/resistivesens/height}}
4299 {\ctikzvalof{bipoles/resistivesens/width}}
4300 {%
4301 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4302 \pgftransformationadjustments
4303 \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
4304 \pgf@circ@zigzag{.5}
4305
4306 \pgfscope
4307 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
4308 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
4309 \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
4310 \pgfusepath{draw}
4311 \endpgfscope
4312 }
4313
4314 %%%%%%%%%%%%%%
4315 %% Capacitors
4316 %%%%%%%%%%%%%
4317
4318 %% Plain Capacitor
4319 \pgfcircdeclarebipolescaled{capacitors}
4320 {}
4321 {\ctikzvalof{bipoles/capacitor/height}}
4322 {capacitor}
4323 {\ctikzvalof{bipoles/capacitor/height}}
4324 {\ctikzvalof{bipoles/capacitor/width}}
4325 {
4326 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4327 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4328 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4329
4330 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4331 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4332 \pgfusepath{draw}
4333
4334 }
4335
4336 %% Capacitive sensor
4337 \pgfcircdeclarebipolescaled{capacitors}
4338 {
4339 \anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}%
4340 }
4341 {\ctikzvalof{bipoles/capacitor/height}}
4342 {capacitivesens}
4343 {\ctikzvalof{bipoles/capacitor/height}}
4344 {\ctikzvalof{bipoles/capacitor/width}}
4345 {
4346 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4347 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4348 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4349
4350 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4351 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4352 \pgfusepath{draw}
4353 \pgfscope
4354 \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
4355 \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
4356 \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.2\pgf@circ@res@down}}
4357 \pgfusepath{draw}
4358 \endpgfscope
4359 }
4360
4361 %% Polar Capacitor (DEPRECATED)
4362 \pgfcircdeclarebipolescaled{capacitors}
4363 {}
4364 {\ctikzvalof{bipoles/pcapacitor/height}}
4365 {polarcapacitor}
4366 {\ctikzvalof{bipoles/pcapacitor/height}}
4367 {\ctikzvalof{bipoles/pcapacitor/width}}
4368 {
4369 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4370
4371 \pgfscope
4372 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
4373 \pgftransformrotate{-90}
4374 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
4375 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
4376 \pgfusepath{draw}
4377 \endpgfscope
4378
4379 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4380 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4381 \pgfusepath{draw}
4382 }
4383
4384
4385 %% Curved capacitor
4386 % see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong
4387 % for a rationale
4388 %
4389 \pgfcircdeclarebipolescaled{capacitors}
4390 {}
4391 {\ctikzvalof{bipoles/ccapacitor/height}}
4392 {ccapacitor}
4393 {\ctikzvalof{bipoles/ccapacitor/height}}
4394 {\ctikzvalof{bipoles/ccapacitor/width}}
4395 {
4396 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4397
4398 \pgfscope
4399 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}{\pgf@circ@res@up}}
4400 \pgftransformrotate{-90}
4401 \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
4402 \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}}
4403 \pgfusepath{draw}
4404 \endpgfscope
4405
4406 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4407 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4408 \pgfusepath{draw}
4409 }
4410
4411
4412
4413
4414 %% Electrolytic Capacitor
4415 \pgfcircdeclarebipolescaled{capacitors}
4416 {}
4417 {\ctikzvalof{bipoles/ecapacitor/height}}
4418 {ecapacitor}
4419 {\ctikzvalof{bipoles/ecapacitor/height}}
4420 {\ctikzvalof{bipoles/ecapacitor/width}}
4421 {
4422 \pgfsetrectcap
4423 % % % Draw plus pole
4424 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4425 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4426 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
4427 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
4428 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4429 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4430 \pgf@circ@draworfill
4431 % % Draw minus pole
4432 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4433 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4434 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
4435 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4436 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4437 \pgfsetfillcolor{\ctikzvalof{color}}
4438 \pgfusepath{draw,fill}
4439 \pgfsetfillcolor{\ctikzvalof{color}}
4440 % % plus pole annotation
4441 \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
4442 {\ctikzvalof{bipoles/ecapacitor/font} $+$}
4443 }
4444
4445 %% Variable Capacitor
4446 \pgfcircdeclarebipolescaled{capacitors}
4447 {}
4448 {\ctikzvalof{bipoles/vcapacitor/height}}
4449 {vcapacitor}
4450 {\ctikzvalof{bipoles/vcapacitor/height}}
4451 {\ctikzvalof{bipoles/vcapacitor/width}}
4452 {
4453 \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
4454
4455 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4456 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
4457 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
4458
4459 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4460 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
4461 \pgfusepath{draw}
4462
4463 \pgfscope
4464 \pgfsetarrowsend{latexslim}
4465 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4466 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4467 \pgfusepath{draw}
4468 \endpgfscope
4469
4470 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
4471 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
4472 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
4473 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
4474 \pgfsetlinewidth{\pgfstartlinewidth}
4475 \pgfusepath{draw}
4476 }
4477
4478
4479 %% Piezoelectric Element
4480
4481 \pgfcircdeclarebipolescaled{capacitors}
4482 {}
4483 {\ctikzvalof{bipoles/piezoelectric/height}}
4484 {piezoelectric}
4485 {\ctikzvalof{bipoles/piezoelectric/height}}
4486 {\ctikzvalof{bipoles/piezoelectric/width}}
4487 {
4488 % \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
4489 % \divide \pgf@circ@res@step by 5
4490
4491 %% Outer markings
4492 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4493 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4494 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4495
4496 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4497 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4498 \pgfusepath{draw}
4499
4500 %% Inner Box
4501 \pgf@circ@res@step = \pgf@circ@res@right \divide \pgf@circ@res@step by 10
4502 \pgfscope
4503 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4504 \pgfpathrectanglecorners
4505 {\pgfpoint{\pgf@circ@res@left+4*\pgf@circ@res@step}{\pgf@circ@res@up-\pgf@circ@res@step}}
4506 {\pgfpoint{\pgf@circ@res@right-4*\pgf@circ@res@step}{\pgf@circ@res@down+\pgf@circ@res@step}}
4507 \pgf@circ@draworfill
4508 \endpgfscope
4509 }
4510
4511 %%%%%%%%%%%%%%%
4512 %% Inductors
4513 %%%%%%%%%%%%%%%
4514
4515 %% cute inductor
4516 \pgfcircdeclarebipolescaled{inductors}
4517 {
4518 \savedanchor{\midtap}{%
4519 \pgf@x=0pt\relax
4520 \pgfmathsetlength{\pgf@y}{%
4521 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4522 \ctikzvalof{bipoles/cuteinductor/height} :% even
4523 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4524 *\pgf@circ@scaled@Rlen/2
4525 }
4526 }
4527 \anchor{midtap}{\midtap}
4528 }
4529 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
4530 {cuteinductor}
4531 {\ctikzvalof{bipoles/cuteinductor/height}}
4532 {\ctikzvalof{bipoles/cuteinductor/width}}
4533 {
4534 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4535 \pgftransformationadjustments
4536
4537 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4538 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
4539
4540
4541 \pgfmathsetlength{\pgf@circ@res@step}
4542 {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
4543
4544 \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
4545 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
4546 {
4547 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4548 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4549 }
4550 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4551 \pgfsetbuttcap
4552 \pgfsetbeveljoin
4553 \pgfusepath{stroke}
4554 }
4555
4556 %% cute inductive sensor
4557 \pgfcircdeclarebipolescaled{inductors}
4558 {% anchor for labelling the type of dependency
4559 \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
4560 \savedanchor{\midtap}{%
4561 \pgf@x=0pt\relax
4562 \pgfmathsetlength{\pgf@y}{%
4563 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4564 \ctikzvalof{bipoles/cuteinductor/height} :% even
4565 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4566 *\pgf@circ@scaled@Rlen/2
4567 }
4568 }
4569 \anchor{midtap}{\midtap}
4570 }
4571 {\ctikzvalof{bipoles/cuteinductor/lower coil height}}
4572 {scuteinductor}
4573 {\ctikzvalof{bipoles/cuteinductor/height}}
4574 {\ctikzvalof{bipoles/cuteinductor/width}}
4575 {
4576 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4577 \pgftransformationadjustments
4578
4579 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4580 {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
4581
4582
4583 \pgfmathsetlength{\pgf@circ@res@step}
4584 {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
4585
4586 \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
4587 \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
4588 {
4589 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4590 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4591 }
4592 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4593 \pgfsetbuttcap
4594 \pgfsetbeveljoin
4595 \pgfusepath{stroke}
4596 \pgfscope
4597 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
4598 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4599 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4600 \pgfusepath{draw}
4601 \endpgfscope
4602 }
4603
4604 %% cute choke
4605 \pgfcircdeclarebipolescaled{inductors}
4606 {
4607 \savedanchor{\midtap}{%
4608 \pgf@x=0pt\relax
4609 \pgfmathsetlength{\pgf@y}{%
4610 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4611 \ctikzvalof{bipoles/cuteinductor/height} :% even
4612 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4613 *\pgf@circ@scaled@Rlen/2
4614 }
4615 }
4616 \anchor{midtap}{\midtap}
4617 }
4618 {\ctikzvalof{bipoles/cutechoke/lower coil height}}
4619 {cutechoke}
4620 {\ctikzvalof{bipoles/cutechoke/height}}
4621 {\ctikzvalof{bipoles/cutechoke/width}}
4622 {
4623 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4624 \pgftransformationadjustments
4625
4626 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4627 {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
4628
4629
4630 \pgfmathsetlength{\pgf@circ@res@step}
4631 {(\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
4632
4633 \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
4634 \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
4635 {
4636 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4637 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
4638 }
4639 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
4640 \pgfsetbuttcap
4641 \pgfsetbeveljoin
4642 \pgfusepath{stroke}
4643
4644 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
4645 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
4646 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4647 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
4648 \pgfusepath{stroke}
4649
4650 \ifpgf@circuit@bipole@twolineschoke
4651 \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}}
4652 \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}}
4653 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4654 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
4655 \pgfusepath{stroke}
4656 \fi
4657 }
4658
4659 %% variable cute inductor
4660 \pgfcircdeclarebipolescaled{inductors}
4661 {
4662 \savedanchor{\midtap}{%
4663 \pgf@x=0pt\relax
4664 \pgfmathsetlength{\pgf@y}{%
4665 (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
4666 \ctikzvalof{bipoles/cuteinductor/height} :% even
4667 -\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
4668 *\pgf@circ@scaled@Rlen/2
4669 }
4670 }
4671 \anchor{midtap}{\midtap}
4672 }
4673 {\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
4674 {vcuteinductor}
4675 {\ctikzvalof{bipoles/vcuteinductor/height}}
4676 {\ctikzvalof{bipoles/vcuteinductor/width}}
4677 {
4678 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4679 \pgftransformationadjustments
4680
4681 \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
4682 {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
4683
4684
4685 \pgfmathsetlength{\pgf@circ@res@step}
4686 {(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
4687
4688 \pgfscope
4689 \pgfsetarrowsend{latexslim}
4690 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
4691 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
4692 \pgfusepath{draw}
4693 \endpgfscope
4694
4695 \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
4696 \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
4697 {
4698 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
4699 \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
4700 }
4701 \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
4702 \pgfsetbuttcap
4703 \pgfsetbeveljoin
4704 \pgfusepath{stroke}
4705 }
4706
4707 %% american inductor
4708 \pgfcircdeclarebipolescaled{inductors}
4709 {
4710 \savedanchor{\midtap}{%
4711 \pgf@x=0pt\relax
4712 \pgfmathsetlength{\pgf@y}{%
4713 (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
4714 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
4715 0) %odd
4716 *\pgf@circ@scaled@Rlen/2
4717 }
4718 }
4719 \anchor{midtap}{\midtap}
4720 }
4721 {\ctikzvalof{bipoles/americaninductor/height 2}}
4722 {americaninductor}
4723 {\ctikzvalof{bipoles/americaninductor/height}}
4724 {\ctikzvalof{bipoles/americaninductor/width}}
4725 {
4726 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
4727 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4728 \pgftransformationadjustments
4729 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
4730 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
4731 \divide \pgf@circ@res@step by 2
4732 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
4733
4734 \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
4735 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
4736 {
4737 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
4738 }
4739 \pgfsetbuttcap
4740 \pgfsetbeveljoin
4741 \pgfusepath{stroke}
4742 }
4743
4744
4745 %% american inductive sensor
4746 \pgfcircdeclarebipolescaled{inductors}
4747 {% anchor for labelling the type of dependency
4748 \anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}%
4749 \savedanchor{\midtap}{%
4750 \pgf@x=0pt\relax
4751 \pgfmathsetlength{\pgf@y}{%
4752 (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
4753 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
4754 0) %odd
4755 *\pgf@circ@scaled@Rlen/2
4756 }
4757 }
4758 \anchor{midtap}{\midtap}
4759 }
4760 {\ctikzvalof{bipoles/americaninductor/height 2}}
4761 {samericaninductor}
4762 {\ctikzvalof{bipoles/americaninductor/height}}
4763 {\ctikzvalof{bipoles/americaninductor/width}}
4764 {
4765 \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen
4766 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4767 \pgftransformationadjustments
4768 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
4769 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
4770 \divide \pgf@circ@res@step by 2
4771 \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen
4772
4773 \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
4774 \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
4775 {
4776 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
4777 }
4778 \pgfsetbuttcap
4779 \pgfsetbeveljoin
4780 \pgfusepath{stroke}
4781 \pgfscope
4782 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
4783 \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4784 \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
4785 \pgfusepath{draw}
4786 \endpgfscope
4787 }
4788
4789 %% variable american inductor
4790 \pgfcircdeclarebipolescaled{inductors}
4791 {
4792 \savedanchor{\midtap}{%
4793 \pgf@x=0pt\relax
4794 \pgfmathsetlength{\pgf@y}{%
4795 (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?%
4796 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even
4797 0) %odd
4798 *\pgf@circ@scaled@Rlen/2
4799 }
4800 }
4801 \anchor{midtap}{\midtap}
4802 }
4803 {\ctikzvalof{bipoles/vamericaninductor/height 2}}
4804 {vamericaninductor}
4805 {\ctikzvalof{bipoles/vamericaninductor/height}}
4806 {\ctikzvalof{bipoles/vamericaninductor/width}}
4807 {
4808 \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@scaled@Rlen
4809 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4810 \pgftransformationadjustments
4811 \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
4812 \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
4813 \divide \pgf@circ@res@step by 2
4814 \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@scaled@Rlen
4815
4816 \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
4817 \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
4818 {
4819 \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
4820 }
4821 \pgfsetbuttcap
4822 \pgfsetbeveljoin
4823 \pgfusepath{stroke}
4824
4825 \pgfscope
4826 \pgfsetarrowsend{latexslim}
4827 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
4828 \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
4829 \pgfusepath{draw}
4830 \endpgfscope
4831 }
4832
4833 %% Generic bipole, filled - used as inductor by some
4834 \pgfcircdeclarebipolescaled{inductors}
4835 {
4836 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
4837 }
4838 {\ctikzvalof{bipoles/fullgeneric/height}}
4839 {fullgeneric}
4840 {\ctikzvalof{bipoles/fullgeneric/height}}
4841 {\ctikzvalof{bipoles/fullgeneric/width}}
4842 {
4843 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4844 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4845
4846 \pgfusepath{draw,fill}
4847 }
4848
4849 %% Generic sensor, filled - used as inductive sensor by some
4850 \pgfcircdeclarebipolescaled{inductors}
4851 {% anchor for labelling the type of dependency
4852 \anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}%
4853 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
4854 }
4855 {\ctikzvalof{bipoles/fullgeneric/height}}
4856 {sfullgeneric}
4857 {\ctikzvalof{bipoles/fullgeneric/height}}
4858 {\ctikzvalof{bipoles/fullgeneric/width}}
4859 {
4860
4861 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4862 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4863 \pgfusepath{draw,fill}
4864 %\pgfscope
4865 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
4866 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
4867 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
4868 \pgfusepath{draw}
4869 %\endpgfscope
4870 }
4871
4872 %% Generic full tunable
4873 \pgfcircdeclarebipolescaled{inductors}
4874 {
4875 \anchor{midtap}{\northeast\pgf@x=0pt\relax}
4876 }
4877 {\ctikzvalof{bipoles/tfullgeneric/height}}
4878 {tfullgeneric}
4879 {\ctikzvalof{bipoles/tfullgeneric/height}}
4880 {\ctikzvalof{bipoles/tfullgeneric/width}}
4881 {
4882 \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
4883 \divide \pgf@circ@res@step by 14
4884
4885 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
4886 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4887 \pgfusepath{draw,fill}
4888
4889 \pgfscope
4890 \pgfsetarrowsend{latexslim}
4891 \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
4892 \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
4893 \pgfusepath{draw}
4894 \endpgfscope
4895 }
4896
4897 %%%%%%%%%%%
4898 %% Battery
4899 %%%%%%%%%%%
4900
4901 %% Battery
4902 \pgfcircdeclarebipolescaled{batteries}
4903 {}
4904 {\ctikzvalof{bipoles/battery/height}}
4905 {battery}
4906 {\ctikzvalof{bipoles/battery/height}}
4907 {\ctikzvalof{bipoles/battery/width}}
4908 {
4909 \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen
4910 \divide \pgf@circ@res@step by 6
4911
4912 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4913
4914 \ifpgf@circ@fixbatteries
4915 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
4916 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
4917
4918 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
4919 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
4920
4921 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
4922 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
4923
4924 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
4925 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
4926 \else
4927 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
4928 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
4929
4930 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
4931 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
4932
4933 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
4934 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
4935
4936 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
4937 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
4938 \fi
4939 \pgfusepath{draw}
4940 }
4941
4942
4943 %% Battery 1 % poles with equl thickness
4944
4945 \pgfcircdeclarebipolescaled{batteries}
4946 {}
4947 {\ctikzvalof{bipoles/battery1/height}}
4948 {battery1}
4949 {\ctikzvalof{bipoles/battery1/height}}
4950 {\ctikzvalof{bipoles/battery1/width}}
4951 {
4952 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
4953 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
4954 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
4955 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
4956 \pgfusepath{draw}
4957
4958 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4959 \ifpgf@circ@fixbatteries
4960 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
4961 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
4962
4963 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
4964 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
4965 \else
4966 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
4967 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
4968
4969 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
4970 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
4971 \fi
4972 \pgfusepath{draw}
4973 }
4974
4975 %% Battery 2 % negative pole thicker
4976
4977 \pgfcircdeclarebipolescaled{batteries}
4978 {}
4979 {\ctikzvalof{bipoles/battery2/height}}
4980 {battery2}
4981 {\ctikzvalof{bipoles/battery2/height}}
4982 {\ctikzvalof{bipoles/battery2/width}}
4983 {
4984 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
4985 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
4986 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
4987 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
4988 \pgfusepath{draw}
4989
4990 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
4991 \ifpgf@circ@fixbatteries
4992 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
4993 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
4994 \pgfusepath{draw}
4995 \pgfsetlinewidth{3\pgflinewidth}
4996 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
4997 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
4998 \else
4999 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
5000 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
5001 \pgfusepath{draw}
5002 \pgfsetlinewidth{3\pgflinewidth}
5003 \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
5004 \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
5005 \fi
5006 \pgfusepath{draw}
5007 }
5008
5009 %%%%%%%%%%%
5010 %% Round and diamond sources
5011 %%%%%%%%%%%
5012
5013 %% Independent voltage source
5014 \pgfcircdeclarebipolescaled{sources}
5015 {}
5016 {\ctikzvalof{bipoles/vsource/height}}
5017 {vsource}
5018 {\ctikzvalof{bipoles/vsource/height}}
5019 {\ctikzvalof{bipoles/vsource/width}}
5020 {
5021
5022 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5023
5024 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5025 \pgf@circ@draworfill
5026 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5027 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5028 \pgfusepath{draw}
5029 }
5030
5031 %% Independent voltage source - American style
5032 \pgfcircdeclarebipolescaled{sources}
5033 {}
5034 {\ctikzvalof{bipoles/vsourceam/height}}
5035 {vsourceAM}
5036 {\ctikzvalof{bipoles/vsourceam/height}}
5037 {\ctikzvalof{bipoles/vsourceam/width}}
5038 {
5039
5040 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5041 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5042 \pgf@circ@draworfill
5043 \pgfsetcolor{\ctikzvalof{color}}
5044 \ifpgf@circ@oldvoltagedirection
5045 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
5046 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
5047 \else
5048 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
5049 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
5050 \fi
5051 }
5052
5053 %% Independent sinusoidal voltage source
5054 \pgfcircdeclarebipolescaled{sources}
5055 {}
5056 {\ctikzvalof{bipoles/vsourcesin/height}}
5057 {vsourcesin}
5058 {\ctikzvalof{bipoles/vsourcesin/height}}
5059 {\ctikzvalof{bipoles/vsourcesin/width}}
5060 {
5061
5062 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5063 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5064 \pgf@circ@draworfill
5065
5066 \pgf@circ@res@up = .5\pgf@circ@res@up
5067 \pgfscope
5068 \pgftransformrotate{90}
5069 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5070 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5071 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5072 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5073 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5074 \pgfusepath{draw}
5075 \endpgfscope
5076 }
5077
5078 % Square Voltage source - contributed by Alistair Kwan
5079 \pgfcircdeclarebipolescaled{sources}
5080 {}
5081 {\ctikzvalof{bipoles/vsourcesquare/height}}
5082 {vsourcesquare}
5083 {\ctikzvalof{bipoles/vsourcesquare/height}}
5084 {\ctikzvalof{bipoles/vsourcesquare/width}}
5085 {
5086 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5087 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5088 \pgf@circ@draworfill
5089 \pgf@circ@res@up = .5\pgf@circ@res@up
5090 \pgfscope
5091 \pgftransformrotate{90}
5092 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
5093 \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
5094 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
5095 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
5096 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
5097 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
5098 \pgfusepath{draw}
5099 \endpgfscope
5100 }
5101
5102 % Triangle Voltage source - contributed by Ralf Farkas
5103 \pgfcircdeclarebipolescaled{sources}
5104 {}
5105 {\ctikzvalof{bipoles/vsourcetri/height}}
5106 {vsourcetri}
5107 {\ctikzvalof{bipoles/vsourcetri/height}}
5108 {\ctikzvalof{bipoles/vsourcetri/width}}
5109 {
5110
5111 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5112 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5113 \pgf@circ@draworfill
5114
5115 \pgf@circ@res@up = .5\pgf@circ@res@up
5116 \pgfscope
5117 \pgftransformrotate{90}
5118 \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
5119 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
5120 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
5121 \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
5122 \pgfusepath{draw}
5123 \endpgfscope
5124 }
5125
5126
5127 %% PV Source
5128 \pgfcircdeclarebipolescaled{sources}
5129 {}
5130 {\ctikzvalof{bipoles/pvsource/height}}
5131 {pvsource}
5132 {\ctikzvalof{bipoles/pvsource/height}}
5133 {\ctikzvalof{bipoles/pvsource/width}}
5134 {
5135 \pgfpointorigin
5136 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5137 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5138 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5139 \pgf@circ@draworfill
5140
5141 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
5142 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
5143 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
5144 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
5145 \pgfusepath{draw}
5146
5147 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5148 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
5149 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
5150
5151 \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
5152 \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
5153 \pgfusepath{draw}
5154
5155 %Arrow Part
5156 \pgfscope
5157 \pgfsetarrowsend{latex}
5158 \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
5159 \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
5160 \pgfusepath{draw}
5161 \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
5162 \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
5163 \pgfusepath{draw}
5164 \endpgfscope
5165
5166 }
5167
5168 %% Empty Source
5169 \pgfcircdeclarebipolescaled{sources}
5170 {}
5171 {\ctikzvalof{bipoles/esource/height}}
5172 {esource}
5173 {\ctikzvalof{bipoles/esource/height}}
5174 {\ctikzvalof{bipoles/esource/width}}
5175 {
5176 \pgfpointorigin
5177 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5178 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5179 \pgf@circ@draworfill
5180 }
5181
5182 %% DC Current Source with open shape
5183 \pgfcircdeclarebipolescaled{sources}
5184 {}
5185 {\ctikzvalof{bipoles/dcisource/height}}
5186 {dcisource}
5187 {\ctikzvalof{bipoles/dcisource/height}}
5188 {\ctikzvalof{bipoles/dcisource/width}}
5189 {
5190 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5191 \pgfpathmoveto{\pgfpointorigin}
5192 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5193 \pgf@circ@maybefill
5194 \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
5195 \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
5196 \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
5197 \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
5198 \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
5199 \pgfusepath{draw}
5200
5201 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5202 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5203 \pgfusepath{draw}
5204 \pgfscope
5205 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5206 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5207 \endpgfscope
5208 }
5209
5210 %% DC-Voltage source
5211 \pgfcircdeclarebipolescaled{sources}
5212 {}
5213 {\ctikzvalof{bipoles/dcvsource/height}}
5214 {dcvsource}
5215 {\ctikzvalof{bipoles/dcvsource/height}}
5216 {\ctikzvalof{bipoles/dcvsource/width}}
5217 {
5218 \pgfpointorigin
5219 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5220 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5221 \pgf@circ@draworfill
5222 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
5223 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
5224 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
5225 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
5226 \pgfusepath{draw}
5227 }
5228
5229 %% Independent current source
5230 \pgfcircdeclarebipolescaled{sources}
5231 {}
5232 {\ctikzvalof{bipoles/isource/height}}
5233 {isource}
5234 {\ctikzvalof{bipoles/isource/height}}
5235 {\ctikzvalof{bipoles/isource/width}}
5236 {
5237 \pgfpointorigin
5238 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5239 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5240 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
5241 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
5242 \pgf@circ@draworfill
5243 }
5244
5245 %% Independent double oo source
5246 \pgfcircdeclarebipolescaled{sources}
5247 {}
5248 {\ctikzvalof{bipoles/oosource/height}}
5249 {oosource}
5250 {\ctikzvalof{bipoles/oosource/height}}
5251 {\ctikzvalof{bipoles/oosource/width}}
5252 {
5253 \pgfpointorigin
5254 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5255 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
5256 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
5257 \pgf@circ@maybefill
5258 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
5259 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
5260 \pgf@circ@draworfill
5261 \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
5262 {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
5263 \pgfusepath{draw}
5264 }
5265
5266 %% Independent current source - American
5267 \pgfcircdeclarebipolescaled{sources}
5268 {}
5269 {\ctikzvalof{bipoles/isourceam/height}}
5270 {isourceAM}
5271 {\ctikzvalof{bipoles/isourceam/height}}
5272 {\ctikzvalof{bipoles/isourceam/width}}
5273 {
5274 \pgfpointorigin
5275 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5276 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5277 \pgf@circ@draworfill
5278
5279 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5280 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
5281 \pgfusepath{draw}
5282 \pgfscope
5283 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5284 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5285 \endpgfscope
5286 }
5287
5288 %% Independent sinusoidal current source
5289 \pgfcircdeclarebipolescaled{sources}
5290 {}
5291 {\ctikzvalof{bipoles/isource/height}}
5292 {isourcesin}
5293 {\ctikzvalof{bipoles/isource/height}}
5294 {\ctikzvalof{bipoles/isource/width}}
5295 {
5296 \pgfpointorigin
5297 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5298 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5299 \pgf@circ@draworfill
5300
5301 \pgf@circ@res@up = .5\pgf@circ@res@up
5302 \pgfscope
5303 \pgftransformrotate{90}
5304 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5305 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5306 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5307 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5308 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5309 \pgfusepath{draw}
5310 \endpgfscope
5311 }
5312
5313 %% Empty controlled source
5314 \pgfcircdeclarebipolescaled{csources}
5315 {}
5316 {\ctikzvalof{bipoles/ecsource/height}}
5317 {ecsource}
5318 {\ctikzvalof{bipoles/ecsource/height}}
5319 {\ctikzvalof{bipoles/ecsource/width}}
5320 {
5321
5322 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5323
5324 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5325 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5326 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5327 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5328 \pgfpathclose
5329 \pgf@circ@draworfill
5330 }
5331
5332 %% Controlled voltage source
5333 \pgfcircdeclarebipolescaled{csources}
5334 {}
5335 {\ctikzvalof{bipoles/cvsource/height}}
5336 {cvsource}
5337 {\ctikzvalof{bipoles/cvsource/height}}
5338 {\ctikzvalof{bipoles/cvsource/width}}
5339 {
5340
5341 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5342
5343 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5344 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5345 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5346 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5347 \pgfpathclose
5348 \pgf@circ@draworfill
5349
5350 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5351 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5352 \pgfusepath{draw}
5353 }
5354
5355 %% Controlled voltage source - American
5356 \pgfcircdeclarebipolescaled{csources}
5357 {}
5358 {\ctikzvalof{bipoles/cvsourceam/height}}
5359 {cvsourceAM}
5360 {\ctikzvalof{bipoles/cvsourceam/height}}
5361 {\ctikzvalof{bipoles/cvsourceam/width}}
5362 {
5363 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5364 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5365 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5366 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5367 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5368 \pgfpathclose
5369 \pgf@circ@draworfill
5370
5371 \pgfsetcolor{\ctikzvalof{color}}
5372 \ifpgf@circ@oldvoltagedirection
5373 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
5374 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
5375 \else
5376 \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
5377 \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
5378 \fi
5379 }
5380
5381 %% Controlled sinusoidal voltage source
5382 \pgfcircdeclarebipolescaled{csources}
5383 {}
5384 {\ctikzvalof{bipoles/cvsourcesin/height}}
5385 {cvsourcesin}
5386 {\ctikzvalof{bipoles/cvsourcesin/height}}
5387 {\ctikzvalof{bipoles/cvsourcesin/width}}
5388 {
5389
5390 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5391
5392 \pgfscope
5393 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5394 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5395 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5396 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5397 \pgfpathclose
5398 \pgf@circ@draworfill
5399 \endpgfscope
5400
5401 \pgf@circ@res@up = .5\pgf@circ@res@up
5402 \pgfscope
5403 \pgftransformrotate{90}
5404 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5405 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5406 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5407 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5408 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5409 \pgfusepath{draw}
5410 \endpgfscope
5411 }
5412
5413 %% Controlled sinusoidal current source
5414 \pgfcircdeclarebipolescaled{csources}
5415 {}
5416 {\ctikzvalof{bipoles/cvsourcesin/height}}
5417 {cisourcesin}
5418 {\ctikzvalof{bipoles/cvsourcesin/height}}
5419 {\ctikzvalof{bipoles/cvsourcesin/width}}
5420 {
5421
5422 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5423
5424 \pgfscope
5425 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5426 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5427 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5428 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5429 \pgfpathclose
5430 \pgf@circ@draworfill
5431 \endpgfscope
5432
5433 \pgf@circ@res@up = .5\pgf@circ@res@up
5434 \pgfscope
5435 \pgftransformrotate{90}
5436 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
5437 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5438 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5439 \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
5440 \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
5441 \pgfusepath{draw}
5442 \endpgfscope
5443 }
5444
5445 %% Controlled current source
5446 \pgfcircdeclarebipolescaled{csources}
5447 {}
5448 {\ctikzvalof{bipoles/cisource/height}}
5449 {cisource}
5450 {\ctikzvalof{bipoles/cisource/height}}
5451 {\ctikzvalof{bipoles/cisource/width}}
5452 {
5453
5454 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5455
5456 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5457 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5458 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5459 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5460 \pgfpathclose
5461 \pgf@circ@draworfill
5462
5463 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5464 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5465 \pgfusepath{draw}
5466 }
5467
5468 %% Controlled current source - American
5469 \pgfcircdeclarebipolescaled{csources}
5470 {}
5471 {\ctikzvalof{bipoles/cisourceam/height}}
5472 {cisourceAM}
5473 {\ctikzvalof{bipoles/cisourceam/height}}
5474 {\ctikzvalof{bipoles/cisourceam/width}}
5475 {
5476 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5477
5478 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5479 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5480 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5481 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5482 \pgfpathclose
5483 \pgf@circ@draworfill
5484 \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
5485 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
5486 \pgfusepath{draw}
5487 \pgfscope
5488 \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
5489 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
5490 \endpgfscope
5491 }
5492
5493 %% Cute Independent voltage source
5494 \pgfcircdeclarebipolescaled{sources}
5495 {}
5496 {\ctikzvalof{bipoles/vsource/height}}
5497 {vsourceC}
5498 {\ctikzvalof{bipoles/vsource/height}}
5499 {\ctikzvalof{bipoles/vsource/width}}
5500 {
5501 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5502 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5503 \pgf@circ@draworfill
5504 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5505 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5506 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
5507 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5508 \pgfsetroundcap\pgfusepath{draw}
5509 }
5510
5511 %% Cute Independent current source
5512 \pgfcircdeclarebipolescaled{sources}
5513 {}
5514 {\ctikzvalof{bipoles/isource/height}}
5515 {isourceC}
5516 {\ctikzvalof{bipoles/isource/height}}
5517 {\ctikzvalof{bipoles/isource/width}}
5518 {
5519 \pgfpointorigin
5520 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5521 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5522 \pgf@circ@draworfill
5523 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5524 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5525 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
5526 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
5527 \pgfsetroundcap\pgfusepath{draw}
5528 }
5529
5530 %% Cute Controlled voltage source
5531 \pgfcircdeclarebipolescaled{csources}
5532 {}
5533 {\ctikzvalof{bipoles/cvsource/height}}
5534 {cvsourceC}
5535 {\ctikzvalof{bipoles/cvsource/height}}
5536 {\ctikzvalof{bipoles/cvsource/width}}
5537 {
5538 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5539 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5540 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5541 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5542 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5543 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5544 \pgf@circ@draworfill
5545 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5546 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5547 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
5548 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5549 \pgfsetroundcap\pgfusepath{draw}
5550 }
5551
5552 %% Cute Controlled current source
5553 \pgfcircdeclarebipolescaled{csources}
5554 {}
5555 {\ctikzvalof{bipoles/cisource/height}}
5556 {cisourceC}
5557 {\ctikzvalof{bipoles/cisource/height}}
5558 {\ctikzvalof{bipoles/cisource/width}}
5559 {
5560 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5561 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5562 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
5563 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
5564 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
5565 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
5566 \pgf@circ@draworfill
5567 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5568 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5569 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
5570 \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
5571 \pgfsetroundcap\pgfusepath{draw}
5572 }
5573
5574 %% Noise voltage source
5575 \pgfcircdeclarebipolescaled{sources}
5576 {}
5577 {\ctikzvalof{bipoles/vsource/height}}
5578 {vsourceN}
5579 {\ctikzvalof{bipoles/vsource/height}}
5580 {\ctikzvalof{bipoles/vsource/width}}
5581 {
5582 \pgfscope
5583 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5584 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5585 %
5586 \pgf@circ@scaled@Rlen=\scaledRlen
5587 \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
5588 \edef\pgf@noise@temp{dashed}
5589 \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
5590 \ifx\pgf@noise@temp\pgf@noise@fill
5591 % fillable in this case
5592 \pgf@circ@draworfillandclip
5593 \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
5594 \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
5595 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5596 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5597 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5598 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5599 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5600 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5601 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5602 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5603 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5604 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5605 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5606 %
5607 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
5608 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5609 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5610 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5611 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5612 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5613 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5614 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5615 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5616 \pgfusepath{draw}
5617 \else
5618 \pgfsetfillcolor{\pgf@noise@fill}
5619 \pgfusepath{draw,fill}
5620 \fi
5621 \endpgfscope
5622 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5623 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5624 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
5625 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
5626 \pgfsetroundcap\pgfusepath{draw}
5627 }
5628 %% Noise current source
5629
5630 \pgfcircdeclarebipolescaled{sources}
5631 {}
5632 {\ctikzvalof{bipoles/isource/height}}
5633 {isourceN}
5634 {\ctikzvalof{bipoles/isource/height}}
5635 {\ctikzvalof{bipoles/isource/width}}
5636 {
5637 \pgfpointorigin
5638 \pgfscope
5639 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5640 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
5641 %
5642 \pgf@circ@scaled@Rlen=\scaledRlen
5643 \pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax
5644 \edef\pgf@noise@temp{dashed}
5645 \edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
5646 \ifx\pgf@noise@temp\pgf@noise@fill
5647 % fillable in this case
5648 \pgf@circ@draworfillandclip
5649 \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
5650 \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
5651 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5652 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5653 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5654 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5655 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5656 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5657 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5658 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5659 \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
5660 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5661 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5662 %
5663 \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
5664 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5665 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5666 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5667 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5668 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5669 \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
5670 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5671 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5672 \pgfusepath{draw}
5673 \else
5674 \pgfsetfillcolor{\pgf@noise@fill}
5675 \pgfusepath{draw,fill}
5676 \fi
5677 \endpgfscope
5678 \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
5679 \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
5680 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
5681 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
5682 \pgfsetroundcap\pgfusepath{draw}
5683 }
5684
5685 %%%%%%%%%%%%%%
5686 %% Diodes
5687 %%%%%%%%%%%%%%
5688
5689 %% Black generic diode
5690 \pgfcircdeclarebipolescaled{diodes}
5691 {}
5692 {\ctikzvalof{bipoles/diode/height}}
5693 {fulldiode}
5694 {\ctikzvalof{bipoles/diode/height}}
5695 {\ctikzvalof{bipoles/diode/width}}
5696 {
5697
5698 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5699
5700 \pgfscope
5701 \pgftransformxshift{\pgf@circ@res@left}
5702 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5703 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5704 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5705 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5706 \pgfusepath{draw,fill}
5707 \endpgfscope
5708 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5709 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5710 \pgfusepath{draw}
5711 }
5712
5713 %% Black Zener diode
5714 \pgfcircdeclarebipolescaled{diodes}
5715 {}
5716 {\ctikzvalof{bipoles/diode/height}}
5717 {fullzdiode}
5718 {\ctikzvalof{bipoles/diode/height}}
5719 {\ctikzvalof{bipoles/diode/width}}
5720 {
5721
5722 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5723
5724 \pgfscope
5725 \pgftransformxshift{\pgf@circ@res@left}
5726 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5727 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5728 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5729 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5730 \pgfusepath{draw,fill}
5731 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5732 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5733 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5734 \pgfusepath{draw}
5735 \endpgfscope
5736 }
5737
5738 %% Black alternative zigzag Zener diode
5739 \pgfcircdeclarebipolescaled{diodes}
5740 {}
5741 {\ctikzvalof{bipoles/diode/height}}
5742 {fullzzdiode}
5743 {\ctikzvalof{bipoles/diode/height}}
5744 {\ctikzvalof{bipoles/diode/width}}
5745 {
5746
5747 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5748
5749 \pgfscope
5750 \pgftransformxshift{\pgf@circ@res@left}
5751 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5752 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5753 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5754 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5755 \pgfusepath{draw,fill}
5756 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
5757 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5758 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5759 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
5760 \pgfusepath{draw}
5761 \endpgfscope
5762 }
5763
5764 %% Black Schottky diode
5765 \pgfcircdeclarebipolescaled{diodes}
5766 {}
5767 {\ctikzvalof{bipoles/diode/height}}
5768 {fullsdiode}
5769 {\ctikzvalof{bipoles/diode/height}}
5770 {\ctikzvalof{bipoles/diode/width}}
5771 {
5772
5773 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5774 \pgfscope
5775 \pgftransformxshift{\pgf@circ@res@left}
5776 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5777 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5778 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5779 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5780 \pgfusepath{draw,fill}
5781
5782 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
5783 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
5784 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5785 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5786 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5787 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5788 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
5789 \pgfusepath{draw}
5790 \endpgfscope
5791
5792 }
5793
5794 %% Black tunnel diode
5795 \pgfcircdeclarebipolescaled{diodes}
5796 {}
5797 {\ctikzvalof{bipoles/diode/height}}
5798 {fulltdiode}
5799 {\ctikzvalof{bipoles/diode/height}}
5800 {\ctikzvalof{bipoles/diode/width}}
5801 {
5802
5803 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5804 \pgfscope
5805 \pgftransformxshift{\pgf@circ@res@left}
5806 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5807 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5808 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5809 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5810 \pgfusepath{draw,fill}
5811
5812 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
5813 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5814 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5815 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5816 \pgfusepath{draw}
5817 \endpgfscope
5818 }
5819
5820 %% Black light emitting diode
5821 \pgfcircdeclarebipolescaled{diodes}
5822 {}
5823 {\ctikzvalof{bipoles/diode/height}}
5824 {fulllediode}
5825 {\ctikzvalof{bipoles/diode/height}}
5826 {\ctikzvalof{bipoles/diode/width}}
5827 {
5828
5829 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5830 \pgfscope
5831 \pgftransformxshift{\pgf@circ@res@left}
5832 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5833 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5834 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5835 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5836 \pgfusepath{draw,fill}
5837 \endpgfscope
5838 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5839 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5840 \pgfusepath{draw}
5841
5842 \pgfsetlinewidth{\pgfstartlinewidth}
5843 \pgfsetarrowsend{latexslim}
5844 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5845 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
5846 \pgfusepath{draw}
5847 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
5848 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
5849 \pgfusepath{draw}
5850
5851 }
5852
5853 %% Black photodiode
5854 \pgfcircdeclarebipolescaled{diodes}
5855 {}
5856 {\ctikzvalof{bipoles/diode/height}}
5857 {fullpdiode}
5858 {\ctikzvalof{bipoles/diode/height}}
5859 {\ctikzvalof{bipoles/diode/width}}
5860 {
5861
5862 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5863 \pgfscope
5864 \pgftransformxshift{\pgf@circ@res@left}
5865 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5866 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5867 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5868 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5869 \pgfusepath{draw,fill}
5870 \endpgfscope
5871 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5872 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5873 \pgfusepath{draw}
5874
5875 \pgfsetlinewidth{\pgfstartlinewidth}
5876 \pgfsetarrowsstart{latexslim}
5877 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
5878 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
5879 \pgfusepath{draw}
5880 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
5881 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
5882 \pgfusepath{draw}
5883 }
5884
5885 %% Black varcap
5886 \pgfcircdeclarebipolescaled{diodes}
5887 {}
5888 {\ctikzvalof{bipoles/varcap/height}}
5889 {fullvarcap}
5890 {\ctikzvalof{bipoles/varcap/height}}
5891 {\ctikzvalof{bipoles/varcap/width}}
5892 {
5893 \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
5894 \pgfsetlinewidth{\pgf@circ@res@temp}
5895 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5896 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
5897 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
5898 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
5899 \pgfusepath{draw,fill}
5900 %
5901 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
5902 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
5903 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5904 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5905 \pgfusepath{draw}
5906 }
5907
5908 %% Code for the diode triangle
5909 \def\pgf@circ@basicdiodeshape{
5910 % \pgfscope
5911 \pgftransformxshift{\pgf@circ@res@left}
5912 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5913 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
5914 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
5915 \pgfpathclose
5916 \pgf@circ@draworfill
5917 \pgfscope
5918 % to allow filling, we need to draw explicitly the stroke here.
5919 \pgfsetlinewidth{\pgfstartlinewidth}
5920 \ifpgf@circuit@bipole@strokedsymbol
5921 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
5922 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
5923 \pgfusepath{draw}
5924 \fi
5925 \endpgfscope
5926 % \endpgfscope
5927 }
5928
5929 %% Empty generic diode
5930 \pgfcircdeclarebipolescaled{diodes}
5931 {}
5932 {\ctikzvalof{bipoles/diode/height}}
5933 {emptydiode}
5934 {\ctikzvalof{bipoles/diode/height}}
5935 {\ctikzvalof{bipoles/diode/width}}
5936 {
5937 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5938 \pgfscope
5939 \pgf@circ@basicdiodeshape
5940 \endpgfscope
5941 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
5942 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
5943 \pgfusepath{draw}
5944 }
5945
5946 %% Empty Zener diode
5947 \pgfcircdeclarebipolescaled{diodes}
5948 {}
5949 {\ctikzvalof{bipoles/diode/height}}
5950 {emptyzdiode}
5951 {\ctikzvalof{bipoles/diode/height}}
5952 {\ctikzvalof{bipoles/diode/width}}
5953 {
5954
5955 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5956
5957 \pgfscope
5958 \pgf@circ@basicdiodeshape
5959 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5960 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5961 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
5962 \pgfusepath{draw}
5963 \endpgfscope
5964 }
5965
5966 %% Empty alternative zigzag Zener diode
5967 \pgfcircdeclarebipolescaled{diodes}
5968 {}
5969 {\ctikzvalof{bipoles/diode/height}}
5970 {emptyzzdiode}
5971 {\ctikzvalof{bipoles/diode/height}}
5972 {\ctikzvalof{bipoles/diode/width}}
5973 {
5974
5975 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5976
5977 \pgfscope
5978 \pgf@circ@basicdiodeshape
5979 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@up}}
5980 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
5981 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
5982 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@[email protected]\pgf@circ@res@down}}
5983 \pgfusepath{draw}
5984 \endpgfscope
5985 }
5986 %% Empty Schottky diode
5987 \pgfcircdeclarebipolescaled{diodes}
5988 {}
5989 {\ctikzvalof{bipoles/diode/height}}
5990 {emptysdiode}
5991 {\ctikzvalof{bipoles/diode/height}}
5992 {\ctikzvalof{bipoles/diode/width}}
5993 {
5994
5995 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
5996 \pgfscope
5997 \pgf@circ@basicdiodeshape
5998 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}}
5999 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6000 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6001 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6002 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6003 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6004 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}}
6005 \pgfusepath{draw}
6006 \endpgfscope
6007
6008 }
6009
6010 %% Empty tunnel diode
6011 \pgfcircdeclarebipolescaled{diodes}
6012 {}
6013 {\ctikzvalof{bipoles/diode/height}}
6014 {emptytdiode}
6015 {\ctikzvalof{bipoles/diode/height}}
6016 {\ctikzvalof{bipoles/diode/width}}
6017 {
6018
6019 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6020 \pgfscope
6021 \pgf@circ@basicdiodeshape
6022 \pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}}
6023 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
6024 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
6025 \pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}}
6026 \pgfusepath{draw}
6027 \endpgfscope
6028 }
6029
6030 %% Empty light emitting diode
6031 \pgfcircdeclarebipolescaled{diodes}
6032 {}
6033 {\ctikzvalof{bipoles/diode/height}}
6034 {emptylediode}
6035 {\ctikzvalof{bipoles/diode/height}}
6036 {\ctikzvalof{bipoles/diode/width}}
6037 {
6038
6039 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6040 \pgfscope
6041 \pgf@circ@basicdiodeshape
6042 \endpgfscope
6043 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6044 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6045 \pgfusepath{draw}
6046
6047 \pgfsetlinewidth{\pgfstartlinewidth}
6048 \pgfsetarrowsend{latexslim}
6049 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6050 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6051 \pgfusepath{draw}
6052 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6053 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6054 \pgfusepath{draw}
6055 }
6056
6057 %% Empty photodiode
6058 \pgfcircdeclarebipolescaled{diodes}
6059 {}
6060 {\ctikzvalof{bipoles/diode/height}}
6061 {emptypdiode}
6062 {\ctikzvalof{bipoles/diode/height}}
6063 {\ctikzvalof{bipoles/diode/width}}
6064 {
6065
6066 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6067 \pgfscope
6068 \pgf@circ@basicdiodeshape
6069 \endpgfscope
6070 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6071 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6072 \pgfusepath{draw}
6073
6074 \pgfsetlinewidth{\pgfstartlinewidth}
6075 \pgfsetarrowsstart{latexslim}
6076 \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
6077 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
6078 \pgfusepath{draw}
6079 \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
6080 \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
6081 \pgfusepath{draw}
6082 }
6083
6084 %% Empty varcap
6085 \pgfcircdeclarebipolescaled{diodes}
6086 {}
6087 {\ctikzvalof{bipoles/varcap/height}}
6088 {emptyvarcap}
6089 {\ctikzvalof{bipoles/varcap/height}}
6090 {\ctikzvalof{bipoles/varcap/width}}
6091 {
6092 \pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
6093 \pgfsetlinewidth{\pgf@circ@res@temp}
6094 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6095 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
6096 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6097 % \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6098 \pgfpathclose
6099 \pgf@circ@draworfill
6100 \pgfscope
6101 % to allow filling, we need to draw explicitily the stroke here.
6102 \pgfsetlinewidth{\pgfstartlinewidth}
6103 \ifpgf@circuit@bipole@strokedsymbol
6104 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
6105 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6106 \pgfusepath{draw}
6107 \fi
6108 \endpgfscope
6109 %
6110 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
6111 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
6112 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
6113 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6114 \pgfusepath{draw}
6115 }
6116
6117 %% Empty bidirectionaldiode
6118 \pgfcircdeclarebipolescaled{diodes}
6119 {}
6120 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6121 {emptybidirectionaldiode}
6122 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6123 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
6124 {
6125
6126 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6127
6128 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
6129 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
6130
6131 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6132 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6133 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6134 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6135
6136 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6137 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6138 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6139 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6140
6141 \pgf@circ@draworfill
6142
6143 \pgfsetlinewidth{\pgfstartlinewidth}
6144
6145 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6146 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6147
6148 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6149 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6150
6151 \pgfusepath{draw}
6152 }
6153
6154 %% Full bidirectionaldiode
6155 \pgfcircdeclarebipolescaled{diodes}
6156 {}
6157 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6158 {fullbidirectionaldiode}
6159 {\ctikzvalof{bipoles/bidirectionaldiode/height}}
6160 {\ctikzvalof{bipoles/bidirectionaldiode/width}}
6161 {
6162
6163 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6164
6165 \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
6166 \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right
6167
6168 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6169 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6170 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6171 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6172
6173 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6174 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6175 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6176 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6177
6178 \pgfusepath{draw, fill}
6179
6180 \pgfsetlinewidth{\pgfstartlinewidth}
6181
6182 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6183 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6184
6185 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6186 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6187
6188 \pgfusepath{draw}
6189 }
6190
6191 %% Black thyristor
6192 \pgfcircdeclarebipolescaled{diodes}
6193 {
6194 \anchor{gate}{\northeast}
6195 \anchor{anode}{\southwest\pgf@y=0cm}
6196 \anchor{G}{\northeast}
6197 \anchor{cathode}{\northeast\pgf@y=0cm }
6198 }
6199 {\ctikzvalof{tripoles/thyristor/height 2}}
6200 {fullthyristor}
6201 {\ctikzvalof{tripoles/thyristor/height}}
6202 {\ctikzvalof{tripoles/thyristor/width}}
6203 {
6204
6205 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6206
6207 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
6208 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
6209
6210 \pgfscope
6211 \pgftransformxshift{\pgf@circ@res@other}
6212 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6213
6214 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
6215 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6216 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6217 \pgfusepath{draw,fill}
6218
6219 \pgfsetlinewidth{\pgfstartlinewidth}
6220
6221 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6222 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
6223 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
6224 \pgfusepath{draw}
6225 \endpgfscope
6226
6227 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
6228 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
6229
6230 \pgfusepath{draw}
6231
6232 \pgfsetlinewidth{\pgfstartlinewidth}
6233
6234 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6235 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6236
6237 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6238 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6239
6240 \pgfusepath{draw}
6241
6242 }
6243
6244 %% Empty thyristor
6245
6246 \pgfcircdeclarebipolescaled{diodes}
6247 {
6248 \anchor{gate}{\northeast}
6249 \anchor{anode}{\southwest\pgf@y=0cm}
6250 \anchor{G}{\northeast}
6251 \anchor{cathode}{\northeast\pgf@y=0cm }
6252 }
6253 {\ctikzvalof{tripoles/thyristor/height 2}}
6254 {emptythyristor}
6255 {\ctikzvalof{tripoles/thyristor/height}}
6256 {\ctikzvalof{tripoles/thyristor/width}}
6257 {
6258
6259 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6260
6261 \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
6262 \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
6263
6264 \pgfscope
6265 \pgftransformxshift{\pgf@circ@res@other}
6266 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6267
6268 \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
6269 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
6270 \pgfpathclose
6271 \pgf@circ@draworfill
6272 \pgfscope
6273 % to allow filling, we need to draw explicitily the stroke here.
6274 \pgfsetlinewidth{\pgfstartlinewidth}
6275 \ifpgf@circuit@bipole@strokedsymbol
6276 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6277 \pgfpathlineto{\pgfpoint{0pt}{0pt}}
6278 \pgfusepath{draw}
6279 \fi
6280 \endpgfscope
6281
6282 \pgfsetlinewidth{\pgfstartlinewidth}
6283
6284 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
6285 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
6286 \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
6287 \pgfusepath{draw}
6288 \endpgfscope
6289
6290 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
6291 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
6292
6293 \pgfusepath{draw}
6294
6295 \pgfsetlinewidth{\pgfstartlinewidth}
6296
6297 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6298 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6299
6300 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6301 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6302
6303 \pgfusepath{draw}
6304 }
6305
6306 %% Empty triac
6307 \pgfcircdeclarebipolescaled{diodes}
6308 {
6309 \anchor{gate}{\northeast}
6310 \anchor{anode}{\southwest\pgf@y=0cm}
6311 \anchor{G}{\northeast}
6312 \anchor{cathode}{\northeast\pgf@y=0cm }
6313 }
6314 {\ctikzvalof{tripoles/triac/height}}
6315 {emptytriac}
6316 {\ctikzvalof{tripoles/triac/height}}
6317 {\ctikzvalof{tripoles/triac/width}}
6318 {
6319
6320 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6321
6322 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
6323 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
6324
6325 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6326 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6327 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6328 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6329
6330 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6331 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6332 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6333 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6334
6335 \pgf@circ@draworfill
6336
6337 \pgfsetlinewidth{\pgfstartlinewidth}
6338
6339 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6340 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6341 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
6342
6343 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6344 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6345
6346 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6347 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6348
6349 \pgfusepath{draw}
6350 }
6351
6352 %% Full triac
6353 \pgfcircdeclarebipolescaled{diodes}
6354 {
6355 \anchor{gate}{\northeast}
6356 \anchor{anode}{\southwest\pgf@y=0cm}
6357 \anchor{G}{\northeast}
6358 \anchor{cathode}{\northeast\pgf@y=0cm }
6359 }
6360 {\ctikzvalof{tripoles/triac/height}}
6361 {fulltriac}
6362 {\ctikzvalof{tripoles/triac/height}}
6363 {\ctikzvalof{tripoles/triac/width}}
6364 {
6365 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6366
6367 \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
6368 \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
6369
6370 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6371 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6372 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6373 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6374
6375 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6376 \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6377 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6378 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
6379
6380 \pgfusepath{draw,fill}
6381
6382 \pgfsetlinewidth{\pgfstartlinewidth}
6383
6384 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6385 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
6386 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
6387
6388 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
6389 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6390
6391 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
6392 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6393
6394 \pgfusepath{draw}
6395 }
6396
6397 %%%%%%%%%%%%%
6398 %% switches
6399 %%%%%%%%%%%%%
6400
6401 %% (Closing) SPST
6402 \pgfcircdeclarebipolescaled{switches}
6403 {}
6404 {\ctikzvalof{bipoles/spst/depth}}
6405 {cspst}
6406 {\ctikzvalof{bipoles/spst/height}}
6407 {\ctikzvalof{bipoles/spst/width}}
6408 {
6409 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6410 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6411 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
6412 \pgfusepath{draw}
6413
6414 \pgfscope
6415 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6416 \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
6417 \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
6418 \pgfsetarrowsend{latexslim}
6419 \pgfsetbeveljoin
6420 \pgfusepath{draw}
6421 \endpgfscope
6422 }
6423
6424 %% Opening SPST
6425 \pgfcircdeclarebipolescaled{switches}
6426 {}
6427 {\ctikzvalof{bipoles/spst/depth}}
6428 {ospst}
6429 {\ctikzvalof{bipoles/spst/height}}
6430 {\ctikzvalof{bipoles/spst/width}}
6431 {
6432
6433 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6434 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6435 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
6436 \pgfusepath{draw}
6437
6438 \pgfscope
6439 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6440 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
6441 \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
6442 \pgfsetarrowsend{latexslim}
6443 \pgfsetbeveljoin
6444 \pgfusepath{draw}
6445 \endpgfscope
6446 }
6447
6448 %% Normal open Switch
6449 \pgfcircdeclarebipolescaled{switches}
6450 {}
6451 {\ctikzvalof{bipoles/nos/depth}}
6452 {nos}
6453 {\ctikzvalof{bipoles/nos/height}}
6454 {\ctikzvalof{bipoles/nos/width}}
6455 {
6456
6457 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6458 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6459 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
6460 \pgfsetbuttcap
6461 \pgfusepath{draw}
6462 }
6463
6464 %% Normal closed Switch
6465 \pgfcircdeclarebipolescaled{switches}
6466 {}
6467 {\ctikzvalof{bipoles/ncs/depth}}
6468 {ncs}
6469 {\ctikzvalof{bipoles/ncs/height}}
6470 {\ctikzvalof{bipoles/ncs/width}}
6471 {
6472 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6473 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6474 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
6475 \pgfusepath{draw}
6476 \pgfsetlinewidth{\pgfstartlinewidth}
6477 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6478 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
6479 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
6480 \pgfusepath{draw}
6481 }
6482
6483 %% Push Button
6484 \pgfcircdeclarebipolescaled{switches}
6485 {}
6486 {\ctikzvalof{bipoles/pushbutton/height 2}}
6487 {pushbutton}
6488 {\ctikzvalof{bipoles/pushbutton/height}}
6489 {\ctikzvalof{bipoles/pushbutton/width}}
6490 {
6491 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6492 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
6493 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
6494 \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
6495 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
6496 \pgfusepath{draw}
6497
6498 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6499 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6500 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
6501 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6502 }
6503
6504 %% Normally closed Push Button
6505 \pgfcircdeclarebipolescaled{switches}
6506 {}
6507 {\ctikzvalof{bipoles/pushbutton/height 2}}
6508 {ncpushbutton}
6509 {\ctikzvalof{bipoles/pushbutton/height}}
6510 {\ctikzvalof{bipoles/pushbutton/width}}
6511 {
6512 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6513 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
6514 % Warning, if the nodes will have a class, we have to touch this.
6515 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
6516 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
6517 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
6518 \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
6519 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
6520 \pgfusepath{draw}
6521 %
6522 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6523 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6524 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
6525 \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
6526 }
6527 % cute switch "to" shapes help function
6528 % #1 -> name
6529 % #2 -> barposition
6530 % #3 -> arrowcode
6531 \long\def\pgfcircdeclarecutesw#1#2#3{
6532 \pgfcircdeclarebipolescaled{switches}
6533 {
6534 \savedanchor\midlever{
6535 % these values are calculated when we create the definition of the shape.
6536 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
6537 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
6538 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
6539 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
6540 \pgf@circ@res@down = -.5\pgf@y
6541 \pgf@circ@res@up = .5\pgf@y
6542 \pgfextracty{\pgf@circ@res@other}{#2}
6543 \pgf@x=0pt
6544 \pgf@y=.5\pgf@circ@res@other
6545 }
6546 % radius of the connector
6547 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
6548 % If cnnecting nodes are scaled, we have to modify this
6549 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
6550 % shapename
6551 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
6552 % shape type
6553 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
6554 % mid of the lever, to stack switches
6555 \anchor{mid}{\midlever}
6556 \anchor{cout}{\northeast \pgf@y=0cm}
6557 \anchor{cin}{\southwest\pgf@y=0cm}
6558 \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
6559 \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
6560 }
6561 {\ctikzvalof{bipoles/cuteswitch/height 2}}
6562 {#1}
6563 {\ctikzvalof{bipoles/cuteswitch/height}}
6564 {\ctikzvalof{bipoles/cuteswitch/width}}{
6565 \pgfscope
6566 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
6567 % If cnnecting nodes are scaled, we have to modify this
6568 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
6569 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
6570 \pgfsetlinewidth{2\pgf@circ@res@temp}
6571 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6572 \pgfpathlineto{#2}
6573 \pgfsetroundcap\pgfusepath{draw}
6574 \endpgfscope
6575 \pgfscope % arrow
6576 #3
6577 \endpgfscope
6578 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
6579 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
6580 \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
6581 \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
6582 }
6583 }
6584
6585 %% closed cute switch
6586 \pgfcircdeclarecutesw{cuteclosedswitch}
6587 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
6588 {}
6589
6590 %% open cute switch
6591 \pgfcircdeclarecutesw{cuteopenswitch}
6592 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6593 {}
6594
6595 %% closing cute switch
6596 \pgfcircdeclarecutesw{cuteclosingswitch}
6597 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6598 {
6599 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6600 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
6601 \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
6602 \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
6603 \pgfsetarrowsend{latexslim}
6604 \pgfusepath{draw}
6605 }
6606
6607 %% opening cute switch
6608 \pgfcircdeclarecutesw{cuteopeningswitch}
6609 {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
6610 {
6611 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6612 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
6613 \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
6614 \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
6615 \pgfsetarrowsend{latexslim}
6616 \pgfusepath{draw}
6617 }
6618
6619 %%%%%%%%%%%%%%%%%
6620 %% Instruments
6621 %%%%%%%%%%%%%%%%%
6622
6623 % % METERINGSHAPE
6624 \long\def\drawmeteringcircle{
6625 \def\pgf@circ@temp{right}
6626 \ifx\tikz@res@label@pos\pgf@circ@temp
6627 \pgf@circ@res@step=-1.2\pgf@circ@res@up
6628 \else
6629 \def\pgf@circ@temp{below}
6630 \ifx\tikz@res@label@pos\pgf@circ@temp
6631 \pgf@circ@res@step=-1.2\pgf@circ@res@up
6632 \else
6633 \pgf@circ@res@step=1.2\pgf@circ@res@up
6634 \fi
6635 \fi
6636 %draw connections to circle
6637 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
6638 \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
6639 \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
6640 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
6641 \pgfusepath{draw}
6642 %draw circle
6643 \pgfscope
6644 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6645 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
6646 \pgf@circ@draworfill
6647 \endpgfscope
6648 %draw arrow
6649 \pgfscope
6650 \pgfsetarrowsend{latex}
6651 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
6652 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
6653 \pgfusepath{draw}
6654 \endpgfscope
6655 }
6656
6657 %AMPEREMETER
6658 \pgfcircdeclarebipolescaled{instruments}
6659 {}
6660 {\ctikzvalof{bipoles/ammeter/height}}
6661 {ammeter}
6662 {\ctikzvalof{bipoles/ammeter/height}}
6663 {\ctikzvalof{bipoles/ammeter/width}}
6664 {
6665 \drawmeteringcircle
6666 \pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{}
6667 }
6668 %OHMMETER
6669 \pgfcircdeclarebipolescaled{instruments}
6670 {}
6671 {\ctikzvalof{bipoles/ohmmeter/height}}
6672 {ohmmeter}
6673 {\ctikzvalof{bipoles/ohmmeter/height}}
6674 {\ctikzvalof{bipoles/ohmmeter/width}}
6675 {
6676 \drawmeteringcircle
6677 \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
6678 }
6679 %VOLTMETER
6680 \pgfcircdeclarebipolescaled{instruments}
6681 {}
6682 {\ctikzvalof{bipoles/voltmeter/height}}
6683 {voltmeter}
6684 {\ctikzvalof{bipoles/voltmeter/height}}
6685 {\ctikzvalof{bipoles/voltmeter/width}}
6686 {
6687 \drawmeteringcircle
6688 \pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{}
6689
6690 }
6691
6692 % oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
6693 \pgfcircdeclarebipolescaled{instruments}
6694 {
6695 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
6696 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
6697 % put the node text above and centered
6698 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
6699 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
6700 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
6701 }
6702 }
6703 }
6704 {\ctikzvalof{bipoles/oscope/height}}
6705 {oscope}
6706 {\ctikzvalof{bipoles/oscope/height}}
6707 {\ctikzvalof{bipoles/oscope/width}}
6708 {
6709 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6710 \pgfextracty{\pgf@circ@res@up}{\northeast}
6711 \pgfextractx{\pgf@circ@res@right}{\northeast}
6712 \pgfextractx{\pgf@circ@res@left}{\southwest}
6713 \pgfextracty{\pgf@circ@res@down}{\southwest}
6714 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
6715 \pgfscope
6716 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
6717 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6718 % this would create a round (analog?) scope...
6719 % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6720 \pgf@circ@draworfill
6721 \endpgfscope
6722 % get the rotation
6723 \pgfgettransformentries\a\b\temp\temp\temp\temp
6724 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
6725 % and unrotate the scope
6726 \pgfscope
6727 \pgftransformrotate{\rot}
6728 % grid
6729 \pgfscope
6730 \pgfsetlinewidth{0.5\pgfstartlinewidth}
6731 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
6732 \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
6733 {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
6734 {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
6735 \pgfsetstrokeopacity{0.5}
6736 \pgfusepath{draw}
6737 \endpgfscope
6738 % function displayed, thanks to
6739 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6740 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
6741 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
6742 \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
6743 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
6744 \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
6745 \pgfusepath{draw}
6746 \endpgfscope
6747 }
6748
6749 % generic round meter with always horizontal text, no arrow
6750 \pgfcircdeclarebipolescaled{instruments}
6751 {}
6752 {\ctikzvalof{bipoles/esource/height}}
6753 {rmeter}
6754 {\ctikzvalof{bipoles/esource/height}}
6755 {\ctikzvalof{bipoles/esource/width}}
6756 {
6757 \pgfpointorigin
6758 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6759 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6760 \pgf@circ@draworfill
6761 % draw the text label
6762 % get the rotation
6763 \pgfgettransformentries\a\b\temp\temp\temp\temp
6764 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
6765 % and unrotate the scope
6766 \pgfscope
6767 \pgfsetcolor{\ctikzvalof{color}}
6768 \pgftransformrotate{\rot}
6769 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
6770 \endpgfscope
6771 }
6772
6773 % generic round meter with always horizontal text, with arrow
6774 \pgfcircdeclarebipolescaled{instruments}
6775 {}
6776 {\ctikzvalof{bipoles/esource/height}}
6777 {rmeterwa}
6778 {\ctikzvalof{bipoles/esource/height}}
6779 {\ctikzvalof{bipoles/esource/width}}
6780 {
6781 \pgfpointorigin
6782 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6783 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
6784 \pgf@circ@draworfill
6785 % draw the text label
6786 % get the rotation
6787 \pgfgettransformentries\a\b\temp\temp\temp\temp
6788 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
6789 % and unrotate the scope
6790 \pgfscope
6791 \pgftransformrotate{\rot}
6792 \pgfsetcolor{\ctikzvalof{color}}
6793 \pgfsetlinewidth{\pgfstartlinewidth}
6794 % arrow: create a center hole to have better visual
6795 \pgfscope
6796 % clipping path: first a rectangle bigger then the shape
6797 % to avoid problems with the line thickness
6798 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
6799 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
6800 % next open a circle into it
6801 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
6802 % do the difference and clip before drawing
6803 \pgfseteorule
6804 \pgfusepath{clip}
6805 \pgfsetarrowsend{latexslim}
6806 % the arrow is better if it has a bit of breath and it's not 45º
6807 \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
6808 \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
6809 \pgfusepath{draw}
6810 \endpgfscope
6811 \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
6812 \endpgfscope
6813 }
6814
6815 % generic square meter with always horizontal text
6816 \pgfcircdeclarebipolescaled{instruments}
6817 {
6818 \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
6819 \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
6820 % put the node text above and centered
6821 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
6822 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
6823 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
6824 }
6825 }
6826 }
6827 {\ctikzvalof{bipoles/smeter/height}}
6828 {smeter}
6829 {\ctikzvalof{bipoles/smeter/height}}
6830 {\ctikzvalof{bipoles/smeter/width}}
6831 {
6832 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6833 \pgfextracty{\pgf@circ@res@up}{\northeast}
6834 \pgfextractx{\pgf@circ@res@right}{\northeast}
6835 \pgfextractx{\pgf@circ@res@left}{\southwest}
6836 \pgfextracty{\pgf@circ@res@down}{\southwest}
6837 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
6838 \pgfscope
6839 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
6840 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6841 \pgf@circ@draworfill
6842 \endpgfscope
6843 % get the rotation
6844 \pgfgettransformentries\a\b\temp\temp\temp\temp
6845 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
6846 % and unrotate the scope
6847 \pgfscope
6848 \pgftransformrotate{\rot}
6849 % the metering window
6850 \pgfscope
6851 \def\@starta{105}\def\@stopa{75}
6852 \pgfsetlinewidth{\pgfstartlinewidth}
6853 \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
6854 \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
6855 \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
6856 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
6857 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
6858 \pgfclosepath
6859 \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
6860 \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
6861 \pgfusepath{draw}
6862 \endpgfscope
6863 \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
6864 \endpgfscope
6865 }
6866
6867 % probes qucs style:
6868 % #1 : name
6869 % #2 : extra code
6870 \long\def\pgfcirc@qucsprobe#1#2{
6871 \pgfcircdeclarebipolescaled{instruments}
6872 {
6873 \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
6874 \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
6875 % put the node text above and centered
6876 \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
6877 \pgfpoint{-.5\wd\pgfnodeparttextbox}{
6878 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
6879 }
6880 }
6881 }
6882 {\ctikzvalof{bipoles/qmeter/depth}}
6883 {#1}
6884 {\ctikzvalof{bipoles/qmeter/height}}
6885 {\ctikzvalof{bipoles/qmeter/width}}
6886 {
6887 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
6888 \pgfextracty{\pgf@circ@res@up}{\northeast}
6889 \pgfextractx{\pgf@circ@res@right}{\northeast}
6890 \pgfextractx{\pgf@circ@res@left}{\southwest}
6891 \pgfextracty{\pgf@circ@res@down}{\southwest}
6892 \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
6893 \pgfscope
6894 \pgfscope
6895 \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
6896 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
6897 \pgf@circ@draworfill
6898 \endpgfscope
6899 \def\@starta{103}\def\@stopa{77}
6900 \pgfsetlinewidth{\pgfstartlinewidth}
6901 \pgfscope
6902 \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
6903 \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
6904 \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
6905 \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
6906 \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
6907 \pgfclosepath
6908 \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
6909 \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
6910 \pgfusepath{draw}
6911 \pgf@circ@draworfill
6912 \endpgfscope
6913 #2
6914 \endpgfscope
6915 }
6916 }
6917
6918 \pgfcirc@qucsprobe{qiprobe}{
6919 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6920 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6921 \pgfusepath{draw}
6922 \pgfnode{currarrow}{center}{}{}{}
6923 }
6924
6925 \pgfcirc@qucsprobe{qvprobe}{
6926 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
6927 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6928 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
6929 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
6930 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
6931 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6932 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
6933 \pgfusepath{draw}
6934 \pgfscope
6935 % "+" and "-", drawn so that they scale correctly
6936 \pgfsetlinewidth{2\pgfstartlinewidth}
6937 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
6938 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
6939 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
6940 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
6941 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
6942 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
6943 \pgfusepath{draw}
6944 \endpgfscope
6945 }
6946
6947 \pgfcirc@qucsprobe{qpprobe}{
6948 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
6949 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
6950 \pgfusepath{draw}
6951 \pgfnode{currarrow}{center}{}{}{}
6952 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}
6953 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
6954 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
6955 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
6956 \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
6957 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
6958 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
6959 \pgfusepath{draw}
6960 \pgfscope
6961 % "+" and "-", drawn so that they scale correctly
6962 \pgfsetlinewidth{2\pgfstartlinewidth}
6963 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
6964 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
6965 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
6966 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
6967 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
6968 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
6969 \pgfusepath{draw}
6970 \endpgfscope
6971 }
6972
6973 % current loop for oscope and similar: stylized
6974 \pgfcircdeclarebipolescaled{instruments}
6975 {
6976 \anchor{i}{\northeast\pgf@x=0pt\relax}
6977 \anchor{text}{
6978 \pgfextracty{\pgf@circ@res@up}{\northeast}
6979 \pgfextractx{\pgf@circ@res@left}{\northeast}
6980 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
6981 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
6982 }
6983 }
6984 }
6985 {\ctikzvalof{bipoles/iloop/height}}
6986 {iloop}
6987 {\ctikzvalof{bipoles/iloop/height}}
6988 {\ctikzvalof{bipoles/iloop/width}}
6989 {
6990 \pgfextracty{\pgf@circ@res@up}{\northeast}
6991 \pgfextractx{\pgf@circ@res@right}{\northeast}
6992 \pgf@circ@res@down=-\pgf@circ@res@up
6993 \pgf@circ@res@left=-\pgf@circ@res@right
6994 \pgfscope
6995 \pgfstartlinewidth=\pgflinewidth
6996 \pgfsetcolor{\ctikzvalof{color}}
6997 % external ellipse
6998 \pgfscope
6999 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
7000 % clipping path: first a rectangle bigger then the shape
7001 % to avoid problems with the line thickness
7002 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7003 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7004 % next the opening to the left
7005 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
7006 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
7007 % do the difference and clip before drawing
7008 \pgfseteorule
7009 \pgfusepath{clip}
7010 \pgfpathellipse{\pgfpointorigin}{
7011 \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
7012 \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
7013 \pgfusepath{draw}
7014 \endpgfscope
7015 % internal wire
7016 \pgfsetlinewidth{\pgfstartlinewidth}
7017 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7018 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
7019 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
7020 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7021 % and the contact line up
7022 \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
7023 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
7024 \pgfusepath{draw}
7025 \endpgfscope
7026 }
7027
7028 % current loop for oscope and similar: real (double connection)
7029 \pgfcircdeclarebipolescaled{instruments}
7030 {
7031 \anchor{i+}{
7032 \pgfextracty{\pgf@circ@res@up}{\northeast}
7033 \pgfextractx{\pgf@circ@res@right}{\northeast}
7034 \pgf@circ@res@step=0.4\pgf@circ@res@right
7035 \pgf@circ@res@other=0.8\pgf@circ@res@up
7036 \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
7037 \pgf@y=\pgf@circ@res@up
7038 }
7039 \anchor{i-}{
7040 \pgfextracty{\pgf@circ@res@up}{\northeast}
7041 \pgfextractx{\pgf@circ@res@right}{\northeast}
7042 \pgf@circ@res@step=0.4\pgf@circ@res@right
7043 \pgf@circ@res@other=0.8\pgf@circ@res@up
7044 \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
7045 \pgf@y=\pgf@circ@res@up
7046 }
7047 \anchor{text}{
7048 \pgfextracty{\pgf@circ@res@up}{\northeast}
7049 \pgfextractx{\pgf@circ@res@left}{\northeast}
7050 \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
7051 \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
7052 }
7053 }
7054 }
7055 {\ctikzvalof{bipoles/iloop/height}}
7056 {iloop2}
7057 {\ctikzvalof{bipoles/iloop/height}}
7058 {\ctikzvalof{bipoles/iloop/width}}
7059 {
7060 \pgfextracty{\pgf@circ@res@up}{\northeast}
7061 \pgfextractx{\pgf@circ@res@right}{\northeast}
7062 \pgf@circ@res@down=-\pgf@circ@res@up
7063 \pgf@circ@res@left=-\pgf@circ@res@right
7064 % must be the same than internal i+ and i- anchors definition
7065 \pgf@circ@res@step=0.4\pgf@circ@res@right
7066 \pgf@circ@res@other=0.8\pgf@circ@res@up
7067 \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
7068 \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
7069 \pgfscope
7070 \pgfstartlinewidth=\pgflinewidth
7071 \pgfsetcolor{\ctikzvalof{color}}
7072 % external ellipse
7073 \pgfscope
7074 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
7075 % clipping path: first a rectangle bigger then the shape
7076 % to avoid problems with the line thickness
7077 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
7078 {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
7079 % next the opening to the left
7080 \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
7081 {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
7082 % do the difference and clip before drawing
7083 \pgfseteorule
7084 \pgfusepath{clip}
7085 \pgfpathmoveto{\@plus}
7086 \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
7087 \pgfusepath{draw}
7088 \endpgfscope
7089 % internal wire
7090 \pgfsetlinewidth{\pgfstartlinewidth}
7091 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
7092 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
7093 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
7094 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7095 % and the contact line up
7096 % I use ...left and ---right as temporal lengths here to avoid defining more
7097 \pgfextractx{\pgf@circ@res@left}{\@plus}
7098 \pgfextractx{\pgf@circ@res@right}{\@minus}
7099 \pgfpathmoveto{\@plus}
7100 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
7101 \pgfpathmoveto{\@minus}
7102 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7103 \pgfusepath{draw}
7104 \endpgfscope
7105 }
7106
7107
7108 %% Varistor
7109 \pgfcircdeclarebipolescaled{resistors}
7110 {}
7111 {\ctikzvalof{bipoles/varistor/height}}
7112 {varistor}
7113 {\ctikzvalof{bipoles/varistor/height}}
7114 {\ctikzvalof{bipoles/varistor/width}}
7115 {
7116 \pgfscope
7117 \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}}
7118 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7119 \pgf@circ@draworfill
7120 \endpgfscope
7121
7122 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
7123 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
7124 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7125 \pgfusepath{draw}
7126
7127 \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}}
7128 }
7129
7130 %%%%%%%%%%%%%%
7131 %% RF bipoles
7132 %%%%%%%%%%%%%%
7133
7134 % transmission line
7135 \pgfcircdeclarebipolescaled{RF}
7136 {}
7137 {\ctikzvalof{bipoles/tline/height}}
7138 {tline}
7139 {\ctikzvalof{bipoles/tline/height}}
7140 {\ctikzvalof{bipoles/tline/width}}
7141 {
7142 \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
7143 \begin{pgftransparencygroup}
7144 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7145 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
7146 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
7147 \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
7148 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
7149 \pgf@circ@draworfill
7150 \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
7151 {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
7152 \pgf@circ@draworfill
7153 \end{pgftransparencygroup}
7154 \pgfsetlinewidth{\pgfstartlinewidth}
7155 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
7156 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
7157 \pgfusepath{stroke}
7158 }
7159
7160 % microstrip transmission line
7161 \pgfcircdeclarebipolescaled{RF}
7162 {}
7163 {\ctikzvalof{bipoles/mstline/height}}
7164 {mstline}
7165 {\ctikzvalof{bipoles/mstline/height}}
7166 {\ctikzvalof{bipoles/mstline/width}}
7167 {
7168 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7169 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7170 \pgf@circ@draworfill
7171 }
7172
7173 %%%%%%%%%%%%%%%%%%%
7174 %% Block diagrams
7175 %%%%%%%%%%%%%%%%%%%
7176
7177 %% Draw the two-port fillable box
7178 \def\pgf@circ@twoportbox{
7179 \pgfscope
7180 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7181 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
7182 \pgf@circ@draworfill
7183 \endpgfscope
7184 }
7185
7186 %% Generic two port box
7187 \pgfcircdeclarebipolescaled{blocks}
7188 {}
7189 {\ctikzvalof{bipoles/twoport/height}}
7190 {twoport}
7191 {\ctikzvalof{bipoles/twoport/height}}
7192 {\ctikzvalof{bipoles/twoport/width}}
7193 {
7194 \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
7195 \divide \pgf@circ@res@step by 2
7196
7197 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7198 \pgf@circ@res@other = \pgf@circ@res@left
7199 \advance\pgf@circ@res@other by \pgf@circ@res@step
7200 \ifpgf@circuit@dashed
7201 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7202 \fi
7203 % draw outer box
7204 \pgf@circ@twoportbox
7205 \ifpgf@circuit@inputarrow
7206 {
7207 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7208 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7209 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7210 }
7211 \fi
7212
7213 % rotate inner symbol
7214 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7215 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7216 \pgftransformrotate{270}
7217 \fi\fi
7218 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7219 \pgftransformrotate{180}
7220 \fi\fi
7221 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7222 \pgftransformrotate{90}
7223 \fi\fi
7224
7225 % draw inner symbol
7226 \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
7227
7228 }
7229
7230 %% voltage controled oscillator
7231 \pgfcircdeclarebipolescaled{blocks}
7232 {}
7233 {\ctikzvalof{bipoles/vco/width}}
7234 {vco}
7235 {\ctikzvalof{bipoles/twoport/width}}
7236 {\ctikzvalof{bipoles/vco/width}}
7237 {
7238 \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@scaled@Rlen
7239 \divide \pgf@circ@res@step by 2
7240
7241 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7242 \pgf@circ@res@other = \pgf@circ@res@left
7243 \advance\pgf@circ@res@other by \pgf@circ@res@step
7244
7245 \ifpgf@circuit@dashed
7246 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7247 \fi
7248 % draw circle
7249 \pgfscope
7250 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7251 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
7252 \pgf@circ@draworfill
7253 \endpgfscope
7254 \ifpgf@circuit@inputarrow
7255 {
7256 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7257 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7258 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7259 }
7260 \fi
7261
7262 % rotate inner symbol
7263 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7264 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7265 \pgftransformrotate{270}
7266 \fi\fi
7267 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7268 \pgftransformrotate{180}
7269 \fi\fi
7270 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7271 \pgftransformrotate{90}
7272 \fi\fi
7273
7274 % draw inner sine waves
7275 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7276 \pgfsetlinewidth{\pgfstartlinewidth}
7277 \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
7278 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7279 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7280 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7281 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7282 \pgfusepath{draw}
7283 }
7284
7285 %% bandpass filter
7286 \pgfcircdeclarebipolescaled{blocks}
7287 {}
7288 {\ctikzvalof{bipoles/bandpass/width}}
7289 {bandpass}
7290 {\ctikzvalof{bipoles/bandpass/width}}
7291 {\ctikzvalof{bipoles/bandpass/width}}
7292 {
7293
7294 \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@scaled@Rlen
7295 \divide \pgf@circ@res@step by 2
7296
7297 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7298 \pgf@circ@res@other = \pgf@circ@res@left
7299 \advance\pgf@circ@res@other by \pgf@circ@res@step
7300
7301 \ifpgf@circuit@dashed
7302 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7303 \fi
7304
7305 % draw outer box
7306 \pgf@circ@twoportbox
7307
7308 \ifpgf@circuit@inputarrow
7309 {
7310 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7311 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7312 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7313 }
7314 \fi
7315
7316 % rotate inner symbol
7317 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7318 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7319 \pgftransformrotate{270}
7320 \fi\fi
7321 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7322 \pgftransformrotate{180}
7323 \fi\fi
7324 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7325 \pgftransformrotate{90}
7326 \fi\fi
7327
7328 % draw inner symbol
7329 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7330 \pgfsetarrows{-} %never draw arrows
7331 \pgfsetlinewidth{\pgfstartlinewidth}
7332 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7333 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7334 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7335 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7336 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7337 \pgfusepath{draw}
7338 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
7339 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
7340 \pgfusepath{draw}
7341
7342 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7343 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7344 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7345 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7346 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7347 \pgfusepath{draw}
7348
7349 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7350 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7351 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7352 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7353 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7354 \pgfusepath{draw}
7355 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
7356 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
7357 \pgfusepath{draw}
7358 }
7359
7360 %% bandstop filter
7361 \pgfcircdeclarebipolescaled{blocks}
7362 {}
7363 {\ctikzvalof{bipoles/bandstop/width}}
7364 {bandstop}
7365 {\ctikzvalof{bipoles/bandstop/width}}
7366 {\ctikzvalof{bipoles/bandstop/width}}
7367 {
7368 \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@scaled@Rlen
7369 \divide \pgf@circ@res@step by 2
7370
7371 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7372 \pgf@circ@res@other = \pgf@circ@res@left
7373 \advance\pgf@circ@res@other by \pgf@circ@res@step
7374
7375 \ifpgf@circuit@dashed
7376 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7377 \fi
7378
7379 % draw outer box
7380 \pgf@circ@twoportbox
7381
7382 \ifpgf@circuit@inputarrow
7383 {
7384 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7385 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7386 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7387 }
7388 \fi
7389
7390 % rotate inner symbol
7391 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7392 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7393 \pgftransformrotate{270}
7394 \fi\fi
7395 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
7396 \pgftransformrotate{180}
7397 \fi\fi
7398 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7399 \pgftransformrotate{90}
7400 \fi\fi
7401
7402 % draw inner symbol
7403 \pgfsetdash{}{0pt}% always draw solid line for inner symbol
7404 \pgfsetarrows{-}%never draw arrows
7405 \pgfsetlinewidth{\pgfstartlinewidth}
7406 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7407 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7408 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7409 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7410 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7411 \pgfusepath{draw}
7412
7413 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7414 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7415 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7416 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7417 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7418 \pgfusepath{draw}
7419 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
7420 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
7421 \pgfusepath{draw}
7422
7423 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7424 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7425 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7426 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7427 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7428 \pgfusepath{draw}
7429 }
7430
7431 %% highpass filter
7432 \pgfcircdeclarebipolescaled{blocks}
7433 {}
7434 {\ctikzvalof{bipoles/highpass/width}}
7435 {highpass}
7436 {\ctikzvalof{bipoles/highpass/width}}
7437 {\ctikzvalof{bipoles/highpass/width}}
7438 {
7439 \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@scaled@Rlen
7440 \divide \pgf@circ@res@step by 2
7441
7442 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7443 \pgf@circ@res@other = \pgf@circ@res@left
7444 \advance\pgf@circ@res@other by \pgf@circ@res@step
7445
7446 \ifpgf@circuit@dashed
7447 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7448 \fi
7449
7450 % draw outer box
7451 \pgf@circ@twoportbox
7452
7453 \ifpgf@circuit@inputarrow
7454 {
7455 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7456 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7457 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7458 }
7459 \fi
7460
7461 % rotate inner symbol
7462 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7463 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7464 \pgftransformrotate{270}
7465 \fi\fi
7466 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7467 \pgftransformrotate{180}
7468 \fi\fi
7469 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7470 \pgftransformrotate{90}
7471 \fi\fi
7472
7473 % draw inner symbol
7474 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7475 \pgfsetarrows{-} %never draw arrows
7476 \pgfsetlinewidth{\pgfstartlinewidth}
7477 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7478 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7479 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7480 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7481 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7482 \pgfusepath{draw}
7483
7484 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7485 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7486 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7487 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7488 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7489 \pgfusepath{draw}
7490 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
7491 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
7492 \pgfusepath{draw}
7493
7494 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7495 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7496 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7497 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7498 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7499 \pgfusepath{draw}
7500 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
7501 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
7502 \pgfusepath{draw}
7503 }
7504
7505 %% lowpass filter
7506 \pgfcircdeclarebipolescaled{blocks}
7507 {}
7508 {\ctikzvalof{bipoles/lowpass/width}}
7509 {lowpass}
7510 {\ctikzvalof{bipoles/lowpass/width}}
7511 {\ctikzvalof{bipoles/lowpass/width}}
7512 {
7513 \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@scaled@Rlen
7514 \divide \pgf@circ@res@step by 2
7515
7516 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7517 \pgf@circ@res@other = \pgf@circ@res@left
7518 \advance\pgf@circ@res@other by \pgf@circ@res@step
7519
7520 \ifpgf@circuit@dashed
7521 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7522 \fi
7523
7524 % draw outer box
7525 \pgf@circ@twoportbox
7526
7527 \ifpgf@circuit@inputarrow
7528 {
7529 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7530 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7531 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7532 }
7533 \fi
7534
7535 % rotate inner symbol
7536 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7537 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7538 \pgftransformrotate{270}
7539 \fi\fi
7540 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7541 \pgftransformrotate{180}
7542 \fi\fi
7543 \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
7544 \pgftransformrotate{90}
7545 \fi\fi
7546
7547 % draw inner symbol
7548 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7549 \pgfsetarrows{-} %never draw arrows
7550 \pgfsetlinewidth{\pgfstartlinewidth}
7551 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
7552 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7553 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7554 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7555 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7556 \pgfusepath{draw}
7557 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
7558 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
7559 \pgfusepath{draw}
7560
7561 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
7562 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7563 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7564 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7565 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7566 \pgfusepath{draw}
7567 \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
7568 \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
7569 \pgfusepath{draw}
7570
7571 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7572 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7573 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7574 \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
7575 \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
7576 \pgfusepath{draw}
7577 }
7578
7579 %% ADC
7580 \pgfcircdeclarebipolescaled{blocks}
7581 {}
7582 {\ctikzvalof{bipoles/adc/width}}
7583 {adc}
7584 {\ctikzvalof{bipoles/adc/width}}
7585 {\ctikzvalof{bipoles/adc/width}}
7586 {
7587 \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@scaled@Rlen
7588 \divide \pgf@circ@res@step by 2
7589
7590 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7591 \pgf@circ@res@other = \pgf@circ@res@left
7592 \advance\pgf@circ@res@other by \pgf@circ@res@step
7593
7594 \ifpgf@circuit@dashed
7595 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7596 \fi
7597
7598 % draw outer box
7599 \pgf@circ@twoportbox
7600
7601 \ifpgf@circuit@inputarrow
7602 {
7603 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7604 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7605 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7606 }
7607 \fi
7608
7609 % rotate inner symbol
7610 \def\texti{A}
7611 \def\textii{D}
7612 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7613 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7614 \def\texti{D}
7615 \def\textii{A}
7616 \pgftransformrotate{270}
7617 \fi\fi
7618 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7619 \def\texti{D}
7620 \def\textii{A}
7621 \pgftransformrotate{180}
7622 \fi\fi
7623 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7624 \pgftransformrotate{90}
7625 \def\texti{A}
7626 \def\textii{D}
7627 \fi\fi
7628
7629 % draw inner symbol
7630 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7631 \pgfsetarrows{-} %never draw arrows
7632 \pgfsetlinewidth{\pgfstartlinewidth}
7633 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7634 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7635 \pgfusepath{draw}
7636
7637 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
7638 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
7639 }
7640
7641 %% DAC
7642 \pgfcircdeclarebipolescaled{blocks}
7643 {}
7644 {\ctikzvalof{bipoles/dac/width}}
7645 {dac}
7646 {\ctikzvalof{bipoles/dac/width}}
7647 {\ctikzvalof{bipoles/dac/width}}
7648 {
7649 \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@scaled@Rlen
7650 \divide \pgf@circ@res@step by 2
7651
7652 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7653 \pgf@circ@res@other = \pgf@circ@res@left
7654 \advance\pgf@circ@res@other by \pgf@circ@res@step
7655
7656 \ifpgf@circuit@dashed
7657 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7658 \fi
7659
7660 % draw outer box
7661 \pgf@circ@twoportbox
7662
7663 \ifpgf@circuit@inputarrow
7664 {
7665 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7666 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7667 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7668 }
7669 \fi
7670
7671 % rotate inner symbol
7672 \def\texti{D}
7673 \def\textii{A}
7674 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7675 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7676 \def\texti{A}
7677 \def\textii{D}
7678 \pgftransformrotate{270}
7679 \fi\fi
7680 \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
7681 \def\texti{A}
7682 \def\textii{D}
7683 \pgftransformrotate{180}
7684 \fi\fi
7685 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7686 \pgftransformrotate{90}
7687 \def\texti{D}
7688 \def\textii{A}
7689 \fi\fi
7690
7691 % draw inner symbol
7692 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7693 \pgfsetarrows{-} %never draw arrows
7694 \pgfsetlinewidth{\pgfstartlinewidth}
7695 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
7696 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
7697 \pgfusepath{draw}
7698
7699 \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
7700 \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
7701 }
7702
7703 %% DSP
7704 \pgfcircdeclarebipolescaled{blocks}
7705 {}
7706 {\ctikzvalof{bipoles/dsp/width}}
7707 {dsp}
7708 {\ctikzvalof{bipoles/dsp/width}}
7709 {\ctikzvalof{bipoles/dsp/width}}
7710 {
7711 \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@scaled@Rlen
7712 \divide \pgf@circ@res@step by 2
7713
7714 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7715 \pgf@circ@res@other = \pgf@circ@res@left
7716 \advance\pgf@circ@res@other by \pgf@circ@res@step
7717
7718 \ifpgf@circuit@dashed
7719 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7720 \fi
7721
7722 % draw outer box
7723 \pgf@circ@twoportbox
7724
7725 \ifpgf@circuit@inputarrow
7726 {
7727 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7728 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7729 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7730 }
7731 \fi
7732
7733 % rotate inner symbol
7734 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7735 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7736 \pgftransformrotate{270}
7737 \fi\fi
7738 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7739 \pgftransformrotate{180}
7740 \fi\fi
7741 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7742 \pgftransformrotate{90}
7743 \fi\fi
7744
7745 % draw inner symbol
7746 \pgftext[center,x=0,y=0]{\textsf{DSP}}
7747 }
7748
7749 %% FFT
7750 \pgfcircdeclarebipolescaled{blocks}
7751 {}
7752 {\ctikzvalof{bipoles/fft/width}}
7753 {fft}
7754 {\ctikzvalof{bipoles/fft/width}}
7755 {\ctikzvalof{bipoles/fft/width}}
7756 {
7757 \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@scaled@Rlen
7758 \divide \pgf@circ@res@step by 2
7759
7760 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7761 \pgf@circ@res@other = \pgf@circ@res@left
7762 \advance\pgf@circ@res@other by \pgf@circ@res@step
7763
7764 \ifpgf@circuit@dashed
7765 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7766 \fi
7767
7768 % draw outer box
7769 \pgf@circ@twoportbox
7770
7771 \ifpgf@circuit@inputarrow
7772 {
7773 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7774 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7775 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7776 }
7777 \fi
7778
7779 % rotate inner symbol
7780 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7781 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7782 \pgftransformrotate{270}
7783 \fi\fi
7784 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
7785 \pgftransformrotate{180}
7786 \fi\fi
7787 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7788 \pgftransformrotate{90}
7789 \fi\fi
7790
7791 % draw inner symbol
7792 \pgftext[center,x=0,y=0]{\textsf{FFT}}
7793 }
7794
7795 %% Amplifier
7796 \pgfcircdeclarebipolescaled{blocks}
7797 {}
7798 {
7799 \ifpgf@circuit@boxed
7800 \ctikzvalof{bipoles/twoport/width}
7801 \else
7802 \ctikzvalof{bipoles/amp/width}
7803 \fi
7804 }
7805 {amp}
7806 {
7807 \ifpgf@circuit@boxed
7808 \ctikzvalof{bipoles/twoport/width}
7809 \else
7810 \ctikzvalof{bipoles/amp/width}
7811 \fi
7812 }
7813 {
7814 \ifpgf@circuit@boxed
7815 \ctikzvalof{bipoles/twoport/width}
7816 \else
7817 \ctikzvalof{bipoles/amp/width}
7818 \fi
7819 }
7820 {
7821 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
7822
7823 \ifpgf@circuit@dashed
7824 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7825 \fi
7826
7827 % draw outer box
7828 \ifpgf@circuit@boxed
7829 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7830 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
7831 \pgf@circ@draworfill
7832 \fi
7833
7834 % draw input arrow
7835 \ifpgf@circuit@inputarrow
7836 {
7837 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7838 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7839 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7840 }
7841 \fi
7842
7843 \ifpgf@circuit@boxed
7844 \pgfsetlinewidth{\pgfstartlinewidth}
7845 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
7846 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
7847 \else
7848 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7849 \fi
7850
7851 \pgfsetarrows{-} %never draw arrows
7852
7853 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
7854 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
7855 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
7856
7857 \pgfpathclose
7858 \pgf@circ@draworfill
7859
7860 % draw inner text
7861 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
7862 }
7863
7864
7865 %% variable amplifier
7866 \pgfcircdeclarebipolescaled{blocks}
7867 {}
7868 {
7869 \ifpgf@circuit@boxed
7870 \ctikzvalof{bipoles/twoport/width}
7871 \else
7872 \ctikzvalof{bipoles/amp/width}
7873 \fi
7874 }
7875 {vamp}
7876 {
7877 \ifpgf@circuit@boxed
7878 \ctikzvalof{bipoles/twoport/width}
7879 \else
7880 \ctikzvalof{bipoles/amp/width}
7881 \fi
7882 }
7883 {
7884 \ifpgf@circuit@boxed
7885 \ctikzvalof{bipoles/twoport/width}
7886 \else
7887 \ctikzvalof{bipoles/amp/width}
7888 \fi
7889 }
7890 {
7891 \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen
7892
7893 \ifpgf@circuit@dashed
7894 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7895 \fi
7896
7897 % draw outer box
7898 \ifpgf@circuit@boxed
7899 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
7900 \fi
7901
7902 % draw input arrow
7903 \ifpgf@circuit@inputarrow
7904 {
7905 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7906 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7907 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7908 }
7909 \fi
7910
7911 \ifpgf@circuit@boxed
7912 \pgfsetlinewidth{\pgfstartlinewidth}
7913 \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
7914 \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box
7915 \else
7916 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
7917 \fi
7918
7919
7920 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7921 \pgfsetarrows{-} %never draw arrows
7922
7923 \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
7924 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}}
7925 \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}}
7926
7927 \pgfpathclose
7928 \pgf@circ@draworfill
7929
7930 % draw inner text
7931 \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
7932
7933 % draw arrow
7934 \pgfsetlinewidth{\pgfstartlinewidth}
7935 \pgfsetarrowsend{latex}
7936 \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
7937 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
7938 \pgfusepath{draw}
7939 }
7940
7941 %% pi attenuator
7942 \pgfcircdeclarebipolescaled{blocks}
7943 {}
7944 {\ctikzvalof{bipoles/piattenuator/width}}
7945 {piattenuator}
7946 {\ctikzvalof{bipoles/piattenuator/width}}
7947 {\ctikzvalof{bipoles/piattenuator/width}}
7948 {
7949 \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@scaled@Rlen
7950 \divide \pgf@circ@res@step by 2
7951
7952 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
7953 \pgf@circ@res@other = \pgf@circ@res@left
7954 \advance\pgf@circ@res@other by \pgf@circ@res@step
7955
7956 \ifpgf@circuit@dashed
7957 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
7958 \fi
7959
7960 % draw outer box
7961 \pgf@circ@twoportbox
7962
7963 \ifpgf@circuit@inputarrow
7964 {
7965 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
7966 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
7967 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
7968 }
7969 \fi
7970
7971 % rotate inner symbol
7972 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
7973 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
7974 \pgftransformrotate{270}
7975 \fi\fi
7976 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
7977 \pgftransformrotate{90}
7978 \fi\fi
7979
7980 % draw inner symbol
7981 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
7982 \pgfsetarrows{-} %never draw arrows
7983 \pgfsetlinewidth{\pgfstartlinewidth}
7984 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
7985 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7986 \pgfusepath{draw}
7987 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
7988 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7989 \pgfusepath{draw}
7990 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
7991 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
7992 \pgfusepath{draw}
7993 }
7994
7995 %% variable pi attenuator
7996 \pgfcircdeclarebipolescaled{blocks}
7997 {}
7998 {\ctikzvalof{bipoles/vpiattenuator/width}}
7999 {vpiattenuator}
8000 {\ctikzvalof{bipoles/vpiattenuator/width}}
8001 {\ctikzvalof{bipoles/vpiattenuator/width}}
8002 {
8003 \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@scaled@Rlen
8004 \divide \pgf@circ@res@step by 2
8005
8006 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8007 \pgf@circ@res@other = \pgf@circ@res@left
8008 \advance\pgf@circ@res@other by \pgf@circ@res@step
8009
8010 \ifpgf@circuit@dashed
8011 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8012 \fi
8013
8014 % draw outer box
8015 \pgf@circ@twoportbox
8016
8017 \ifpgf@circuit@inputarrow
8018 {
8019 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8020 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8021 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8022 }
8023 \fi
8024
8025 % rotate inner symbol
8026 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8027 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8028 \pgftransformrotate{270}
8029 \fi\fi
8030 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8031 \pgftransformrotate{90}
8032 \fi\fi
8033
8034 % draw inner symbol
8035 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8036 \pgfsetarrows{-} %never draw arrows
8037 \pgfsetlinewidth{\pgfstartlinewidth}
8038 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
8039 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8040 \pgfusepath{draw}
8041 \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
8042 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8043 \pgfusepath{draw}
8044 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8045 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8046 \pgfusepath{draw}
8047
8048 \pgfsetarrowsend{latex}
8049 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
8050 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
8051 \pgfusepath{draw}
8052 }
8053
8054 %% T attenuator
8055 \pgfcircdeclarebipolescaled{blocks}
8056 {}
8057 {\ctikzvalof{bipoles/tattenuator/width}}
8058 {tattenuator}
8059 {\ctikzvalof{bipoles/tattenuator/width}}
8060 {\ctikzvalof{bipoles/tattenuator/width}}
8061 {
8062 \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@scaled@Rlen
8063 \divide \pgf@circ@res@step by 2
8064
8065 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8066 \pgf@circ@res@other = \pgf@circ@res@left
8067 \advance\pgf@circ@res@other by \pgf@circ@res@step
8068
8069 \ifpgf@circuit@dashed
8070 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8071 \fi
8072
8073 % draw outer box
8074 \pgf@circ@twoportbox
8075
8076 \ifpgf@circuit@inputarrow
8077 {
8078 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8079 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8080 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8081 }
8082 \fi
8083
8084 % rotate inner symbol
8085 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8086 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8087 \pgftransformrotate{270}
8088 \fi\fi
8089 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8090 \pgftransformrotate{90}
8091 \fi\fi
8092
8093 % draw inner symbol
8094 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8095 \pgfsetarrows{-} %never draw arrows
8096 \pgfsetlinewidth{\pgfstartlinewidth}
8097 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
8098 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
8099 \pgfusepath{draw}
8100 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8101 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8102 \pgfusepath{draw}
8103 }
8104
8105 %% variable T attenuator
8106 \pgfcircdeclarebipolescaled{blocks}
8107 {}
8108 {\ctikzvalof{bipoles/vtattenuator/width}}
8109 {vtattenuator}
8110 {\ctikzvalof{bipoles/vtattenuator/width}}
8111 {\ctikzvalof{bipoles/vtattenuator/width}}
8112 {
8113 \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@scaled@Rlen
8114 \divide \pgf@circ@res@step by 2
8115
8116 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8117 \pgf@circ@res@other = \pgf@circ@res@left
8118 \advance\pgf@circ@res@other by \pgf@circ@res@step
8119
8120 \ifpgf@circuit@dashed
8121 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8122 \fi
8123
8124 % draw outer box
8125 \pgf@circ@twoportbox
8126
8127 \ifpgf@circuit@inputarrow
8128 {
8129 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8130 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8131 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8132 }
8133 \fi
8134
8135 % rotate inner symbol
8136 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8137 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8138 \pgftransformrotate{270}
8139 \fi\fi
8140 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8141 \pgftransformrotate{90}
8142 \fi\fi
8143
8144 % draw inner symbol
8145 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8146 \pgfsetarrows{-} %never draw arrows
8147 \pgfsetlinewidth{\pgfstartlinewidth}
8148 \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
8149 \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
8150 \pgfusepath{draw}
8151 \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
8152 \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
8153 \pgfusepath{draw}
8154
8155 \pgfsetarrowsend{latex}
8156 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
8157 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
8158 \pgfusepath{draw}
8159 }
8160
8161 %% phase shifter
8162 \pgfcircdeclarebipolescaled{blocks}
8163 {}
8164 {\ctikzvalof{bipoles/phaseshifter/width}}
8165 {phaseshifter}
8166 {\ctikzvalof{bipoles/phaseshifter/width}}
8167 {\ctikzvalof{bipoles/phaseshifter/width}}
8168 {
8169 \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@scaled@Rlen
8170 \divide \pgf@circ@res@step by 2
8171
8172 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8173 \pgf@circ@res@other = \pgf@circ@res@left
8174 \advance\pgf@circ@res@other by \pgf@circ@res@step
8175
8176 \ifpgf@circuit@dashed
8177 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8178 \fi
8179
8180 % draw outer box
8181 \pgf@circ@twoportbox
8182
8183 \ifpgf@circuit@inputarrow
8184 {
8185 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8186 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8187 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8188 }
8189 \fi
8190
8191 % rotate inner symbol
8192 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8193 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8194 \pgftransformrotate{270}
8195 \fi\fi
8196 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8197 \pgftransformrotate{180}
8198 \fi\fi
8199 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8200 \pgftransformrotate{90}
8201 \fi\fi
8202
8203 % inner symbol
8204 \pgftext[center,x=0,y=0]{\Large$\varphi$}
8205 }
8206
8207 %% variable phase shifter
8208 \pgfcircdeclarebipolescaled{blocks}
8209 {}
8210 {\ctikzvalof{bipoles/phaseshifter/width}}
8211 {vphaseshifter}
8212 {\ctikzvalof{bipoles/vphaseshifter/width}}
8213 {\ctikzvalof{bipoles/vphaseshifter/width}}
8214 {
8215 \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@scaled@Rlen
8216 \divide \pgf@circ@res@step by 2
8217
8218 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8219 \pgf@circ@res@other = \pgf@circ@res@left
8220 \advance\pgf@circ@res@other by \pgf@circ@res@step
8221
8222 \ifpgf@circuit@dashed
8223 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8224 \fi
8225
8226 % draw outer box
8227 \pgf@circ@twoportbox
8228
8229 \ifpgf@circuit@inputarrow
8230 {
8231 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8232 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8233 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8234 }
8235 \fi
8236
8237 % rotate inner symbol
8238 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
8239 \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
8240 \pgftransformrotate{270}
8241 \fi\fi
8242 \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
8243 \pgftransformrotate{180}
8244 \fi\fi
8245 \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
8246 \pgftransformrotate{90}
8247 \fi\fi
8248
8249 % inner symbol
8250 \pgftext[center,x=0,y=0]{\Large$\varphi$}
8251
8252 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8253 \pgfsetlinewidth{\pgfstartlinewidth}
8254 \pgfsetarrowsend{latex}
8255 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
8256 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
8257 \pgfusepath{draw}
8258 }
8259
8260 %% detector
8261 \pgfcircdeclarebipolescaled{blocks}
8262 {}
8263 {\ctikzvalof{bipoles/detector/width}}
8264 {detector}
8265 {\ctikzvalof{bipoles/detector/width}}
8266 {\ctikzvalof{bipoles/detector/width}}
8267 {
8268 \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@scaled@Rlen
8269 \divide \pgf@circ@res@step by 2
8270
8271 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8272 \pgf@circ@res@other = \pgf@circ@res@left
8273 \advance\pgf@circ@res@other by \pgf@circ@res@step
8274
8275 \ifpgf@circuit@dashed
8276 \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
8277 \fi
8278
8279 % draw outer box
8280 \pgf@circ@twoportbox
8281
8282 \ifpgf@circuit@inputarrow
8283 {
8284 \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
8285 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8286 \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
8287 }
8288 \fi
8289
8290 % draw inner stuff
8291 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
8292 \pgfsetarrows{-} %never draw arrows
8293 \pgfsetlinewidth{0.8\pgfstartlinewidth}
8294 \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
8295 \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
8296 \pgfusepath{draw}
8297
8298 \ifpgf@circuit@fulldiode
8299 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width}}
8300 \pgftransformscale{\pgfmathresult}
8301 \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
8302 \else
8303 \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width}}
8304 \pgftransformscale{\pgfmathresult}
8305 \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
8306 \fi
8307
8308 }
8309
8310 %%%%%%%%%%%%%%%%%%%%%%%
8311 %% MECHANICAL SYMBOLS
8312 %%%%%%%%%%%%%%%%%%%%%%%
8313
8314 %% mechanical capacitance - stiffness/spring
8315
8316 \pgfcircdeclarebipolescaled{mechanicals}
8317 {}
8318 {\ctikzvalof{bipoles/spring/height}}
8319 {spring}
8320 {\ctikzvalof{bipoles/spring/height}}
8321 {\ctikzvalof{bipoles/spring/width}}{
8322 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8323 \pgftransformationadjustments
8324
8325 \pgfmathsetlength{\pgf@circ@res@step}
8326 {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@scaled@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
8327
8328 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
8329 \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
8330 \pgf@circ@res@other = \pgf@circ@res@left
8331 \advance\pgf@circ@res@other by \pgf@circ@res@step
8332 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8333 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8334 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8335 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8336 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8337 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8338 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8339 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8340 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8341 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8342 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8343 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8344 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
8345 \advance\pgf@circ@res@other by 2\pgf@circ@res@step
8346 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
8347 \advance\pgf@circ@res@other by \pgf@circ@res@step
8348 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
8349 \pgfsetbuttcap
8350 \pgfsetbeveljoin
8351 \pgfusepath{stroke}
8352 }
8353
8354 %% mechanical inductance - mass
8355 \pgfcircdeclarebipolescaled{mechanicals}
8356 {}
8357 {\ctikzvalof{bipoles/mass/box height}}
8358 {mass}
8359 {\ctikzvalof{bipoles/mass/height}}
8360 {\ctikzvalof{bipoles/mass/width}}
8361 {
8362 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8363 \pgftransformationadjustments
8364 \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8365 {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
8366 \pgf@circ@draworfill
8367
8368 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8369 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8370 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8371 \pgfsetrectcap
8372 \pgfsetmiterjoin
8373 \pgfusepath{stroke}
8374 }
8375
8376 %% mechanical resistor - damper
8377 \pgfcircdeclarebipolescaled{mechanicals}
8378 {}
8379 {\ctikzvalof{bipoles/damper/height}}
8380 {damper}
8381 {\ctikzvalof{bipoles/damper/height}}
8382 {\ctikzvalof{bipoles/damper/width}}
8383 {
8384 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8385 \pgf@circ@maybefill
8386
8387 % line into the damper
8388 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8389 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8390 {\pgf@circ@res@zero}}
8391 \pgfusepath{stroke}
8392
8393 % damper box
8394 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8395 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8396 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8397 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8398 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8399
8400 \pgfsetrectcap
8401 \pgfsetmiterjoin
8402 \pgfusepath{stroke}
8403
8404 % damper vertical element
8405 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8406 {.8\pgf@circ@res@down}}
8407 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8408 {.8\pgf@circ@res@up}}
8409 \pgfsetbuttcap
8410 \pgfusepath{stroke}
8411
8412 }
8413 %% mechanical viscoelastic element, suggested by @alex
8414 %% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
8415 \pgfcircdeclarebipolescaled{mechanicals}
8416 {} % extra anchors
8417 {\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
8418 {viscoe} % name
8419 {\ctikzvalof{bipoles/damper/height}} % height (above the path line)
8420 {\ctikzvalof{bipoles/damper/width}} % width
8421 { % draw the bipole
8422 \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8423 \pgf@circ@maybefill
8424
8425 % spring into the damper
8426 \pgfscope
8427 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8428 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8429 \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
8430 \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
8431 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
8432 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
8433 \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
8434 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
8435 \pgfusepath{stroke}
8436 \endpgfscope
8437 % damper box
8438 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8439 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
8440 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8441 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8442 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
8443
8444 \pgfsetrectcap
8445 \pgfsetmiterjoin
8446 \pgfusepath{stroke}
8447
8448 % damper vertical element
8449 \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8450 {.8\pgf@circ@res@down}}
8451 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
8452 {.8\pgf@circ@res@up}}
8453 \pgfsetbuttcap
8454 \pgfusepath{stroke}
8455
8456 }
8457
8458 %%%%%%%%%%%%%%%%
8459 %% Crossing
8460 %%%%%%%%%%%%%%%%
8461
8462 %% crossing bipole (but see also nodes)
8463 \pgfcircdeclarebipole
8464 {}
8465 {\ctikzvalof{bipoles/crossing/size}}
8466 {crossing}
8467 {\ctikzvalof{bipoles/crossing/size}}
8468 {\ctikzvalof{bipoles/crossing/size}}{
8469 \pgfscope
8470 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8471 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
8472 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
8473 \pgfsetbeveljoin
8474 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
8475 \pgfusepath{draw}
8476 \endpgfscope
8477 }
8478
8479 %%%%%%%%%%%%%%%%%%%%%%%%%
8480 %% Miscellaneous bipoles
8481 %%%%%%%%%%%%%%%%%%%%%%%%%
8482
8483 %% loudspeaker and microphone
8484
8485 \pgfcircdeclarebipolescaled{misc}
8486 {}
8487 {\ctikzvalof{bipoles/loudspeaker/depth}}
8488 {loudspeaker}
8489 {\ctikzvalof{bipoles/loudspeaker/height}}
8490 {\ctikzvalof{bipoles/loudspeaker/width}}{
8491
8492 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
8493 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8494 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
8495 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
8496 \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
8497 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
8498 \pgfpathclose
8499 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8500 \pgf@circ@draworfill
8501 }
8502
8503 \pgfcircdeclarebipolescaled{misc}
8504 {}
8505 {\ctikzvalof{bipoles/mic/depth}}
8506 {mic}
8507 {\ctikzvalof{bipoles/mic/height}}
8508 {\ctikzvalof{bipoles/mic/width}}{
8509
8510 \pgfscope
8511 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8512 \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
8513 \pgf@circ@draworfill
8514 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
8515 \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
8516 \pgfusepath{draw}
8517 \endpgfscope
8518 \pgfscope
8519 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8520 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
8521 % 0.25358 is 0.6-0.4*cos(30)
8522 \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
8523 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
8524 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
8525 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
8526 \pgfusepath{draw}
8527
8528 \pgfusepath{draw}
8529 \endpgfscope
8530 }
8531
8532 %% european gas filled surge arrester
8533 \pgfcircdeclarebipolescaled{misc}
8534 {}
8535 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
8536 {european gas filled surge arrester}
8537 {\ctikzvalof{bipoles/european gas filled surge arrester/height}}
8538 {\ctikzvalof{bipoles/european gas filled surge arrester/width}}
8539 {
8540
8541 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8542 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8543
8544 \pgf@circ@draworfill
8545
8546 \pgfscope
8547 \pgfsetarrowsend{latexslim}
8548 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8549 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
8550 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8551 \pgfusepath{draw}
8552
8553 \endpgfscope
8554 }
8555
8556 %% american gas filled surge arrester
8557 \pgfcircdeclarebipolescaled{misc}
8558 {}
8559 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
8560 {american gas filled surge arrester}
8561 {\ctikzvalof{bipoles/american gas filled surge arrester/height}}
8562 {\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
8563
8564 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8565 \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
8566 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
8567 \pgfusepath{draw}
8568
8569 \pgfscope
8570 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8571 \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
8572 \pgf@circ@draworfill
8573 \endpgfscope
8574
8575 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
8576 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
8577 \pgfusepath{draw}
8578
8579 \pgfscope
8580 \pgfsetarrowsend{latex}
8581
8582 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
8583 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
8584 \pgfusepath{draw}
8585
8586 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8587 \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
8588 \pgfusepath{draw}
8589 \endpgfscope{}
8590
8591 \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}
8592 \pgfusepath{fill}
8593 }
8594
8595 %% thermocouple
8596 \pgfcircdeclarebipolescaled{misc}
8597 {}
8598 {\ctikzvalof{bipoles/thermocouple/height 2}}
8599 {thermocouple}
8600 {\ctikzvalof{bipoles/thermocouple/height}}
8601 {\ctikzvalof{bipoles/thermocouple/width}}
8602 {
8603 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
8604 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
8605 \pgfusepath{draw}
8606 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
8607 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8608 \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
8609 \pgfusepath{draw}
8610 \pgfsetlinewidth{\pgfstartlinewidth}
8611 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
8612 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
8613 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
8614 \pgfusepath{draw}
8615 }
8616
8617 %% fuse
8618 \pgfcircdeclarebipolescaled{misc}
8619 {}
8620 {\ctikzvalof{bipoles/fuse/height}}
8621 {fuse}
8622 {\ctikzvalof{bipoles/fuse/height}}
8623 {\ctikzvalof{bipoles/fuse/width}}
8624 {
8625 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
8626 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
8627 \pgfusepath{draw}
8628
8629 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8630 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8631
8632 \pgf@circ@draworfill
8633 }
8634
8635 %% asymmetric fuse
8636 \pgfcircdeclarebipolescaled{misc}
8637 {}
8638 {\ctikzvalof{bipoles/afuse/height}}
8639 {afuse}
8640 {\ctikzvalof{bipoles/afuse/height}}
8641 {\ctikzvalof{bipoles/afuse/width}}
8642 {
8643 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
8644 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
8645 \pgfusepath{draw}
8646
8647 \pgfscope
8648 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8649 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8650 \pgf@circ@draworfill
8651 \endpgfscope
8652
8653 \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8654 \pgfusepath{stroke,fill}
8655 }
8656
8657 %% SQUID added by Cor Molenaar 5 March 2010
8658 \pgfcircdeclarebipolescaled{misc}
8659 {}
8660 {\ctikzvalof{bipoles/squid/height}}
8661 {squid}
8662 {\ctikzvalof{bipoles/squid/height}}
8663 {\ctikzvalof{bipoles/squid/width}}
8664 {
8665 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8666
8667 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
8668 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
8669 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
8670 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
8671 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
8672 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
8673 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
8674 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
8675 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
8676
8677 \pgfusepath{draw}
8678 }
8679
8680 % Generic barrier added by Cor Molenaar 5 March 2010
8681 \pgfcircdeclarebipolescaled{misc}
8682 {}
8683 {\ctikzvalof{bipoles/barrier/height}}
8684 {barrier}
8685 {\ctikzvalof{bipoles/barrier/height}}
8686 {\ctikzvalof{bipoles/barrier/width}}
8687 {
8688 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8689
8690 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
8691 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
8692 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
8693 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
8694 \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
8695 \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
8696
8697 \pgfusepath{draw}
8698 }
8699
8700 %% Lamp
8701 \pgfcircdeclarebipolescaled{misc}
8702 {}
8703 {\ctikzvalof{bipoles/lamp/height}}
8704 {lamp}
8705 {\ctikzvalof{bipoles/lamp/height}}
8706 {\ctikzvalof{bipoles/lamp/width}}
8707 {
8708 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8709
8710 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
8711 \pgf@circ@draworfill
8712 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
8713 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
8714 \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
8715 \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
8716 \pgfusepath{draw}
8717 }
8718
8719 %% bulb
8720 \pgfcircdeclarebipolescaled{misc}
8721 {}
8722 {\ctikzvalof{bipoles/bulb/height}}
8723 {bulb}
8724 {\ctikzvalof{bipoles/bulb/height}}
8725 {\ctikzvalof{bipoles/bulb/width}}
8726 {%
8727 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
8728 \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
8729 \pgf@circ@draworfill
8730 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
8731 \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
8732 \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
8733 \pgfsetbeveljoin
8734 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
8735 \pgfusepath{draw}
8736 }
8737
8738
8739 % end of pgfcircbipoles.tex
8740 %%%---------- close: tex/pgfcircbipoles
8741 %%%%%%%%%%% Springe nach tex/pgfcirctripoles
8742 %%%---------- open: tex/pgfcirctripoles.tex
8743 % Copyright 2007-2009 by Massimo Redaelli
8744 %
8745 % This file may be distributed and/or modified
8746 %
8747 % 1. under the LaTeX Project Public License and/or
8748 % 2. under the GNU Public License.
8749 %
8750 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
8751
8752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8753 %% Tripoles
8754
8755 %%%%%%%%%%%%%
8756 %% switches
8757 %%%%%%%%%%%%%
8758
8759 % Legacy spdt
8760 \pgfdeclareshape{spdt}{
8761 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
8762 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
8763 \savedanchor\northwest{%
8764 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
8765 \pgf@y=\ctikzvalof{tripoles/spdt/height}\pgf@circ@scaled@Rlen
8766 \pgf@y=.5\pgf@y
8767 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
8768 \pgf@x=.5\pgf@x
8769 }
8770 \anchor{left}{%
8771 \northwest
8772 \pgf@y=0pt
8773 }
8774 \anchor{in}{
8775 \northwest
8776 \pgf@y=0pt
8777 }
8778 \anchor{out 1}{
8779 \northwest
8780 \pgf@x=-\pgf@x
8781 }
8782 \anchor{out 2}{
8783 \northwest
8784 \pgf@x=-\pgf@x
8785 \pgf@y=-\pgf@y
8786 }
8787 \anchor{center}{
8788 \pgf@y=0pt
8789 \pgf@x=0pt
8790 }
8791 \anchor{east}{
8792 \northwest
8793 \pgf@y=0pt
8794 \pgf@x=-\pgf@x
8795 }
8796 \anchor{west}{
8797 \northwest
8798 \pgf@y=0pt
8799 }
8800 \anchor{south}{
8801 \northwest
8802 \pgf@x=0pt
8803 \pgf@y=-\pgf@y
8804 }
8805 \anchor{north}{
8806 \northwest
8807 \pgf@x=0pt
8808 }
8809 \anchor{south west}{
8810 \northwest
8811 \pgf@y=-\pgf@y
8812 }
8813 \anchor{north east}{
8814 \northwest
8815 \pgf@x=-\pgf@x
8816 }
8817 \anchor{north west}{
8818 \northwest
8819 }
8820 \anchor{south east}{
8821 \northwest
8822 \pgf@x=-\pgf@x
8823 \pgf@y=-\pgf@y
8824 }
8825 \backgroundpath{
8826 \pgfsetcolor{\ctikzvalof{color}}
8827
8828 \northwest
8829 \pgf@circ@res@up = \pgf@y
8830 \pgf@circ@res@down = -\pgf@y
8831 \pgf@circ@res@right = -\pgf@x
8832 \pgf@circ@res@left = \pgf@x
8833 \pgf@circ@res@other = \ctikzvalof{tripoles/spdt/margin}\pgf@circ@res@left
8834
8835
8836 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8837 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8838 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8839 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8840
8841 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8842 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
8843
8844 \pgfusepath{draw}
8845
8846 \pgfscope
8847 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
8848 \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
8849 \endpgfscope
8850 \pgfscope
8851 \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
8852 \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
8853 \endpgfscope
8854 \pgfscope
8855 \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
8856 \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
8857 \endpgfscope
8858
8859 \pgfscope
8860 \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
8861 \pgfpathlineto{
8862 \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
8863 {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
8864 }
8865 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
8866 \pgfusepath{draw}
8867 \endpgfscope
8868 }
8869 }
8870
8871
8872 % cute switch "node" shapes, matching with cute "to" shapes
8873 % #1 -> name
8874 % #2 -> barposition
8875 % #3 -> arrowcode
8876 \long\def\pgfcircdeclarecutespdt#1#2#3{
8877 \pgfdeclareshape{#1}
8878 {
8879 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
8880 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
8881 \savedanchor\northwest{%
8882 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
8883 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
8884 \pgf@y=.5\pgf@y
8885 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
8886 \pgf@x=.25\pgf@x
8887 }
8888 \savedanchor\midlever{
8889 % these values are calculated when we create the definition of the shape.
8890 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
8891 \pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen
8892 \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
8893 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
8894 \pgf@circ@res@down = -.5\pgf@y
8895 \pgf@circ@res@up = .5\pgf@y
8896 \pgfextracty{\pgf@circ@res@other}{#2}
8897 \pgf@x=0pt
8898 \pgf@y=.5\pgf@circ@res@other
8899 }
8900 % radius of the connector
8901 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
8902 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
8903 % shapename
8904 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
8905 % shape type
8906 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
8907 % mid of the lever, to stack switches
8908 \anchor{mid}{\midlever}
8909 % center anchors
8910 \anchor{cin}{ \northwest \pgf@y=0pt}
8911 \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
8912 \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
8913 % horizontal angles
8914 \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
8915 \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
8916 \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
8917
8918 \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
8919 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
8920 \anchor{west}{ \northwest \pgf@y=0pt }
8921 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
8922 \anchor{north}{ \northwest \pgf@x=0pt }
8923 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
8924 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
8925 \anchor{north west}{ \northwest }
8926 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
8927
8928 \backgroundpath{
8929 \pgfsetcolor{\ctikzvalof{color}}
8930 \northwest
8931 \pgf@circ@res@up = \pgf@y
8932 \pgf@circ@res@down = -\pgf@y
8933 \pgf@circ@res@right = -\pgf@x
8934 \pgf@circ@res@left = \pgf@x
8935
8936 \pgfscope
8937 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
8938 \pgf@circ@res@temp=\radius\relax
8939 \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
8940 \pgfsetlinewidth{2\pgf@circ@res@temp}
8941 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
8942 \pgfpathlineto{#2}
8943 \pgfsetroundcap\pgfusepath{draw}
8944 \endpgfscope
8945 \pgfscope % arrow
8946 #3
8947 \endpgfscope
8948 % terminals
8949 \pgfscope
8950 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
8951 \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
8952 \endpgfscope
8953 \pgfscope
8954 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
8955 \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
8956 \endpgfscope
8957 \pgfscope
8958 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
8959 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
8960 \endpgfscope
8961
8962 }
8963 }
8964 }
8965
8966 \pgfcircdeclarecutespdt{cute spdt up}
8967 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
8968 {}
8969
8970 \pgfcircdeclarecutespdt{cute spdt mid}
8971 {\pgfpoint{\pgf@circ@res@right}{0pt}}
8972 {}
8973
8974 \pgfcircdeclarecutespdt{cute spdt down}
8975 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
8976 {}
8977
8978 \pgfcircdeclarecutespdt{cute spdt up arrow}
8979 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}}
8980 {
8981 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
8982 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8983 \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
8984 \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
8985 \pgfsetarrowsend{latexslim}
8986 \pgfusepath{draw}
8987 }
8988
8989 \pgfcircdeclarecutespdt{cute spdt mid arrow}
8990 {\pgfpoint{\pgf@circ@res@right}{0pt}}
8991 {
8992 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
8993 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
8994 \pgfsetarrowsstart{latexslim}
8995 \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
8996 \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
8997 \pgfsetarrowsend{latexslim}
8998 \pgfusepath{draw}
8999 }
9000
9001 \pgfcircdeclarecutespdt{cute spdt down arrow}
9002 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
9003 {
9004 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
9005 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
9006 \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
9007 \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
9008 \pgfsetarrowsend{latexslim}
9009 \pgfusepath{draw}
9010 }
9011
9012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9014 %%
9015 %% Logic ports
9016 %%
9017 %% Code from John Kormylo at tex.stackexchange.com
9018 %% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
9019 %% Integration and fixes from Romano Giannetti and TheTeXnician <[email protected]>
9020 %%
9021
9022 \newcount\pgf@circ@res@count% reserve global register
9023
9024 \def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
9025 {%
9026 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9027 \step
9028 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9029 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9030 }%
9031
9032 % #1 = \pgfmathcounter #2=type #3 specificic port
9033 % type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
9034 \def\pgf@circ@logicport@baseinput#1#2#3%
9035 {%
9036 % and and nand
9037 \ifnum #2=1\relax
9038 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9039 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9040 \step
9041 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9042 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9043 \pgf@x=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@left
9044 \fi
9045 % or and nor
9046 \ifnum #2=2\relax
9047 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9048 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9049 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9050 \step
9051 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9052 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9053 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american #3 port/angle}}%
9054 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
9055 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9056 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9057 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
9058 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9059 \pgf@circ@res@temp=\pgf@y
9060 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9061 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9062 \pgf@x=\pgf@circ@res@other
9063 \fi
9064 % xor and xnor
9065 \ifnum #2=3\relax
9066 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9067 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9068 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9069 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
9070 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/inner}\pgf@circ@res@right
9071 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9072 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9073 \pgf@circ@res@other=\ctikzvalof{tripoles/american #3 port/port width}\pgf@circ@res@right
9074 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9075 \pgf@circ@res@temp=\ctikzvalof{tripoles/american #3 port/distance}\pgf@circ@res@right
9076 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9077 % this compensates for the effect of the line width on the gap between the arcs
9078 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9079 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9080
9081 \step
9082 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9083 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9084 \pgf@circ@res@temp=\pgf@y
9085 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9086 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9087 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9088 \pgf@x=\pgf@circ@res@other
9089 \fi
9090 % european
9091 \ifnum #2=4\relax
9092 \pgfextracty{\pgf@circ@res@up}{\northeast}%
9093 \pgfextractx{\pgf@circ@res@other}{\left}%
9094 \step
9095 \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
9096 \advance\pgf@y by -#1\pgf@circ@res@step\relax
9097 \pgf@x=\pgf@circ@res@other
9098 \fi
9099 }%
9100
9101 %%% american
9102 \long\def\pgfcircdeclarelogicport#1#2#3{%
9103 \pgfdeclareshape{american #1 port}%
9104 {%
9105 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9106 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9107 \savedmacro\resize{% automatic
9108 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9109 \pgf@circ@res@up = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
9110 \pgf@circ@res@up = .5\pgf@circ@res@up
9111 \pgf@circ@res@down = -\pgf@circ@res@up
9112 \pgf@circ@res@right = \ctikzvalof{tripoles/american #1 port/width}\pgf@circ@scaled@Rlen
9113 \pgf@circ@res@right = .5\pgf@circ@res@right
9114 \pgf@circ@res@left = -\pgf@circ@res@right
9115 }%
9116 \savedmacro\inputs{% get number of inputs
9117 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
9118 \ifnum\pgf@circ@res@count=0
9119 \pgf@circ@res@count=\ctikzvalof{tripoles/american #1 port/inputs}\relax%
9120 \fi
9121 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
9122 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
9123 \def\inputs{\the\pgf@circ@res@count}%
9124 }%
9125 \savedanchor\step{% 1/2 gap at edges
9126 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9127 \pgf@circ@res@step = \ctikzvalof{tripoles/american #1 port/height}\pgf@circ@scaled@Rlen
9128 \divide\pgf@circ@res@step by \pgf@circ@res@count
9129 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
9130 }%
9131 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
9132 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
9133 \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
9134 \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
9135 \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
9136
9137 \anchor{center}{\origin}% for backwards compatibility
9138 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
9139
9140 % create input anchors
9141 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
9142 \pgfmathloop%
9143 \ifnum\pgfmathcounter>\pgf@circ@res@count%
9144 \else%
9145 %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
9146 \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
9147 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
9148 }%
9149 \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
9150 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
9151 }%
9152 %}{}%
9153 \repeatpgfmathloop%
9154 }
9155
9156 \anchor{out}{\northeast\pgf@y=0pt}
9157 \anchor{bout}{\right\pgf@y=0pt}
9158
9159
9160 \anchor{left}{\left}% edges of component mius leads
9161 \anchor{right}{\right}
9162
9163 \anchor{north east}{\northeast}% see \Compass macro
9164 \anchor{south west}{\southwest}
9165 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9166 \pgfpoint{0cm}{\pgf@circ@res@up}}
9167 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9168 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9169 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
9170 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
9171 \pgfpoint{\pgf@circ@res@left}{0cm}}
9172 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9173 \pgfpoint{0cm}{\pgf@circ@res@down}}
9174 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
9175 \pgfextractx{\pgf@circ@res@right}{\northeast}%
9176 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
9177 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
9178 \pgfpoint{\pgf@circ@res@right}{0cm}}
9179
9180 \backgroundpath{
9181 \pgfsetcolor{\ctikzvalof{color}}
9182 #3
9183 }
9184 }
9185 }
9186 %%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9187 \pgfcircdeclarelogicport{and}{1}{
9188 \pgfextracty{\pgf@circ@res@temp}{\step}%
9189 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9190 \pgf@circ@res@count = \inputs\relax
9191 \loop\ifnum\pgf@circ@res@count>0
9192 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9193 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9194 \pgfpathlineto{\pgfpoint
9195 {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left}
9196 {\pgf@circ@res@temp}}
9197 \advance\pgf@circ@res@count by -1
9198 \repeat
9199
9200 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9201 \pgfpathlineto{\pgfpoint
9202 {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@right}
9203 {0pt}}
9204
9205 \pgfusepath{draw}
9206
9207 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9208 \pgf@circ@res@other=\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@left
9209
9210 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
9211 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
9212 \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
9213 \pgfpathclose
9214 \pgf@circ@draworfill
9215 }
9216 %%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9217 \pgfcircdeclarelogicport{nand}{1}{
9218 \pgfextracty{\pgf@circ@res@temp}{\step}%
9219 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9220 \pgf@circ@res@count = \inputs\relax
9221 \loop\ifnum\pgf@circ@res@count>0
9222 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9223 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9224 \pgfpathlineto{\pgfpoint
9225 {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@left}
9226 {\pgf@circ@res@temp}}
9227 \advance\pgf@circ@res@count by -1
9228 \repeat
9229
9230 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9231 \pgfpathlineto{\pgfpoint
9232 {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
9233
9234 \pgfusepath{draw}
9235
9236 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9237 \pgf@circ@res@step = \ctikzvalof{tripoles/american nand port/circle width}\pgf@circ@res@right
9238 \pgf@circ@res@other = \ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right
9239 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9240
9241 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
9242 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
9243 \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
9244 \pgfpathclose
9245
9246 \pgfpathellipse
9247 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@step}{0pt}}
9248 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9249 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9250
9251 \pgf@circ@draworfill
9252 }
9253 %%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9254 \pgfcircdeclarelogicport{nor}{2}{
9255 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
9256 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/inner}\pgf@circ@res@right
9257 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9258 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9259 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
9260 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9261
9262 \pgfextracty{\pgf@circ@res@temp}{\step}%
9263 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9264 \pgf@circ@res@count = \inputs\relax
9265 \loop\ifnum\pgf@circ@res@count>0
9266 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9267 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9268 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9269 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9270 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9271 \advance\pgf@circ@res@count by -1
9272 \repeat
9273
9274 \pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
9275 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9276 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9277
9278 \pgfusepath{draw}
9279
9280 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9281
9282 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american nor port/angle}}%
9283 \pgf@circ@res@step = \ctikzvalof{tripoles/american nor port/circle width}\pgf@circ@res@right
9284 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9285 \advance\pgf@circ@res@other by -\pgf@circ@res@step
9286
9287 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9288 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9289 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9290 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9291 \pgfpathclose
9292
9293 \pgfpathellipse
9294 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
9295 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9296 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9297
9298 \pgf@circ@draworfill
9299 }
9300 %%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9301 \pgfcircdeclarelogicport{or}{2}{
9302 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
9303 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/inner}\pgf@circ@res@right
9304 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9305 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
9306 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
9307 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9308
9309 \pgfextracty{\pgf@circ@res@temp}{\step}%
9310 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9311 \pgf@circ@res@count = \inputs\relax
9312 \loop\ifnum\pgf@circ@res@count>0
9313 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9314 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9315 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
9316 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9317 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9318 \advance\pgf@circ@res@count by -1
9319 \repeat
9320
9321 \pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
9322 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9323 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9324
9325 \pgfusepath{draw}
9326
9327 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9328
9329 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american or port/angle}}%
9330
9331 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9332 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9333 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9334 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9335 \pgfpathclose
9336
9337 \pgf@circ@draworfill
9338 }
9339 %%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9340 \pgfcircdeclarelogicport{xor}{3}{
9341 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
9342 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/inner}\pgf@circ@res@right
9343 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9344 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9345 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
9346 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9347 \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
9348 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9349 % this compensates for the effect of the line width on the gap between the arcs
9350 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9351 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9352
9353 \pgfextracty{\pgf@circ@res@temp}{\step}%
9354 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9355 \pgf@circ@res@count = \inputs\relax
9356 \loop\ifnum\pgf@circ@res@count>0
9357 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9358 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9359 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9360 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9361 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9362 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9363 \advance\pgf@circ@res@count by -1
9364 \repeat
9365
9366 \pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
9367 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9368 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9369
9370 \pgfusepath{draw}
9371
9372 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9373
9374 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xor port/angle}}%
9375
9376 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9377 \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9378 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9379 \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
9380 \pgfpathclose
9381 \pgf@circ@draworfill
9382
9383 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
9384
9385 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
9386 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
9387
9388 \pgfusepath{draw}
9389 }
9390 %%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9391 \pgfcircdeclarelogicport{xnor}{3}{
9392 \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
9393 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/inner}\pgf@circ@res@right
9394 \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
9395 \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
9396 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
9397 \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
9398 \pgf@circ@res@temp=\ctikzvalof{tripoles/american xor port/distance}\pgf@circ@res@right
9399 \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
9400 % this compensates for the effect of the line width on the gap between the arcs
9401 \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
9402 \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
9403
9404 \pgfextracty{\pgf@circ@res@temp}{\step}%
9405 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
9406 \pgf@circ@res@count = \inputs\relax
9407 \loop\ifnum\pgf@circ@res@count>0
9408 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
9409 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
9410 \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
9411 \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
9412 \advance\pgf@circ@res@other by -\pgf@circ@math@distance
9413 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
9414 \advance\pgf@circ@res@count by -1
9415 \repeat
9416
9417 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
9418 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9419 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
9420
9421 \pgfusepath{draw}
9422
9423 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9424
9425 \edef\pgf@circ@math@angle{\ctikzvalof{tripoles/american xnor port/angle}}%
9426 \pgf@circ@res@step = \ctikzvalof{tripoles/american xnor port/circle width}\pgf@circ@res@right
9427 \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
9428 \advance\pgf@circ@res@other by -\pgf@circ@res@step
9429
9430 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
9431 \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9432 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
9433 \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
9434 \pgfpathclose
9435
9436 \pgfpathellipse
9437 {\pgfpoint{\pgf@circ@res@other+.5\pgf@circ@res@step}{0pt}}
9438 {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
9439 {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
9440 \pgf@circ@draworfill
9441
9442 \pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@left
9443 \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
9444
9445 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
9446 \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
9447
9448 \pgfusepath{draw}
9449 }
9450
9451 %%% Original one-input ports
9452
9453 \pgfdeclareshape{american not port}{
9454 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9455 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9456 \anchor{center}{\pgfpointorigin}
9457 \savedanchor\northwest{%
9458 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9459 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
9460 \pgf@y=.5\pgf@y
9461 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
9462 \pgf@x=.5\pgf@x
9463 }
9464 \anchor{in}{
9465 \northwest
9466 \pgf@y=0pt
9467 }
9468 \anchor{in 1}{
9469 \northwest
9470 \pgf@y=0pt
9471 }
9472 \anchor{bin}{
9473 \northwest
9474 \pgf@y=0pt
9475 }
9476 \anchor{bin 1}{
9477 \northwest
9478 \pgf@y=0pt
9479 \pgf@x=0.7\pgf@x
9480 }
9481 \anchor{out}{
9482 \northwest
9483 \pgf@y=0pt
9484 \pgf@x=-\pgf@x
9485 }
9486 \anchor{bout}{
9487 \northwest
9488 \pgf@y=0pt
9489 \pgf@x=-0.7\pgf@x
9490 }
9491 \anchor{center}{
9492 \pgfpointorigin
9493 }
9494 \anchor{east}{
9495 \northwest
9496 \pgf@y=0pt
9497 \pgf@x=-\pgf@x
9498 }
9499 \anchor{west}{
9500 \northwest
9501 \pgf@y=0pt
9502 }
9503 \anchor{south}{
9504 \northwest
9505 \pgf@x=0pt
9506 \pgf@y=-\pgf@y
9507 }
9508 \anchor{north}{
9509 \northwest
9510 \pgf@x=0pt
9511 }
9512 \anchor{south west}{
9513 \northwest
9514 \pgf@y=-\pgf@y
9515 }
9516 \anchor{north east}{
9517 \northwest
9518 \pgf@x=-\pgf@x
9519 }
9520 \anchor{north west}{
9521 \northwest
9522 }
9523 \anchor{south east}{
9524 \northwest
9525 \pgf@x=-\pgf@x
9526 \pgf@y=-\pgf@y
9527 }
9528 \backgroundpath{
9529 \pgfsetcolor{\ctikzvalof{color}}
9530
9531 \northwest
9532 \pgf@circ@res@up = \pgf@y
9533 \pgf@circ@res@down = -\pgf@y
9534 \pgf@circ@res@right = -\pgf@x
9535 \pgf@circ@res@left = \pgf@x
9536
9537 \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
9538
9539 \pgfscope
9540 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9541 \pgftransformxshift{.7\pgf@circ@res@left}
9542 \pgf@circ@res@step=\pgf@circ@res@right
9543 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9544 \pgf@circ@res@step=.7\pgf@circ@res@step
9545
9546 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9547 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9548 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9549 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9550 \pgf@circ@draworfill
9551 \pgfpathellipse
9552 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
9553 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
9554 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
9555 \pgf@circ@draworfill
9556 \endpgfscope
9557
9558 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9559 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9560
9561 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9562 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
9563
9564 \pgfusepath{draw}
9565 }
9566 }
9567
9568 \pgfdeclareshape{american buffer port}{
9569 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9570 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9571 \anchor{center}{\pgfpointorigin}
9572 \savedanchor\northwest{%
9573 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9574 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
9575 \pgf@y=.5\pgf@y
9576 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
9577 \pgf@x=.5\pgf@x
9578 }
9579 \anchor{in}{
9580 \northwest
9581 \pgf@y=0pt
9582 }
9583 \anchor{in 1}{
9584 \northwest
9585 \pgf@y=0pt
9586 }
9587 \anchor{bin}{
9588 \northwest
9589 \pgf@y=0pt
9590 }
9591 \anchor{bin 1}{
9592 \northwest
9593 \pgf@y=0pt
9594 \pgf@x=0.7\pgf@x
9595 }
9596 \anchor{out}{
9597 \northwest
9598 \pgf@y=0pt
9599 \pgf@x=-\pgf@x
9600 }
9601 \anchor{bout}{
9602 \northwest
9603 \pgf@y=0pt
9604 \pgf@x=-0.7\pgf@x
9605 }
9606 \anchor{center}{
9607 \pgfpointorigin
9608 }
9609 \anchor{east}{
9610 \northwest
9611 \pgf@y=0pt
9612 \pgf@x=-\pgf@x
9613 }
9614 \anchor{west}{
9615 \northwest
9616 \pgf@y=0pt
9617 }
9618 \anchor{south}{
9619 \northwest
9620 \pgf@x=0pt
9621 \pgf@y=-\pgf@y
9622 }
9623 \anchor{north}{
9624 \northwest
9625 \pgf@x=0pt
9626 }
9627 \anchor{south west}{
9628 \northwest
9629 \pgf@y=-\pgf@y
9630 }
9631 \anchor{north east}{
9632 \northwest
9633 \pgf@x=-\pgf@x
9634 }
9635 \anchor{north west}{
9636 \northwest
9637 }
9638 \anchor{south east}{
9639 \northwest
9640 \pgf@x=-\pgf@x
9641 \pgf@y=-\pgf@y
9642 }
9643 \backgroundpath{
9644 \pgfsetcolor{\ctikzvalof{color}}
9645
9646 \northwest
9647 \pgf@circ@res@up = \pgf@y
9648 \pgf@circ@res@down = -\pgf@y
9649 \pgf@circ@res@right = -\pgf@x
9650 \pgf@circ@res@left = \pgf@x
9651
9652 \pgfscope
9653 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9654 \pgftransformxshift{.7\pgf@circ@res@left}
9655 \pgf@circ@res@step=\pgf@circ@res@right
9656 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9657 \pgf@circ@res@step=.7\pgf@circ@res@step
9658
9659 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
9660 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9661 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9662 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
9663 \pgf@circ@draworfill
9664 \endpgfscope
9665
9666 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9667 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9668
9669 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9670 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
9671
9672 \pgfusepath{draw}
9673 }
9674 }
9675 \pgfdeclareshape{invschmitt}{
9676 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9677 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9678 \anchor{center}{\pgfpointorigin}
9679 \savedanchor\northwest{%
9680 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9681 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
9682 \pgf@y=.5\pgf@y
9683 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
9684 \pgf@x=.5\pgf@x
9685 }
9686 \anchor{in}{
9687 \northwest
9688 \pgf@y=0pt
9689 }
9690 \anchor{in 1}{
9691 \northwest
9692 \pgf@y=0pt
9693 }
9694 \anchor{bin 1}{
9695 \northwest
9696 \pgf@y=0pt
9697 \pgf@x=0.7\pgf@x
9698 }
9699 \anchor{out}{
9700 \northwest
9701 \pgf@y=0pt
9702 \pgf@x=-\pgf@x
9703 }
9704 \anchor{bout}{
9705 \northwest
9706 \pgf@y=0pt
9707 \pgf@x=-0.7\pgf@x
9708 }
9709 \anchor{center}{
9710 \pgfpointorigin
9711 }
9712 \anchor{east}{
9713 \northwest
9714 \pgf@y=0pt
9715 \pgf@x=-\pgf@x
9716 }
9717 \anchor{west}{
9718 \northwest
9719 \pgf@y=0pt
9720 }
9721 \anchor{south}{
9722 \northwest
9723 \pgf@x=0pt
9724 \pgf@y=-\pgf@y
9725 }
9726 \anchor{north}{
9727 \northwest
9728 \pgf@x=0pt
9729 }
9730 \anchor{south west}{
9731 \northwest
9732 \pgf@y=-\pgf@y
9733 }
9734 \anchor{north east}{
9735 \northwest
9736 \pgf@x=-\pgf@x
9737 }
9738 \anchor{north west}{
9739 \northwest
9740 }
9741 \anchor{south east}{
9742 \northwest
9743 \pgf@x=-\pgf@x
9744 \pgf@y=-\pgf@y
9745 }
9746 \backgroundpath{
9747 \pgfsetcolor{\ctikzvalof{color}}
9748
9749 \northwest
9750 \pgf@circ@res@up = \pgf@y
9751 \pgf@circ@res@down = -\pgf@y
9752 \pgf@circ@res@right = -\pgf@x
9753 \pgf@circ@res@left = \pgf@x
9754
9755 \pgf@circ@res@other = \ctikzvalof{bipoles/not port/circle width}\pgf@circ@res@right
9756
9757 \pgfscope
9758 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9759 \pgftransformxshift{.7\pgf@circ@res@left}
9760 \pgf@circ@res@step=\pgf@circ@res@right
9761 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9762 \pgf@circ@res@step=.7\pgf@circ@res@step
9763
9764 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
9765 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9766 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9767 \pgfpathclose
9768 \pgf@circ@draworfill
9769 \pgfpathellipse
9770 {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
9771 {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
9772 {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
9773 \pgf@circ@draworfill
9774 \endpgfscope
9775
9776 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9777 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9778
9779 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9780 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
9781 \pgfusepath{draw}
9782 %draw inner shape
9783
9784 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9785
9786 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9787 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9788 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9789 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9790 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9791 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9792 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9793 \pgfusepath{draw}
9794
9795 }
9796 }
9797
9798 \pgfdeclareshape{schmitt}{
9799 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9800 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9801 \anchor{center}{\pgfpointorigin}
9802 \savedanchor\northwest{%
9803 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9804 \pgf@y=\ctikzvalof{bipoles/not port/height}\pgf@circ@scaled@Rlen
9805 \pgf@y=.5\pgf@y
9806 \pgf@x=-\ctikzvalof{bipoles/not port/width}\pgf@circ@scaled@Rlen
9807 \pgf@x=.5\pgf@x
9808 }
9809 \anchor{in}{
9810 \northwest
9811 \pgf@y=0pt
9812 }
9813 \anchor{in 1}{
9814 \northwest
9815 \pgf@y=0pt
9816 }
9817 \anchor{bin 1}{
9818 \northwest
9819 \pgf@y=0pt
9820 \pgf@x=0.7\pgf@x
9821 }
9822 \anchor{out}{
9823 \northwest
9824 \pgf@y=0pt
9825 \pgf@x=-\pgf@x
9826 }
9827 \anchor{bout}{
9828 \northwest
9829 \pgf@y=0pt
9830 \pgf@x=-.7\pgf@x
9831 }
9832 \anchor{center}{
9833 \pgfpointorigin
9834 }
9835 \anchor{east}{
9836 \northwest
9837 \pgf@y=0pt
9838 \pgf@x=-\pgf@x
9839 }
9840 \anchor{west}{
9841 \northwest
9842 \pgf@y=0pt
9843 }
9844 \anchor{south}{
9845 \northwest
9846 \pgf@x=0pt
9847 \pgf@y=-\pgf@y
9848 }
9849 \anchor{north}{
9850 \northwest
9851 \pgf@x=0pt
9852 }
9853 \anchor{south west}{
9854 \northwest
9855 \pgf@y=-\pgf@y
9856 }
9857 \anchor{north east}{
9858 \northwest
9859 \pgf@x=-\pgf@x
9860 }
9861 \anchor{north west}{
9862 \northwest
9863 }
9864 \anchor{south east}{
9865 \northwest
9866 \pgf@x=-\pgf@x
9867 \pgf@y=-\pgf@y
9868 }
9869 \backgroundpath{
9870 \pgfsetcolor{\ctikzvalof{color}}
9871
9872
9873 \northwest
9874 \pgf@circ@res@up = \pgf@y
9875 \pgf@circ@res@down = -\pgf@y
9876 \pgf@circ@res@right = -\pgf@x
9877 \pgf@circ@res@left = \pgf@x
9878
9879 \pgfscope
9880 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9881 \pgftransformxshift{.7\pgf@circ@res@left}
9882 \pgf@circ@res@step=\pgf@circ@res@right
9883 \advance\pgf@circ@res@step by -\pgf@circ@res@left
9884 \pgf@circ@res@step=.7\pgf@circ@res@step
9885
9886 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
9887 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
9888 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
9889 \pgfpathclose
9890 \pgf@circ@draworfill
9891 \endpgfscope
9892
9893 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
9894 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
9895
9896 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
9897 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
9898 \pgfusepath{draw}
9899 %draw inner shape
9900
9901 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
9902
9903 \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9904 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9905 \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9906 \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9907 \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9908 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
9909 \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
9910 \pgfusepath{draw}
9911
9912 }
9913 }
9914
9915
9916 %%% start european logic ports, from John Kormylo
9917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9918 %%
9919
9920 % #1 - name
9921 % #2 - text inside
9922 % #3 - number of inputs
9923 % #4 = is it a not?
9924
9925 \long\def\pgfcircdeclareeurologicport#1#2#3#4{
9926 \pgfdeclareshape{european #1 port}
9927 {
9928 \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
9929 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
9930 \savedmacro\resize{% automatic
9931 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9932 \pgf@circ@res@up = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
9933 \pgf@circ@res@up = .5\pgf@circ@res@up
9934 \pgf@circ@res@down = -\pgf@circ@res@up
9935 \pgf@circ@res@right = \ctikzvalof{tripoles/european #1 port/width}\pgf@circ@scaled@Rlen
9936 \pgf@circ@res@right = .5\pgf@circ@res@right
9937 \pgf@circ@res@left = -\pgf@circ@res@right
9938 }%
9939 \savedmacro\inputs{% get number of inputs
9940 \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
9941 \ifnum\pgf@circ@res@count=0
9942 \pgf@circ@res@count=\ctikzvalof{tripoles/european #1 port/inputs}\relax%
9943 \fi
9944 \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
9945 \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
9946 \def\inputs{\the\pgf@circ@res@count}%
9947 }%
9948 \savedanchor\step{% 1/2 gap at edges
9949 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
9950 \pgf@circ@res@step = \ctikzvalof{tripoles/european #1 port/height}\pgf@circ@scaled@Rlen
9951 \divide\pgf@circ@res@step by #3
9952 \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
9953 }%
9954 \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
9955 \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
9956 \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
9957 \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
9958 \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
9959
9960 \anchor{center}{\origin}% for backwards compatibility
9961 % the text anchor overlaps the logic symbol
9962 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
9963 % create input anchors
9964 \ifnum#3=1\relax
9965 \anchor{in}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
9966 \anchor{in 1}{\southwest\pgfpoint{\pgf@x}{0pt}}% or \step
9967 \anchor{bin}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
9968 \anchor{bin 1}{\left\pgfpoint{\pgf@x}{0pt}}% or \step
9969 \else
9970 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
9971 \pgfmathloop%
9972 \ifnum\pgfmathcounter>#3%
9973 \else%
9974 %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
9975 \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
9976 \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
9977 }%
9978 \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
9979 \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
9980 }%
9981 %}{}%
9982 \repeatpgfmathloop%
9983 }
9984 \fi
9985 \anchor{out}{\northeast\pgf@y=0pt}
9986 \anchor{bout}{\right\pgf@y=0pt}
9987
9988 \anchor{left}{\left}% edges of component minus leads
9989 \anchor{right}{\right}
9990
9991 \anchor{north east}{\northeast}% see \Compass macro
9992 \anchor{south west}{\southwest}
9993 \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9994 \pgfpoint{0cm}{\pgf@circ@res@up}}
9995 \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
9996 \pgfextractx{\pgf@circ@res@left}{\southwest}%
9997 \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
9998 \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
9999 \pgfpoint{\pgf@circ@res@left}{0cm}}
10000 \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
10001 \pgfpoint{0cm}{\pgf@circ@res@down}}
10002 \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
10003 \pgfextractx{\pgf@circ@res@right}{\northeast}%
10004 \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
10005 \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
10006 \pgfpoint{\pgf@circ@res@right}{0cm}}
10007
10008 \backgroundpath{
10009 \pgfsetcolor{\ctikzvalof{color}}
10010 \pgfscope
10011 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10012 \pgfpathrectanglecorners
10013 {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
10014 {\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
10015 \pgf@circ@draworfill
10016 \endpgfscope
10017 \ifnum#3=1\relax
10018 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
10019 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
10020 \else
10021 \pgfextracty{\pgf@circ@res@temp}{\step}%
10022 \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
10023 %\pgf@circ@res@count = #3\relax% redundant
10024 \loop\ifnum\pgf@circ@res@count>0
10025 \advance\pgf@circ@res@temp by -\pgf@circ@res@step
10026 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
10027 \pgfpathlineto{\pgfpoint
10028 {\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@left}
10029 {\pgf@circ@res@temp}}
10030 \advance\pgf@circ@res@count by -1
10031 \repeat
10032 \fi
10033 %
10034 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
10035 \pgfpathlineto{%
10036 \pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
10037 %
10038 \edef\pgf@temp{not}
10039 \edef\pgf@circ@temp{#4}
10040 \ifx\pgf@temp\pgf@circ@temp % is a not
10041 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
10042 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}%
10043 {\ctikzvalof{tripoles/european #1 port/not height}\pgf@circ@res@up}}
10044 \fi
10045 %
10046 \pgfusepath{draw}
10047 %
10048 \pgfpathmoveto{\pgfpointorigin}
10049 \pgftext{#2}
10050 }
10051 }
10052 }
10053 \pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
10054 \pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
10055 \pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
10056 \pgfcircdeclareeurologicport{not}{$1$}{1}{not}
10057 \pgfcircdeclareeurologicport{buffer}{$1$}{1}{}
10058 \pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
10059 \pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
10060 \pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
10061
10062 %% end european logic ports
10063
10064 %%%%%%%%%%%%%%%%%%%%%%%%
10065 %% Transistors
10066 %%%%%%%%%%%%%%%%%%%%%%%%
10067
10068
10069 \long\def\pgfcircdeclaretransistor#1#2#3{
10070 \pgfdeclareshape{#1}
10071 {
10072 \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
10073 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10074 \anchor{center}{
10075 \pgfpointorigin
10076 }
10077 \savedanchor\northeast{% upper right
10078 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10079 \pgf@y=\ctikzvalof{tripoles/#1/height}\pgf@circ@scaled@Rlen
10080 \pgf@y=.5\pgf@y
10081 \pgf@x=0pt
10082 }
10083 \savedanchor\left{%center left
10084 \pgf@y=0pt
10085 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10086 \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
10087 }
10088 \savedanchor\right{%center right -- added by Burak Kelleci % this is really 0,0
10089 \pgf@y=0pt
10090 \pgf@x=0pt
10091 }
10092 \anchor{text}{
10093 \northeast
10094 \pgf@y=.7\pgf@y
10095 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10096 \pgf@x= \pgf@circ@scaled@Rlen
10097 \pgf@x=0.1\pgf@x
10098 }
10099 \anchor{pathstart}{ % south
10100 \northeast
10101 \pgf@y=-\pgf@y
10102 }
10103 \anchor{pathend}{
10104 \northeast
10105 }
10106 \anchor{north}{
10107 \northeast
10108 \pgf@circ@res@step=\pgf@y
10109 \left
10110 \pgf@y=\pgf@circ@res@step
10111 \pgf@x=.5\pgf@x
10112 }
10113 \anchor{west}{
10114 \left
10115 }
10116 \anchor{east}{
10117 \northeast
10118 \pgf@y=0pt
10119 }
10120 \anchor{south}{
10121 \northeast
10122 \pgf@circ@res@step=\pgf@y
10123 \left
10124 \pgf@y=-\pgf@circ@res@step
10125 \pgf@x=.5\pgf@x
10126 }
10127 \anchor{south west}{
10128 \northeast
10129 \pgf@circ@res@step=\pgf@y
10130 \left
10131 \pgf@y=-\pgf@circ@res@step
10132 }
10133 \anchor{north east}{
10134 \northeast
10135 }
10136 \anchor{north west}{
10137 \northeast
10138 \pgf@circ@res@step=\pgf@y
10139 \left
10140 \pgf@y=\pgf@circ@res@step
10141 }
10142 \anchor{south east}{
10143 \northeast
10144 \pgf@y=-\pgf@y
10145 }
10146 \anchor{B}{
10147 \northeast
10148 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10149 \left
10150 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10151 }
10152 \anchor{base}{
10153 \northeast
10154 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10155 \left
10156 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10157 }
10158 \anchor{bulk}{ %added by Burak Kelleci
10159 \northeast
10160 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10161 \right
10162 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10163 }
10164 \anchor{nobulk}{ %added by Burak Kelleci
10165 \left
10166 \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
10167 }
10168 \anchor{G}{
10169 \northeast
10170 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10171 \left
10172 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10173 }
10174 \anchor{gate}{
10175 \northeast
10176 \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y
10177 \left
10178 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step
10179 }
10180 \anchor{nobase}{
10181 \left
10182 \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
10183 }
10184 \anchor{nogate}{
10185 \left
10186 \pgf@x=\ctikzvalof{tripoles/#1/gate width}\pgf@x
10187 }
10188 \anchor{E}{
10189 \northeast
10190 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10191 }
10192 \anchor{emitter}{
10193 \northeast
10194 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10195 }
10196 \anchor{C}{
10197 \northeast
10198 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10199 }
10200 \anchor{collector}{
10201 \northeast
10202 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10203 }
10204 \anchor{S}{
10205 \northeast
10206 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10207 }
10208 \anchor{source}{
10209 \northeast
10210 \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10211 }
10212 \anchor{D}{
10213 \northeast
10214 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10215 }
10216 \anchor{drain}{
10217 \northeast
10218 \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
10219 }
10220 #2
10221 \backgroundpath{
10222 \pgftransformationadjustments
10223 \pgfsetcolor{\ctikzvalof{color}}
10224 %
10225 \ifnum \ctikzvalof{tripoles/#1/curr direction} > 0
10226 \pgf@circuit@trans@ntypetrue
10227 \else
10228 \pgf@circuit@trans@ntypefalse
10229 \fi
10230 \northeast
10231 \pgf@circ@res@up = \pgf@y
10232 \pgf@circ@res@down = -\pgf@y
10233 \pgf@circ@res@right = \pgf@x
10234 \left
10235 \pgf@circ@res@left = \pgf@x
10236 \pgf@circ@scaled@Rlen=\scaledRlen
10237 %
10238 #3
10239 % BODY DIODE
10240 \ifpgf@circuit@fet@bodydiode
10241 \drawbodydiode{#1}
10242 \fi
10243 %
10244 }
10245 }
10246 }
10247
10248 \long\def\drawbodydiode#1{
10249 \pgfscope
10250 \pgftransformshift{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
10251 \pgftransformrotate{90}
10252 % diode scale and bodydiode scale interacts. We want the size of the diode
10253 % proportional to the transistor, so we will:
10254 % 1) undo diode scale 2) apply transistor scale (using the current class) 3) apply bodydiode scale
10255 \pgfmathsetmacro{\@@BDscale}{\ctikzvalof{tripoles/#1/bodydiode scale}* \ctikzvalof{\ctikzclass/scale}/\ctikzvalof{diodes/scale}}
10256 \pgftransformscale{\@@BDscale}
10257 \ifpgf@circuit@fulldiode
10258 \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
10259 \else
10260 \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
10261 \fi
10262 \endpgfscope
10263 % Draw stroke line
10264 \ifpgf@circuit@strokediode
10265 \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
10266 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
10267 \pgfusepath{stroke}
10268 \fi
10269 %Draw upper connection to body diode
10270 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
10271 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10272 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}
10273 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10274 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
10275 \pgfusepath{draw}
10276 \pgfscope
10277 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
10278 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
10279 \pgftransformscale{0.5}
10280 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
10281 \endpgfscope{}
10282 %Draw lower connection to body diode
10283 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
10284 {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10285 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10286 \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
10287 \pgfusepath{draw}
10288 \pgfscope
10289 \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
10290 \pgftransformscale{0.5}
10291 \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
10292 \endpgfscope
10293 }
10294
10295 \long\def\declarebpt#1{
10296 \pgfcircdeclaretransistor{#1}{
10297 \anchor{inner up}{
10298 \northeast
10299 \pgf@y=\ctikzvalof{tripoles/#1/base height}\pgf@y
10300 }
10301 \anchor{inner down}{
10302 \northeast
10303 \pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y
10304 }
10305 }{
10306 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10307 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10308 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
10309 \pgfpathlineto{\pgfpoint
10310 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10311 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}}
10312 \pgfusepath{draw}
10313
10314 \pgfscope
10315 \pgfpathmoveto{\pgfpoint
10316 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10317 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
10318 \pgfpathlineto{\pgfpoint
10319 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10320 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
10321 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10322 \pgfusepath{draw}
10323 \endpgfscope
10324
10325 \pgfpathmoveto{\pgfpoint
10326 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10327 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}}
10328 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10329 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
10330 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10331 \pgfusepath{draw}
10332 %draw arrow depending on type of transistor
10333 \pgfscope
10334 \pgfslopedattimetrue
10335 \pgfallowupsidedownattimetrue
10336 \pgfresetnontranslationattimefalse
10337 \edef\@@anchor{center}
10338 \ifpgf@circuit@trans@ntype
10339 \ifpgf@circuit@trans@arrowatend
10340 \edef\@@anchor{btip}
10341 \pgftransformlineattime{1.0}{%
10342 \pgfpoint%
10343 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10344 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
10345 }{%
10346 \pgfpoint{\pgf@circ@res@right}%
10347 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
10348 }
10349 \else
10350 \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
10351 \pgfpoint%
10352 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10353 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@down}%
10354 }{%
10355 \pgfpoint{\pgf@circ@res@right}%
10356 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}%
10357 }
10358 \fi
10359 \else % p-type
10360 \ifpgf@circuit@trans@arrowatend
10361 \edef\@@anchor{tip}
10362 \pgftransformlineattime{1.0}{%
10363 \pgfpoint{\pgf@circ@res@right}%
10364 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
10365 }{%
10366 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10367 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
10368 }
10369 \else
10370 \pgftransformlineattime{\ctikzvalof{tripoles/#1/arrow pos}}{%
10371 \pgfpoint{\pgf@circ@res@right}%
10372 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}%
10373 }{%
10374 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10375 {\ctikzvalof{tripoles/#1/base height 2}\pgf@circ@res@up}%
10376 }
10377 \fi
10378 \fi
10379 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
10380 \endpgfscope
10381
10382 \ifpgf@circuit@bpt@drawphoto
10383 \pgfscope
10384 \pgfsetarrowsstart{latexslim}
10385 \pgfpathmoveto{\pgfpointadd{\pgfpoint
10386 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10387 {\pgf@circ@res@up+\pgf@circ@res@down}}
10388 {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
10389 \pgfpathlineto{\pgfpointadd{\pgfpoint
10390 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10391 {\pgf@circ@res@up+\pgf@circ@res@down}}
10392 {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
10393 \pgfusepath{draw}
10394 \pgfpathmoveto{\pgfpointadd{\pgfpoint
10395 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10396 {\pgf@circ@res@up+\pgf@circ@res@down}}
10397 {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
10398 \pgfpathlineto{\pgfpointadd{\pgfpoint
10399 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10400 {\pgf@circ@res@up+\pgf@circ@res@down}}
10401 {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
10402 \pgfusepath{draw}
10403 \endpgfscope
10404 \else
10405 \ifpgf@circuit@bpt@drawbase
10406 \pgfpathmoveto{\pgfpoint
10407 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10408 {\pgf@circ@res@up+\pgf@circ@res@down}}
10409 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
10410 \pgfusepath{draw}
10411 \fi
10412 \fi
10413 }
10414 }
10415
10416 \declarebpt{npn}
10417 \declarebpt{pnp}
10418 %
10419 % multi-emitter and multi-collector BJTs by Romano Giannetti
10420 %
10421 \def\pgf@circ@bjt@C@anchor#1{% #1: collector number
10422 \pgfextractx{\pgf@circ@res@temp}{\basedimension}
10423 \pgfextracty{\pgf@circ@res@other}{\basedimension}
10424 \ifnum\cdir>0 % NPN, above
10425 \pgfpoint{\pgf@circ@res@temp}{%
10426 \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
10427 \else % PNP, below
10428 \pgfpoint{\pgf@circ@res@temp}{%
10429 -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
10430 \fi
10431 }
10432 \def\pgf@circ@bjt@E@anchor#1{% #1: collector number
10433 \pgfextractx{\pgf@circ@res@temp}{\basedimension}
10434 \pgfextracty{\pgf@circ@res@other}{\basedimension}
10435 \ifnum\cdir<0 % PNP, above
10436 \pgfpoint{\pgf@circ@res@temp}{%
10437 \pgf@circ@res@other+\pgfverticaltransformationadjustment*.5*\pgflinewidth+(#1-1)*\multistep}
10438 \else % PNP, below
10439 \pgfpoint{\pgf@circ@res@temp}{%
10440 -\pgf@circ@res@other-\pgfverticaltransformationadjustment*.5*\pgflinewidth-(#1-1)*\multistep}
10441 \fi
10442 }
10443
10444 \long\def\declarebjt#1{
10445 \pgfdeclareshape{bjt#1}{
10446 \savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
10447 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
10448 % \cdir is 1 for npn, -1 for pnp
10449 \savedmacro{\cdir}{\edef\cdir{\ctikzvalof{tripoles/bjt/#1/curr direction}}}
10450 \savedmacro{\numE}{\edef\numE{\ctikzvalof{tripoles/bjt/emitters}}}
10451 \savedmacro{\numC}{\edef\numC{\ctikzvalof{tripoles/bjt/collectors}}}
10452 % step up or down for the additional C/Es
10453 \saveddimen{\multistep}{\pgfmathsetlength{\pgf@x}{%
10454 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10455 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
10456 \saveddimen{\external}{\pgfmathsetlength{\pgf@x}{%
10457 \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}}
10458 \savedanchor\basedimension{% these are the dimensions if nC=1 y nE=1
10459 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10460 \pgf@y=\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10461 \pgf@y=.5\pgf@y
10462 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
10463 \pgf@x=.5\pgf@x
10464 }
10465 \savedanchor\northeast{% upper right
10466 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10467 \pgfmathsetlength{\pgf@circ@res@step}{%
10468 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10469 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10470 \ifnum\cdir> 0
10471 \edef\numup{\numC}\edef\numdown{\numE}
10472 \else
10473 \edef\numup{\numE}\edef\numdown{\numC}
10474 \fi
10475 \pgfmathsetlength{\pgf@y}{0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10476 + (\numup-1)*\pgf@circ@res@step+\pgfverticaltransformationadjustment*.5*\pgflinewidth
10477 + \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10478 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
10479 \pgf@x=.5\pgf@x
10480 }
10481 \savedanchor\southeast{% lower right
10482 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10483 \pgfmathsetlength{\pgf@circ@res@step}{%
10484 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10485 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10486 \ifnum\cdir> 0
10487 \edef\numup{\numC}\edef\numdown{\numE}
10488 \else
10489 \edef\numup{\numE}\edef\numdown{\numC}
10490 \fi
10491 \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10492 - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
10493 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10494 \pgf@x=\ctikzvalof{tripoles/bjt/width}\pgf@circ@scaled@Rlen
10495 \pgf@x=.5\pgf@x
10496 }
10497 \savedanchor\southwest{% lower left
10498 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
10499 \pgfmathsetlength{\pgf@circ@res@step}{%
10500 \ctikzvalof{tripoles/bjt/height}*\ctikzvalof{tripoles/bjt/multi height}*
10501 \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10502 \ifnum\cdir> 0
10503 \edef\numup{\numC}\edef\numdown{\numE}
10504 \else
10505 \edef\numup{\numE}\edef\numdown{\numC}
10506 \fi
10507 \pgfmathsetlength{\pgf@y}{-0.5*\ctikzvalof{tripoles/bjt/height}\pgf@circ@scaled@Rlen
10508 - (\numdown-1)*\pgf@circ@res@step-\pgfverticaltransformationadjustment*.5*\pgflinewidth
10509 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10510 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{tripoles/bjt/width}*\pgf@circ@scaled@Rlen
10511 - \ctikzvalof{tripoles/bjt/pins width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
10512 }
10513 \anchor{center}{\pgfpointorigin}
10514 \anchor{north}{\northeast\pgf@x=0cm\relax}
10515 \anchor{east}{\northeast\pgf@y=0cm\relax}
10516 \anchor{south}{\southwest\pgf@x=0cm\relax}
10517 \anchor{west}{\southwest\pgf@y=0cm}
10518 \anchor{north east}{\northeast}
10519 \anchor{north west}{\northeast\pgf@ya=\pgf@y\southwest\pgf@y=\pgf@ya}
10520 \anchor{south west}{\southwest}
10521 \anchor{south east}{\southeast}
10522
10523 \anchor{text}{\northeast\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax}
10524 \anchor{B}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
10525 \anchor{base}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x\advance\pgf@x by -\external}
10526 \anchor{nobase}{\basedimension\pgf@y=0cm\pgf@x=-\pgf@x}
10527 % center of the base "bar"
10528 \anchor{cbase}{\basedimension\pgf@x=-\pgf@x
10529 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
10530 }
10531 % geometrical centers
10532 \anchor{vcenter}{\pgf@x=0cm\relax
10533 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
10534 }
10535 \anchor{gcenter}{%
10536 \northeast\pgf@xa=0.5\pgf@x
10537 \southwest\advance\pgf@xa by 0.5\pgf@x
10538 \pgf@x=\pgf@xa
10539 \pgfmathsetlength{\pgf@y}{\cdir*(\numC-\numE)*\multistep/2}%
10540 }
10541 % external connections
10542 \anchor{E}{
10543 \ifnum\cdir>0% npn, emitter down
10544 \southeast
10545 \else
10546 \northeast
10547 \fi
10548 }% first emitter
10549 \anchor{emitter}{\ifnum\cdir>0\southeast\else\northeast\fi}% first emitter
10550 \anchor{C}{\ifnum\cdir<0\southeast\else\northeast\fi}
10551 \anchor{collector}{\ifnum\cdir<0\southeast\else\northeast\fi}
10552
10553 \backgroundpath{
10554 \pgftransformationadjustments
10555 \pgfsetcolor{\ctikzvalof{color}}
10556 %
10557 % set the type and up and down number of connections
10558 %
10559 \ifnum\cdir> 0
10560 \pgf@circuit@trans@ntypetrue
10561 \edef\numup{\numC}
10562 \edef\numdown{\numE}
10563 \else
10564 \pgf@circuit@trans@ntypefalse
10565 \edef\numup{\numE}
10566 \edef\numdown{\numC}
10567 \fi
10568 \basedimension
10569 \pgf@circ@res@up = \pgf@y
10570 \pgf@circ@res@down = -\pgf@y
10571 \pgf@circ@res@right = \pgf@x
10572 \pgf@circ@res@left = -\pgf@x
10573 \pgf@circ@scaled@Rlen=\scaledRlen
10574 \pgf@circ@res@step=\multistep
10575 %
10576 % set arrow positions options
10577 %
10578 \edef\@@anchor{center}\edef\@@pos{\ctikzvalof{tripoles/#1/arrow pos}}
10579 \ifpgf@circuit@trans@arrowatend
10580 \edef\@@pos{1.0}
10581 \ifpgf@circuit@trans@ntype % arrow is toward outside, push it a bit
10582 \edef\@@anchor{btip}
10583 \else
10584 \edef\@@anchor{tip}
10585 \fi
10586 \fi
10587 %
10588 % Drawing upper connections
10589 %
10590 \pgfscope
10591 \pgf@circ@count@a=\numup\relax
10592 \pgfmathloop%
10593 \ifnum\pgf@circ@count@a>0
10594 \advance\pgf@circ@count@a-1\relax
10595 \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
10596 \ifnum\pgf@circ@count@a=\numexpr\numup-1\relax % draw the external pin connection
10597 \pgfpathmoveto{\pgfpoint
10598 {\pgf@circ@res@right}%
10599 {\pgf@circ@res@up+\external+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
10600 \pgfpathlineto{\pgfpoint
10601 {\pgf@circ@res@right}%
10602 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
10603 \else
10604 \pgfpathmoveto{\pgfpoint
10605 {\pgf@circ@res@right}%
10606 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}}%
10607 \fi
10608 \pgfpathlineto{\pgfpoint
10609 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
10610 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}}%
10611 \pgfsetroundcap % better when connecting to sloped lines
10612 \pgfusepath{draw}
10613 \ifpgf@circuit@trans@ntype\else % it's a PNP; draw arrow
10614 \pgfscope
10615 \pgfslopedattimetrue
10616 \pgfallowupsidedownattimetrue
10617 \pgfresetnontranslationattimefalse
10618 \pgftransformlineattime{\@@pos}{%
10619 \pgfpoint
10620 {\pgf@circ@res@right}%
10621 {\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth+\pgf@circ@res@other}%
10622 }{\pgfpoint
10623 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
10624 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@up+\pgf@circ@res@other}%
10625 }
10626 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
10627 \endpgfscope
10628 \fi
10629 \repeatpgfmathloop
10630 \endpgfscope
10631 %
10632 % Drawing base
10633 %
10634 \pgfscope
10635 \pgfpathmoveto{\pgfpoint
10636 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
10637 {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@up+(\numup-1)*\multistep}}
10638 \pgfpathlineto{\pgfpoint
10639 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
10640 {\ctikzvalof{tripoles/bjt/base height}\pgf@circ@res@down-(\numdown-1)*\multistep}}
10641 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10642 \pgfsetroundcap % I like it more...
10643 \pgfusepath{draw}
10644 \endpgfscope
10645 %
10646 % draw base external connection
10647 %
10648 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}{0pt}}
10649 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left-\external}{0pt}}
10650 \pgfusepath{draw}
10651 %
10652 % Drawing lower connections
10653 %
10654 \pgfscope
10655 \pgf@circ@count@a=\numdown\relax
10656 \pgfmathloop%
10657 \ifnum\pgf@circ@count@a>0
10658 \advance\pgf@circ@count@a-1\relax
10659 \pgfmathsetlength{\pgf@circ@res@other}{\the\pgf@circ@count@a*\multistep}%
10660 \pgfpathmoveto{\pgfpoint
10661 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}
10662 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}}
10663 \pgfpathlineto{\pgfpoint
10664 {\pgf@circ@res@right}
10665 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}}
10666 \ifnum\pgf@circ@count@a=\numexpr\numdown-1\relax % draw the external pin connection
10667 \pgfpathlineto{\pgfpoint
10668 {\pgf@circ@res@right}
10669 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other-\external}}
10670 \fi
10671 \pgfsetroundcap % better when connecting to sloped lines
10672 \pgfusepath{draw}
10673 \ifpgf@circuit@trans@ntype % it's a NPN; draw arrow
10674 \pgfscope
10675 \pgfslopedattimetrue
10676 \pgfallowupsidedownattimetrue
10677 \pgfresetnontranslationattimefalse
10678 \pgftransformlineattime{\@@pos}{%
10679 \pgfpoint
10680 {\ctikzvalof{tripoles/bjt/base width}\pgf@circ@res@left}%
10681 {\ctikzvalof{tripoles/bjt/base height 2}\pgf@circ@res@down-\pgf@circ@res@other}%
10682 }{\pgfpoint
10683 {\pgf@circ@res@right}%
10684 {\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth-\pgf@circ@res@other}%
10685 }
10686 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
10687 \endpgfscope
10688 \fi
10689 \repeatpgfmathloop
10690 \endpgfscope
10691 }
10692 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
10693 % and is executed just before a node is drawn.
10694 \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@bjt#1\endcsname{%
10695 % Start with the maximum collector number and go backwards.
10696 \pgf@circ@count@a=\numC\relax
10697 \pgfmathloop%
10698 \ifnum\pgf@circ@count@a>0
10699 % we will create two anchors per pin: the "normal one" like `pin 1` for the
10700 % electrical contact, and the "border one" like `bpin 1` for labels.
10701 % they will coincide if `external pins width` is set to 0.
10702 \expandafter\xdef\csname pgf@anchor@bjt#1@C\the\pgf@circ@count@a\endcsname{%
10703 \noexpand\pgf@circ@bjt@C@anchor{\the\pgf@circ@count@a}%
10704 }
10705 \advance\pgf@circ@count@a by -1\relax%
10706 \repeatpgfmathloop%
10707 % and emitters
10708 \pgf@circ@count@a=\numE\relax
10709 \pgfmathloop%
10710 \ifnum\pgf@circ@count@a>0
10711 % we will create two anchors per pin: the "normal one" like `pin 1` for the
10712 % electrical contact, and the "border one" like `bpin 1` for labels.
10713 % they will coincide if `external pins width` is set to 0.
10714 \expandafter\xdef\csname pgf@anchor@bjt#1@E\the\pgf@circ@count@a\endcsname{%
10715 \noexpand\pgf@circ@bjt@E@anchor{\the\pgf@circ@count@a}%
10716 }
10717 \advance\pgf@circ@count@a by -1\relax%
10718 \repeatpgfmathloop%
10719 }%
10720 }
10721 }
10722
10723 \declarebjt{npn}
10724 \declarebjt{pnp}
10725
10726 % end of multi-bjts
10727
10728 \long\def\declareigbt#1{
10729 \pgfcircdeclaretransistor{#1}{
10730 \anchor{inner up}{
10731 \northeast
10732 \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
10733 }
10734 \anchor{inner down}{
10735 \northeast
10736 \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
10737 }
10738 }
10739 {
10740 %draw upper connection
10741 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10742 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10743 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
10744 \pgfpathlineto{\pgfpoint
10745 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10746 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}}
10747 \pgfusepath{draw}
10748
10749 %draw thicker gate lines
10750 \pgfscope
10751 \pgfpathmoveto{\pgfpoint
10752 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
10753 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
10754 \pgfpathlineto{\pgfpoint
10755 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
10756 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
10757 \pgfpathmoveto{\pgfpoint
10758 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10759 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
10760 \pgfpathlineto{\pgfpoint
10761 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10762 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
10763 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10764 \pgfusepath{draw}
10765 \endpgfscope
10766 %draw lower connection
10767 \pgfpathmoveto{\pgfpoint
10768 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
10769 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}}
10770 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10771 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
10772 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10773 \pgfusepath{draw}
10774 %draw arrow depending on type of transistor
10775 \pgfscope
10776 \pgfslopedattimetrue
10777 \pgfallowupsidedownattimetrue
10778 \pgfresetnontranslationattimefalse
10779 \ifpgf@circuit@trans@arrowatend
10780 \ifpgf@circuit@trans@ntype
10781 \edef\@@anchor{btip}\edef\@@pos{1.0}
10782 \else
10783 \edef\@@anchor{tip}\edef\@@pos{1.0}
10784 \fi
10785 \else
10786 \edef\@@anchor{center}\edef\@@pos{0.5}
10787 \fi
10788 \ifpgf@circuit@trans@ntype
10789 \pgftransformlineattime{\@@pos}{%
10790 \pgfpoint%
10791 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10792 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}%
10793 }{%
10794 \pgfpoint{\pgf@circ@res@right}%
10795 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}%
10796 }
10797 \else
10798 \pgftransformlineattime{\@@pos}{%
10799 \pgfpoint{\pgf@circ@res@right}%
10800 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}%
10801 }{%
10802 \pgfpoint{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
10803 {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}%
10804 }
10805 \fi
10806 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
10807 \endpgfscope
10808 %draw gate
10809 \ifpgf@circuit@trans@ntype
10810 \pgfpathmoveto{\pgfpoint
10811 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
10812 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
10813 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
10814 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
10815 \else
10816 \pgfpathmoveto{\pgfpoint
10817 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
10818 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
10819 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
10820 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@up}}
10821 \fi
10822 \pgfusepath{draw}
10823 }
10824 }
10825
10826 \declareigbt{pigbt}
10827 \declareigbt{nigbt}
10828 \declareigbt{Lnigbt}
10829 \declareigbt{Lpigbt}
10830
10831 \pgfcircdeclaretransistor{nmos}{
10832 \anchor{inner up}{
10833 \northeast
10834 \pgf@y=\ctikzvalof{tripoles/nmos/gate height}\pgf@y
10835 }
10836 \anchor{inner down}{
10837 \northeast
10838 \pgf@y=-\ctikzvalof{tripoles/nmos/gate height}\pgf@y
10839 }
10840 }{%
10841 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10842 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10843 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
10844 \pgfpathlineto{\pgfpoint
10845 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
10846 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
10847
10848 \pgfpathmoveto{\pgfpoint
10849 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
10850 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
10851 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10852 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
10853 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10854 \pgfusepath{draw}
10855
10856 \pgfscope
10857 \pgfpathmoveto{\pgfpoint
10858 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
10859 {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@up}}
10860 \pgfpathlineto{\pgfpoint
10861 {\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
10862 {\ctikzvalof{tripoles/nmos/base height}\pgf@circ@res@down}}
10863 \pgfpathmoveto{\pgfpoint
10864 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
10865 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
10866 \pgfpathlineto{\pgfpoint
10867 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
10868 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}}
10869 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10870 \pgfusepath{draw}
10871 \endpgfscope
10872 \ifpgf@circuit@mos@arrows
10873 \pgfscope
10874 \ifpgf@circuit@trans@arrowatend
10875 \pgftransformshift{\pgfpoint
10876 {\pgf@circ@res@right}%
10877 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}%
10878 }
10879 \pgfnode{trarrow}{btip}{}{}{\pgfusepath{stroke}}
10880 \else
10881 \pgfslopedattimetrue
10882 \pgfallowupsidedownattimetrue
10883 \pgfresetnontranslationattimefalse
10884 \pgftransformlineattime{\ctikzvalof{tripoles/nmos/arrow pos}}{%
10885 \pgfpoint%
10886 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}%
10887 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
10888 }{%
10889 \pgfpoint
10890 {\pgf@circ@res@right}%
10891 {\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@down}%
10892 }
10893 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10894 \fi
10895 \endpgfscope
10896 \fi
10897
10898 \ifpgf@circuit@bpt@drawgate
10899 \pgfpathmoveto{\pgfpoint
10900 {\ctikzvalof{tripoles/nmos/gate width}\pgf@circ@res@left}
10901 {\pgf@circ@res@up+\pgf@circ@res@down}}
10902 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
10903 \pgfusepath{draw}
10904 \fi
10905
10906 \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
10907 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/nmos/base width}\pgf@circ@res@left}
10908 {\pgf@circ@res@up+\pgf@circ@res@down}}
10909 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
10910 {\pgf@circ@res@up+\pgf@circ@res@down}}
10911 \pgfusepath{draw}
10912 \fi
10913 }
10914
10915 \pgfcircdeclaretransistor{pmos}{
10916 \anchor{inner up}{
10917 \northeast
10918 \pgf@y=\ctikzvalof{tripoles/pmos/gate height}\pgf@y
10919 }
10920 \anchor{inner down}{
10921 \northeast
10922 \pgf@y=-\ctikzvalof{tripoles/pmos/gate height}\pgf@y
10923 }
10924 }{%
10925 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10926 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10927 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
10928 \pgfpathlineto{\pgfpoint
10929 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
10930 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
10931 \pgfusepath{draw}
10932
10933 \ifpgf@circuit@mos@arrows
10934 \pgfscope
10935 \ifpgf@circuit@trans@arrowatend
10936 \pgftransformshift{\pgfpoint
10937 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}%
10938 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
10939 }
10940 \pgftransformrotate{180}
10941 \pgfnode{trarrow}{tip}{}{}{\pgfusepath{stroke}}
10942 \else
10943 \pgfslopedattimetrue
10944 \pgfallowupsidedownattimetrue
10945 \pgfresetnontranslationattimefalse
10946 \pgftransformlineattime{\ctikzvalof{tripoles/pmos/arrow pos}}{%
10947 \pgfpoint%
10948 {\pgf@circ@res@right}%
10949 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
10950 }{%
10951 \pgfpoint
10952 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}%
10953 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}%
10954 }
10955 \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
10956 \fi
10957 \endpgfscope
10958 \fi
10959
10960 \pgfscope
10961 \pgfpathmoveto{\pgfpoint
10962 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
10963 {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@up}}
10964 \pgfpathlineto{\pgfpoint
10965 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
10966 {\ctikzvalof{tripoles/pmos/base height}\pgf@circ@res@down}}
10967 \pgfpathmoveto{\pgfpoint
10968 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
10969 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
10970 \pgfpathlineto{\pgfpoint
10971 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
10972 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
10973 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
10974 \pgfusepath{draw}
10975 \endpgfscope
10976
10977 \pgfpathmoveto{\pgfpoint
10978 {\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
10979 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
10980 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
10981 {\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@down}}
10982 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
10983
10984
10985 \pgfusepath{draw}
10986 \ifpgf@circuit@bpt@drawgate
10987 \pgfpathmoveto{\pgfpoint
10988 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left}
10989 {\pgf@circ@res@up+\pgf@circ@res@down}}
10990 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
10991 \pgfusepath{draw}
10992 \fi
10993
10994 \ifpgf@circuit@bpt@drawbulk % added by Burak Kelleci
10995 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/pmos/base width}\pgf@circ@res@left}
10996 {\pgf@circ@res@up+\pgf@circ@res@down}}
10997 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
10998 {\pgf@circ@res@up+\pgf@circ@res@down}}
10999 \pgfusepath{draw}
11000 \fi
11001
11002 \ifpgf@circuit@pmos@nocircle\else
11003 % we are not scaling the circle with the MOS --- I think it's better to have it
11004 % coherent with the poles/nodes of the rest of the circuit.
11005 \pgfpathcircle{\pgfpoint
11006 {\ctikzvalof{tripoles/pmos/gate width}\pgf@circ@res@left - \ctikzvalof{nodes width}*\pgf@circ@Rlen}
11007 {\pgf@circ@res@up+\pgf@circ@res@down}}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
11008 \ifpgf@circuit@pmos@emptycircle
11009 \pgfsetfillcolor{white}
11010 \fi
11011 \pgfusepath{draw,fill}
11012 \fi
11013 }
11014
11015 %% HEMT FET Transistor
11016 \pgfcircdeclaretransistor{hemt}{
11017 \anchor{inner up}{
11018 \northeast
11019 \pgf@y=\ctikzvalof{tripoles/hemt/gate height}\pgf@y
11020 }
11021 \anchor{inner down}{
11022 \northeast
11023 \pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y
11024 }
11025 }{%
11026 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11027 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11028 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
11029 \pgfpathlineto{\pgfpoint
11030 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11031 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
11032
11033 \pgfpathmoveto{\pgfpoint
11034 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11035 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
11036 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11037 {\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@down}}
11038 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11039 \pgfusepath{draw}
11040
11041 \pgfscope
11042 \pgfpathmoveto{\pgfpoint
11043 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11044 {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@up}}
11045 \pgfpathlineto{\pgfpoint
11046 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11047 {\ctikzvalof{tripoles/hemt/base height}\pgf@circ@res@down}}
11048 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11049 \pgfusepath{draw}
11050 \endpgfscope
11051
11052 \pgfpathmoveto{\pgfpoint
11053 {\ctikzvalof{tripoles/hemt/base width}\pgf@circ@res@left}
11054 {\pgf@circ@res@up+\pgf@circ@res@down}}
11055 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
11056 \pgfusepath{draw}
11057 }
11058
11059 \long\def\drawfetcore#1{
11060 \pgftransformationadjustments
11061 %top connection
11062 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11063 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11064 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11065 \pgfpathlineto{\pgfpoint
11066 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11067 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}}
11068 \pgfusepath{draw}
11069 \pgfscope
11070 \pgfpathmoveto{\pgfpoint
11071 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11072 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
11073 \ifpgf@circuit@trans@depletiontype
11074 \pgfpathlineto{\pgfpoint
11075 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11076 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11077 \else
11078
11079 \pgfpathlineto{\pgfpoint
11080 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11081 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.45}}
11082 \pgfpathmoveto{\pgfpoint
11083 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11084 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up*0.25}}
11085 \pgfpathlineto{\pgfpoint
11086 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11087 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down*0.25}}
11088 \pgfpathmoveto{\pgfpoint
11089 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11090 {\ctikzvalof{tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
11091 \pgfpathlineto{\pgfpoint
11092 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11093 {\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@down}}
11094 \fi
11095 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11096 \pgfusepath{draw}
11097 \endpgfscope
11098 %Bulk connection line
11099 \pgfpathmoveto{\pgfpoint
11100 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11101 {\pgf@circ@res@up+\pgf@circ@res@down}}
11102 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11103 {\pgf@circ@res@up+\pgf@circ@res@down}}
11104
11105 %bottom connection
11106 \pgfpathmoveto{\pgfpoint
11107 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
11108 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11109 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11110 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}}
11111 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11112 \pgfusepath{draw}
11113
11114 %draw thick gate line
11115 \pgfscope
11116 \pgfpathmoveto{\pgfpoint
11117 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11118 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11119 \pgfpathlineto{\pgfpoint
11120 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11121 {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11122 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11123 \pgfusepath{draw}
11124 \endpgfscope
11125
11126 % arrows
11127 \pgfscope
11128 \pgfslopedattimetrue
11129 \pgfallowupsidedownattimetrue
11130 \pgfresetnontranslationattimefalse
11131 \ifpgf@circuit@trans@arrowatend
11132 \ifpgf@circuit@trans@ntype
11133 \edef\@@anchor{tip}
11134 \edef\@@pos{1.0}
11135 \else
11136 \edef\@@anchor{btip}
11137 \edef\@@pos{0.0}
11138 \fi
11139 \else
11140 \edef\@@anchor{center}\edef\@@pos{0.6}
11141 \fi
11142 \pgftransformlineattime{\@@pos}{%
11143 \pgfpoint
11144 {\pgf@circ@res@right}%
11145 {\pgf@circ@res@up+\pgf@circ@res@down}%
11146 }{%
11147 \pgfpoint%
11148 {\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}%
11149 {\pgf@circ@res@up+\pgf@circ@res@down}%
11150 }
11151 \ifpgf@circuit@trans@ntype
11152 \else
11153 \pgftransformrotate{180}
11154 \fi
11155 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11156 \endpgfscope
11157
11158 % GATE CONNECTION
11159 \ifpgf@circuit@bpt@drawgate
11160 \ifpgf@circuit@trans@ntype
11161 \pgfpathmoveto{\pgfpoint
11162 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11163 {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11164 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11165 \else
11166 \pgfpathmoveto{\pgfpoint
11167 {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left}
11168 {-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11169 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}}
11170 \fi
11171 \pgfusepath{draw}
11172 \fi
11173
11174 }
11175
11176 \long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
11177 {\pgfcircdeclaretransistor{#1}{
11178 \anchor{bulk}{\left\pgf@x=0pt}
11179 \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
11180 \anchor{inner up}{
11181 \northeast
11182 \pgf@y=\ctikzvalof{tripoles/#1/gate height}\pgf@y
11183 }
11184 \anchor{inner down}{
11185 \northeast
11186 \pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
11187 }
11188 #2
11189 }
11190 {#3}
11191 }
11192
11193 \pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
11194 \pgf@circuit@trans@depletiontypefalse
11195 \drawfetcore{nfet}
11196 }
11197
11198 \pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
11199 \pgf@circuit@trans@depletiontypefalse
11200 \drawfetcore{pfet}
11201 }
11202
11203 % N-CHANNEL IGFET ENHANCEMENT TYPE
11204 \pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
11205 \pgf@circuit@trans@depletiontypefalse
11206 \drawfetcore{nigfete}
11207
11208 % SOURCE CONNECTION
11209 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11210 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11211 \pgfusepath{draw}
11212
11213 % SOLDER DOT at source-bulk connection
11214 \ifpgf@circuit@fet@solderdot
11215 \pgfscope
11216 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11217 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11218 \pgfnode{circ}{center}{}{}{}
11219 \endpgfscope{}
11220 \fi
11221 }
11222
11223 % N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
11224 \pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
11225 \pgf@circuit@trans@depletiontypefalse
11226 \drawfetcore{nigfetebulk}
11227 % SOLDER DOT at source-bulk connection
11228 \ifpgf@circuit@fet@solderdot
11229 \pgfscope
11230 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11231 \ctikzvalof{tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
11232 \pgfnode{circ}{center}{}{}{}
11233 \endpgfscope{}
11234 \fi
11235 }
11236
11237 % N-CHANNEL IGFET DEPLETION TYPE
11238 \pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
11239 \pgf@circuit@trans@depletiontypetrue
11240 \drawfetcore{nigfetd}
11241
11242 % SOURCE CONNECTION
11243 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11244 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
11245 \pgfusepath{draw}
11246
11247 % SOLDER DOT at source-bulk connection
11248 \ifpgf@circuit@fet@solderdot
11249 \pgfscope
11250 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11251 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11252 \pgfnode{circ}{center}{}{}{}
11253 \endpgfscope{}
11254 \fi
11255 }
11256
11257 % P-CHANNEL IGFET ENHANCEMENT TYPE
11258 \pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
11259 \pgf@circuit@trans@depletiontypefalse
11260 \drawfetcore{pigfete}
11261 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11262
11263 % SOURCE CONNECTION
11264 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11265 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11266 \pgfusepath{draw}
11267
11268
11269 % SOLDER DOT at source-bulk connection
11270 \ifpgf@circuit@fet@solderdot
11271 \pgfscope
11272 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11273 \ctikzvalof{tripoles/pigfete/gate height}\pgf@circ@res@up}}
11274 \pgfnode{circ}{center}{}{}{}
11275 \endpgfscope
11276 \fi
11277 }
11278
11279 % P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
11280 \pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
11281 \pgf@circuit@trans@depletiontypefalse
11282 \drawfetcore{pigfetebulk}
11283 }
11284
11285 % P-CHANNEL IGFET DEPLETION TYPE
11286 \pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
11287 \pgf@circuit@trans@depletiontypetrue
11288 \drawfetcore{pigfetd}
11289
11290 % SOURCE CONNECTION
11291 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11292 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
11293 \pgfusepath{draw}
11294
11295
11296 % SOLDER DOT at source-bulk connection
11297 \ifpgf@circuit@fet@solderdot
11298 \pgfscope
11299 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11300 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@up}}
11301 \pgfnode{circ}{center}{}{}{}
11302 \endpgfscope{}
11303 \fi
11304 }
11305
11306 \pgfcircdeclaretransistor{njfet}{
11307 \anchor{inner up}{
11308 \northeast
11309 \pgf@y=\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
11310 }
11311 \anchor{inner down}{
11312 \northeast
11313 \pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
11314 }
11315 }{%
11316 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11317 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11318 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
11319 \pgfpathlineto{\pgfpoint
11320 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11321 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
11322
11323 \pgfpathmoveto{\pgfpoint
11324 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11325 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11326 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11327 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11328 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11329 \pgfusepath{draw}
11330
11331 \pgfscope
11332 \pgfpathmoveto{\pgfpoint
11333 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11334 {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@up}}
11335 \pgfpathlineto{\pgfpoint
11336 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11337 {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@down}}
11338 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11339 \pgfusepath{draw}
11340 \endpgfscope
11341
11342 % arrow
11343 \pgfscope
11344 \pgfslopedattimetrue
11345 \pgfallowupsidedownattimetrue
11346 \pgfresetnontranslationattimefalse
11347 \ifpgf@circuit@trans@arrowatend
11348 \edef\@@anchor{tip}\edef\@@pos{1.0}
11349 \else
11350 \edef\@@anchor{center}\edef\@@pos{0.6}
11351 \fi
11352 \pgftransformlineattime{\@@pos}{%
11353 \pgfpoint{\pgf@circ@res@left}%
11354 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
11355 }{%
11356 \pgfpoint
11357 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}%
11358 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}%
11359 }
11360 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11361 \endpgfscope
11362
11363 \pgfpathmoveto{\pgfpoint
11364 {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}
11365 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11366 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11367 {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}}
11368 \pgfusepath{draw}
11369 }
11370
11371 \pgfcircdeclaretransistor{pjfet}{
11372 \anchor{inner up}{
11373 \northeast
11374 \pgf@y=\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
11375 }
11376 \anchor{inner down}{
11377 \northeast
11378 \pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
11379 }
11380 }{%
11381 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11382 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11383 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11384 \pgfpathlineto{\pgfpoint
11385 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11386 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11387
11388 \pgfpathmoveto{\pgfpoint
11389 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11390 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
11391 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11392 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
11393 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11394 \pgfusepath{draw}
11395
11396 \pgfscope
11397 \pgfpathmoveto{\pgfpoint
11398 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11399 {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@up}}
11400 \pgfpathlineto{\pgfpoint
11401 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11402 {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@down}}
11403 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11404 \pgfusepath{draw}
11405 \endpgfscope
11406
11407 \pgfscope
11408 \pgfslopedattimetrue
11409 \pgfallowupsidedownattimetrue
11410 \pgfresetnontranslationattimefalse
11411 \ifpgf@circuit@trans@arrowatend
11412 \edef\@@anchor{btip}\edef\@@pos{1.0}
11413 \else
11414 \edef\@@anchor{center}\edef\@@pos{0.4}
11415 \fi
11416 \pgftransformlineattime{\@@pos}{%
11417 \pgfpoint%
11418 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}%
11419 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
11420 }{%
11421 \pgfpoint{\pgf@circ@res@left}%
11422 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
11423 }
11424 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11425 \endpgfscope
11426
11427 \pgfpathmoveto{\pgfpoint
11428 {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}
11429 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11430 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
11431 {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
11432 \pgfusepath{draw}
11433 }
11434
11435 \pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
11436 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11437 % DRAIN CONNECTION
11438 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11439 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
11440 % DRAIN
11441 \pgfpathlineto{\pgfpoint
11442 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11443 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@up}}
11444 \pgfusepath{draw}
11445
11446 % GATE, DEPLETION TYPE
11447 \pgfscope %% added
11448 \pgfpathmoveto{\pgfpoint
11449 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11450 {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@up}}
11451 \pgfpathlineto{\pgfpoint
11452 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11453 {\ctikzvalof{tripoles/isfet/base height}\pgf@circ@res@down}}
11454 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} %% added
11455 \pgfusepath{draw} %% added
11456 \endpgfscope %% added
11457
11458 % BULK
11459 \pgfpathmoveto{\pgfpoint
11460 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11461 {\pgf@circ@res@up+\pgf@circ@res@down}}
11462 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
11463 {\pgf@circ@res@up+\pgf@circ@res@down}}
11464
11465 % SOURCE
11466 \pgfpathmoveto{\pgfpoint
11467 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}
11468 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
11469 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
11470 {\ctikzvalof{tripoles/isfet/gate height}\pgf@circ@res@down}}
11471 % SOURCE CONNECTION
11472 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11473 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
11474 \pgfusepath{draw}
11475
11476 % SOLDER DOT at source-bulk connection
11477 \ifpgf@circuit@fet@solderdot
11478 \pgfscope
11479 \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
11480 \ctikzvalof{tripoles/nigfete/gate height}\pgf@circ@res@down}}
11481 \pgfnode{circ}{center}{}{}{}
11482 \endpgfscope{}
11483 \fi
11484 % ARROW
11485 \pgfscope
11486 \pgfslopedattimetrue
11487 \pgfallowupsidedownattimetrue
11488 \pgfresetnontranslationattimefalse
11489 \ifpgf@circuit@trans@arrowatend
11490 \edef\@@anchor{tip}\edef\@@pos{1.0}
11491 \else
11492 \edef\@@anchor{center}\edef\@@pos{0.6}
11493 \fi
11494 \pgftransformlineattime{\@@pos}{%
11495 \pgfpoint
11496 {\pgf@circ@res@right}%
11497 {\pgf@circ@res@up+\pgf@circ@res@down}%
11498 }{%
11499 \pgfpoint%
11500 {\ctikzvalof{tripoles/isfet/base width}\pgf@circ@res@left}%
11501 {\pgf@circ@res@up+\pgf@circ@res@down}%
11502 }
11503 \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}}
11504 \endpgfscope
11505 \pgfusepath{draw}
11506
11507 % Wavy lines
11508 \pgfscope
11509 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
11510 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11511 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11512 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11513 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11514 \pgfusepath{draw}
11515
11516 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
11517 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11518 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11519 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11520 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11521 \pgfusepath{draw}
11522
11523 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/waves y sep}\pgf@circ@res@up}}
11524 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11525 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11526 \pgfpathsine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11527 \pgfpathcosine{\pgfpoint{-\ctikzvalof{tripoles/isfet/wave width}\pgf@circ@res@up}{-\ctikzvalof{tripoles/isfet/wave amp}\pgf@circ@res@up}}
11528 \pgfusepath{draw}
11529 \endpgfscope
11530 }
11531
11532 % end of transistors
11533
11534 %%%%%%%%%%%%%
11535 %% Switches
11536 %%%%%%%%%%%%%
11537
11538 \pgfcircdeclarebipole{
11539 \anchor{out 1}{
11540 \northeast
11541 \pgf@y=0cm
11542 }
11543 \anchor{out 2}{
11544 \northeast
11545 \pgf@y=.8\pgf@y
11546 }
11547 }
11548 {\ctikzvalof{tripoles/toggleswitch/height 2}}
11549 {toggleswitch}
11550 {\ctikzvalof{tripoles/toggleswitch/height}}
11551 {\ctikzvalof{tripoles/toggleswitch/width}}
11552 {
11553
11554 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
11555 \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
11556 \pgfusepath{draw}
11557 \pgfscope
11558 \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
11559 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
11560 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
11561 \pgfusepath{draw}
11562 \endpgfscope
11563
11564 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11565 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
11566
11567 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
11568 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
11569 \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
11570 \pgfusepath{draw}
11571
11572
11573 \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
11574 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
11575 \pgfusepath{draw}
11576
11577 \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}
11578 \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
11579 \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
11580 \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
11581 \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
11582 \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
11583 \pgfusepath{draw}
11584 \pgfsetdash{}{0cm}
11585 }
11586
11587 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11588 %% operational and instrumentation amplifiers
11589 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11590
11591 \pgfdeclareshape{op amp}
11592 {
11593 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
11594 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
11595 \anchor{center}{\pgfpointorigin}
11596 \savedanchor\northwest{%
11597 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11598 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11599 \pgf@y=.5\pgf@y
11600 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11601 \pgf@x=.5\pgf@x
11602 }
11603 \anchor{south}{
11604 \northwest
11605 \pgf@y=-\pgf@y
11606 \pgf@x=0pt
11607 }
11608 \anchor{north}{
11609 \northwest
11610 \pgf@x=0pt
11611 }
11612 \savedanchor\left{%
11613 \pgf@y=0pt
11614 }
11615 \anchor{leftedge}
11616 {\left
11617 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
11618 }
11619 \savedanchor\inOneFixed{%
11620 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11621 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11622 \pgf@y=.5\pgf@y
11623 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
11624 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11625 \pgf@x=.5\pgf@x
11626 }
11627 \anchor{in up}{
11628 \inOneFixed
11629 }
11630 \anchor{in down}{
11631 \inOneFixed
11632 \pgf@y=-\pgf@y
11633 }
11634 \savedanchor\inOne{%
11635 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11636 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11637 \pgf@y=.5\pgf@y
11638 \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
11639 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11640 \pgf@x=.5\pgf@x
11641 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11642 }
11643 \anchor{-}{
11644 \inOne
11645 }
11646 \anchor{+}{
11647 \inOne
11648 \pgf@y=-\pgf@y
11649 }
11650 \savedanchor\up{%
11651 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11652 \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@scaled@Rlen
11653 \pgf@y=.5\pgf@y
11654 \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@scaled@Rlen
11655 \pgf@x=.5\pgf@x
11656 \pgf@circ@res@up = \pgf@y
11657 \pgf@circ@res@right = -\pgf@x
11658 \pgf@circ@res@left = \pgf@x
11659 \pgfpointlineattime{
11660 \ctikzvalof{tripoles/op amp/up pos}}{
11661 \pgfpoint{
11662 \ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
11663 {\pgf@circ@res@up}}
11664 {\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
11665 }
11666 \anchor{up}{
11667 \up
11668 }
11669 \anchor{down}{
11670 \up
11671 \pgf@y=-\pgf@y
11672 }
11673 \anchor{out}{
11674 \northwest
11675 \pgf@y=0pt
11676 \pgf@x=-\pgf@x
11677 }
11678 \anchor{west}{
11679 \left
11680 }
11681 \anchor{east}{
11682 \left
11683 \pgf@x=-\pgf@x
11684 }
11685
11686 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11687 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11688 \anchor{north west}{ \northwest }
11689 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11690
11691 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11692
11693 \backgroundpath{
11694 \pgfsetcolor{\ctikzvalof{color}}
11695
11696 \northwest
11697 \pgf@circ@res@up = \pgf@y
11698 \pgf@circ@res@down = -\pgf@y
11699 \pgf@circ@res@right = -\pgf@x
11700 \pgf@circ@res@left = \pgf@x
11701 \pgf@circ@scaled@Rlen=\scaledRlen
11702
11703 % Triangle
11704 \pgfscope
11705 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11706 \pgftransformxshift{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
11707 \pgf@circ@res@step=\pgf@circ@res@right
11708 \advance\pgf@circ@res@step by -\pgf@circ@res@left
11709 \pgf@circ@res@step=\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@step
11710
11711 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
11712 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
11713 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
11714 \pgfpathclose
11715 \pgf@circ@draworfill
11716 \endpgfscope
11717
11718 % Negative input terminal
11719 \pgfpathmoveto{\pgfpoint
11720 {\pgf@circ@res@left}
11721 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
11722 \pgfpathlineto{\pgfpoint
11723 {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
11724 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
11725 \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}
11726
11727 % Positive input terminal
11728 \pgfpathmoveto{\pgfpoint
11729 {\pgf@circ@res@left}
11730 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
11731 \pgfpathlineto{\pgfpoint
11732 {\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
11733 {\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
11734 \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}
11735
11736 % Output terminal
11737 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11738 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
11739 \pgfsetrectcap
11740 \pgfusepath{draw}
11741 }
11742 }
11743
11744 % Op amp shape as in european standard EN 60617
11745 \pgfdeclareshape{en amp}
11746 {
11747 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
11748 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
11749 \anchor{center}{\pgfpointorigin}
11750 \savedanchor\northwest{%
11751 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11752 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
11753 \pgf@y=.5\pgf@y
11754 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
11755 \pgf@x=.5\pgf@x
11756 }
11757 \anchor{south}{
11758 \northwest
11759 \pgf@y=-\pgf@y
11760 \pgf@x=0pt
11761 }
11762 \anchor{north}{
11763 \northwest
11764 \pgf@x=0pt
11765 }
11766 \savedanchor\left{%
11767 \pgf@y=0pt
11768 }
11769 \anchor{leftedge}
11770 {
11771 \left
11772 \pgf@x = \ctikzvalof{tripoles/en amp/port width}\pgf@x
11773 }
11774 \savedanchor\inOneFixed{%
11775 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11776 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
11777 \pgf@y=.5\pgf@y
11778 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
11779 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
11780 \pgf@x=.5\pgf@x
11781 }
11782 \anchor{in up}{
11783 \inOneFixed
11784 }
11785 \anchor{in down}{
11786 \inOneFixed
11787 \pgf@y=-\pgf@y
11788 }
11789 \savedanchor\inOne{%
11790 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11791 \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@scaled@Rlen
11792 \pgf@y=.5\pgf@y
11793 \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
11794 \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@scaled@Rlen
11795 \pgf@x=.5\pgf@x
11796 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11797 }
11798 \anchor{-}{
11799 \inOne
11800 }
11801 \anchor{+}{
11802 \inOne
11803 \pgf@y=-\pgf@y
11804 }
11805 \anchor{up}{
11806 \northwest
11807 \pgf@x=0pt
11808 }
11809 \anchor{down}{
11810 \northwest
11811 \pgf@x=0pt
11812 \pgf@y=-\pgf@y
11813 }
11814 \anchor{out}{
11815 \northwest
11816 \pgf@y=0pt
11817 \pgf@x=-\pgf@x
11818 }
11819 \anchor{west}{
11820 \left
11821 }
11822 \anchor{east}{
11823 \left
11824 \pgf@x=-\pgf@x
11825 }
11826 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11827 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
11828 \anchor{north west}{ \northwest }
11829 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
11830 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
11831
11832 \backgroundpath{
11833 \pgfsetcolor{\ctikzvalof{color}}
11834 \northwest
11835 \pgf@circ@res@up = \pgf@y
11836 \pgf@circ@res@down = -\pgf@y
11837 \pgf@circ@res@right = -\pgf@x
11838 \pgf@circ@res@left = \pgf@x
11839 \pgf@circ@scaled@Rlen=\scaledRlen
11840
11841 \pgfscope
11842 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
11843 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
11844 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
11845 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
11846 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
11847 \pgfpathclose
11848 \pgf@circ@draworfill
11849 \endpgfscope
11850
11851 \pgfpathmoveto{\pgfpoint
11852 {\pgf@circ@res@left}
11853 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
11854 \pgfpathlineto{\pgfpoint
11855 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
11856 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
11857 \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}
11858
11859 \pgfpathmoveto{\pgfpoint
11860 {\pgf@circ@res@left}
11861 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
11862 \pgfpathlineto{\pgfpoint
11863 {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
11864 {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
11865 \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}
11866
11867 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
11868 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
11869 \pgfsetrectcap
11870 \pgfusepath{draw}
11871
11872
11873 \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
11874 % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
11875 }
11876 }
11877
11878 % Fully differential output op amp
11879 % Contributed by Kristofer M. Monisit
11880 \pgfdeclareshape{fd op amp}
11881 {
11882 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
11883 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
11884 \anchor{center}{\pgfpointorigin}
11885 \savedanchor\northwest{%
11886 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11887 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
11888 \pgf@y=.5\pgf@y
11889 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
11890 \pgf@x=.5\pgf@x
11891 }
11892 \savedanchor\outline{%
11893 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11894 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
11895 \pgf@y=.5\pgf@y
11896 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
11897 \pgf@x=.5\pgf@x
11898 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
11899 }
11900 \anchor{south}{
11901 \northwest
11902 \pgf@y=-\pgf@y\pgf@x=0pt\relax
11903 }
11904 \anchor{north}{
11905 \northwest\pgf@x=0pt\relax
11906 }
11907 \savedanchor\left{%
11908 \pgf@y=0pt
11909 }
11910 \savedanchor\inOneFixed{%
11911 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11912 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
11913 \pgf@y=.5\pgf@y
11914 \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
11915 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
11916 \pgf@x=.5\pgf@x
11917 }
11918 \anchor{in up}{
11919 \inOneFixed
11920 }
11921 \anchor{in down}{
11922 \inOneFixed
11923 \pgf@y=-\pgf@y
11924 }
11925 \savedanchor\inOne{%
11926 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11927 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
11928 \pgf@y=.5\pgf@y
11929 \pgf@y=\ctikzvalof{tripoles/fd op amp/input height}\pgf@y
11930 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
11931 \pgf@x=.5\pgf@x
11932 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
11933 }
11934 \anchor{-}{
11935 \inOne
11936 }
11937 \anchor{+}{
11938 \inOne
11939 \pgf@y=-\pgf@y
11940 }
11941 \savedanchor\up{%
11942 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
11943 \pgf@y=\ctikzvalof{tripoles/fd op amp/height}\pgf@circ@scaled@Rlen
11944 \pgf@y=.5\pgf@y
11945 \pgf@x=-\ctikzvalof{tripoles/fd op amp/width}\pgf@circ@scaled@Rlen
11946 \pgf@x=.5\pgf@x
11947 \pgf@circ@res@up = \pgf@y
11948 \pgf@circ@res@right = -\pgf@x
11949 \pgf@circ@res@left = \pgf@x
11950 \pgfpointlineattime{
11951 \ctikzvalof{tripoles/fd op amp/up pos}}{
11952 \pgfpoint{
11953 \ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
11954 {\pgf@circ@res@up}}
11955 {\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@right}{0pt}}
11956 }
11957 \anchor{up}{
11958 \up
11959 }
11960 \anchor{down}{
11961 \up
11962 \pgf@y=-\pgf@y
11963 }
11964 \anchor{out up}{
11965 \northwest
11966 \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
11967 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
11968 }
11969 \anchor{out down}{
11970 \northwest
11971 \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
11972 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
11973 }
11974 \anchor{out +}{
11975 \outline
11976 \pgf@y=\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
11977 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
11978 }
11979 \anchor{out -}{
11980 \outline
11981 \pgf@y=-\ctikzvalof{tripoles/fd op amp/output height}\pgf@y
11982 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
11983 }
11984 \anchor{west}{
11985 \left
11986 }
11987 \anchor{east}{
11988 \left
11989 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
11990 }
11991 \anchor{out}{% should not be used
11992 \left
11993 \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x
11994 }
11995 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
11996 \anchor{north east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x }
11997 \anchor{north west}{ \northwest }
11998 \anchor{south east}{ \northwest \pgf@x=-\ctikzvalof{tripoles/fd op amp/port width}\pgf@x \pgf@y=-\pgf@y }
11999 \backgroundpath{
12000 \pgfsetcolor{\ctikzvalof{color}}
12001
12002 \northwest
12003 \pgf@circ@res@up = \pgf@y
12004 \pgf@circ@res@down = -\pgf@y
12005 \pgf@circ@res@right = -\pgf@x
12006 \pgf@circ@res@left = \pgf@x
12007 \pgf@circ@scaled@Rlen=\scaledRlen
12008
12009 % Triangle
12010 % Includes output terminals to ensure that diagonal joins are properly displayed
12011 \pgfscope
12012 \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
12013 \pgftransformxshift{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12014 \pgf@circ@res@step=\pgf@circ@res@right
12015 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12016 \pgf@circ@res@step=\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@step
12017
12018 % Initial point (right vertex)
12019 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12020
12021 % Negative output terminal
12022 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
12023 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@up}}
12024 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@up}}}
12025
12026 % Top vertex
12027 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12028
12029 % Bottom vertex
12030 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12031
12032 % Positive output terminal
12033 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
12034 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\ctikzvalof{tripoles/fd op amp/output height}\pgf@circ@res@down}}
12035 \pgfpathlineto{\pgfpointlineattime{\ctikzvalof{tripoles/fd op amp/output height}}{\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{\pgf@circ@res@down}}}
12036
12037 % Right vertex
12038 \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12039
12040 \pgfpathclose
12041 \pgf@circ@draworfill
12042 \endpgfscope
12043
12044 % Negative input terminal
12045 \pgfpathmoveto{\pgfpoint
12046 {\pgf@circ@res@left}
12047 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
12048 \pgfpathlineto{\pgfpoint
12049 {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12050 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
12051 \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}
12052
12053 % Positive input terminal
12054 \pgfpathmoveto{\pgfpoint
12055 {\pgf@circ@res@left}
12056 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
12057 \pgfpathlineto{\pgfpoint
12058 {\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
12059 {\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
12060 \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}
12061
12062 % Negative output terminal label
12063 \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}
12064
12065 % Positive output terminal label
12066 \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}
12067
12068 \pgfsetrectcap
12069 \pgfusepath{draw}
12070 }
12071 }
12072
12073
12074 % Instrumentation amplifier with differential output
12075 \pgfdeclareshape{fd inst amp}
12076 {
12077 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12078 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12079 % when tikz calls the anchor it wants the relative position in the lengths
12080 % \pgf@x \pgf@y
12081 % \pgfpoint* functions set that variables
12082 % anchors are visible outside and run on use
12083 \anchor{center}{\pgfpointorigin}
12084 % savedanchors are internals and run on node creation (not use)
12085 % bounding-box top left
12086 \savedanchor\northwest{%
12087 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12088 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12089 \pgf@y=.5\pgf@y
12090 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12091 \pgf@x=.5\pgf@x
12092 }
12093 \anchor{nw}{
12094 \northwest
12095 }
12096 \anchor{south}{
12097 \northwest
12098 \pgf@y=-\pgf@y\pgf@x=0pt\relax
12099 }
12100 \anchor{north}{
12101 \northwest\pgf@x=0pt\relax
12102 }
12103 \savedanchor\left{%
12104 \pgf@y=0pt
12105 }
12106 \anchor{leftedge}
12107 {\left
12108 \pgf@x = \ctikzvalof{tripoles/fd inst amp/port width}\pgf@x
12109 }
12110 \savedanchor\inOneFixed{%
12111 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12112 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12113 \pgf@y=.5\pgf@y
12114 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12115 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12116 \pgf@x=.5\pgf@x
12117 }
12118 \anchor{in up}{
12119 \inOneFixed
12120 }
12121 \anchor{in down}{
12122 \inOneFixed
12123 \pgf@y=-\pgf@y
12124 }
12125 \savedanchor\inOne{%
12126 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12127 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12128 \pgf@y=.5\pgf@y
12129 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12130 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12131 \pgf@x=.5\pgf@x
12132 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12133 }
12134 \anchor{-}{
12135 \inOne
12136 }
12137 \anchor{+}{
12138 \inOne
12139 \pgf@y=-\pgf@y
12140 }
12141 \savedanchor\up{%
12142 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12143 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12144 \pgf@y=.5\pgf@y
12145 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12146 \pgf@x=.5\pgf@x
12147 \pgf@circ@res@up = \pgf@y
12148 \pgf@circ@res@right = -\pgf@x
12149 \pgf@circ@res@left = \pgf@x
12150 \pgfpointlineattime{
12151 \ctikzvalof{tripoles/fd inst amp/up pos}}{
12152 \pgfpoint{
12153 \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12154 {\pgf@circ@res@up}}
12155 {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
12156 }
12157 \anchor{up}{
12158 \up
12159 }
12160 \anchor{down}{
12161 \up
12162 \pgf@y=-\pgf@y
12163 }
12164 % reference voltage input anchors.
12165 \savedanchor\refv{%
12166 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12167 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12168 \pgf@y=.5\pgf@y
12169 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12170 \pgf@x=.5\pgf@x
12171 \pgf@circ@res@up = \pgf@y
12172 \pgf@circ@res@right = -\pgf@x
12173 \pgf@circ@res@left = \pgf@x
12174 \pgfpointlineattime{
12175 \ctikzvalof{tripoles/fd inst amp/refv pos}}{
12176 \pgfpoint{
12177 \ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12178 {\pgf@circ@res@up}}
12179 {\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/height 2}\pgf@circ@res@up}}
12180 }
12181 % we need both because they are normally drawn under the amp, and if you
12182 % mirror it vertically you need them
12183 \anchor{refv up}{
12184 \refv
12185 }
12186 \anchor{refv down}{
12187 \refv
12188 \pgf@y=-\pgf@y
12189 }
12190 \savedanchor\outport{
12191 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12192 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12193 \pgf@y=.5\pgf@y
12194 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12195 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12196 \pgf@x=-.5\pgf@x
12197 \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
12198 }
12199 \anchor{out}{
12200 \outport
12201 \pgf@y=0pt
12202 }
12203 \anchor{out +}{
12204 \outport
12205 }
12206 \anchor{out -}{
12207 \outport
12208 \pgf@y=-\pgf@y
12209 }
12210 \savedanchor\outportfixed{
12211 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12212 \pgf@y=\ctikzvalof{tripoles/fd inst amp/height}\pgf@circ@scaled@Rlen
12213 \pgf@y=.5\pgf@y
12214 \pgf@y=\ctikzvalof{tripoles/fd inst amp/input height}\pgf@y
12215 \pgf@x=-\ctikzvalof{tripoles/fd inst amp/width}\pgf@circ@scaled@Rlen
12216 \pgf@x=-.5\pgf@x
12217 }
12218 \anchor{out up}{
12219 \outportfixed
12220 }
12221 \anchor{out down}{
12222 \outportfixed
12223 \pgf@y=-\pgf@y
12224 }
12225 %
12226 \anchor{west}{
12227 \left
12228 }
12229 \anchor{east}{
12230 \left
12231 \pgf@x=-\pgf@x
12232 }
12233 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12234 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12235 \anchor{north west}{ \northwest }
12236 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12237 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12238
12239 % let's start drawing the component
12240 \backgroundpath{
12241 \pgfsetcolor{\ctikzvalof{color}}
12242 %
12243 \northwest
12244 \pgf@circ@res@up = \pgf@y
12245 \pgf@circ@res@down = -\pgf@y
12246 \pgf@circ@res@right = -\pgf@x
12247 \pgf@circ@res@left = \pgf@x
12248 \pgf@circ@scaled@Rlen=\scaledRlen
12249 % main component, normally in thicker lines
12250 \pgfscope
12251 \newdimen\pgf@circ@res@right@double
12252 \pgf@circ@res@right@double=2\pgf@circ@res@right
12253
12254 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12255 \pgftransformxshift{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12256 \pgf@circ@res@step=\pgf@circ@res@right
12257 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12258 \pgf@circ@res@step=\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@step
12259 %first point (near output)
12260 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right@double}{0}}
12261 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
12262 \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}}
12263 % and then to the input "front up", "down", to the output short side "down"
12264 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12265 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12266 \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}}
12267 % ...and close
12268 \pgfpathclose
12269 \pgf@circ@draworfill
12270 \endpgfscope
12271
12272 % input terminal up
12273 \pgfpathmoveto{\pgfpoint
12274 {\pgf@circ@res@left}
12275 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
12276 %
12277 \pgfpathlineto{\pgfpoint
12278 {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12279 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
12280 %
12281 \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}
12282
12283 % input terminal down
12284 \pgfpathmoveto{\pgfpoint
12285 {\pgf@circ@res@left}
12286 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
12287 %
12288 \pgfpathlineto{\pgfpoint
12289 {\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
12290 {\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
12291 \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}
12292
12293 % output leads down and up
12294 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}}
12295 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} %
12296 \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}
12297
12298 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}}
12299 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} %
12300 \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}
12301 %
12302 \pgfsetrectcap
12303 \pgfusepath{draw}
12304 }
12305 }
12306
12307 % Transconductance amplifier (Transkonduktanzverstärker)
12308 \pgfdeclareshape{gm amp}
12309 {
12310 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12311 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12312 \anchor{center}{\pgfpointorigin}
12313 \savedanchor\northwest{%
12314 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12315 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12316 \pgf@y=.5\pgf@y
12317 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12318 \pgf@x=.5\pgf@x
12319 }
12320 \anchor{south}{
12321 \northwest
12322 \pgf@y=-\pgf@y
12323 }
12324 \anchor{north}{
12325 \northwest
12326 }
12327 \savedanchor\left{%
12328 \pgf@y=0pt
12329 }
12330 \anchor{leftedge}
12331 {\left
12332 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
12333 }
12334 \savedanchor\inOneFixed{%
12335 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12336 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12337 \pgf@y=.5\pgf@y
12338 \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
12339 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12340 \pgf@x=.5\pgf@x
12341 }
12342 \anchor{in up}{
12343 \inOneFixed
12344 }
12345 \anchor{in down}{
12346 \inOneFixed
12347 \pgf@y=-\pgf@y
12348 }
12349 \savedanchor\inOne{%
12350 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12351 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12352 \pgf@y=.5\pgf@y
12353 \pgf@y=\ctikzvalof{tripoles/gm amp/input height}\pgf@y
12354 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12355 \pgf@x=.5\pgf@x
12356 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12357 }
12358 \anchor{-}{
12359 \inOne
12360 }
12361 \anchor{+}{
12362 \inOne
12363 \pgf@y=-\pgf@y
12364 }
12365 \savedanchor\up{%
12366 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12367 \pgf@y=\ctikzvalof{tripoles/gm amp/height}\pgf@circ@scaled@Rlen
12368 \pgf@y=.5\pgf@y
12369 \pgf@x=-\ctikzvalof{tripoles/gm amp/width}\pgf@circ@scaled@Rlen
12370 \pgf@x=.5\pgf@x
12371 \pgf@circ@res@up = \pgf@y
12372 \pgf@circ@res@right = -\pgf@x
12373 \pgf@circ@res@left = \pgf@x
12374 \pgfpointlineattime{
12375 \ctikzvalof{tripoles/gm amp/up pos}}{
12376 \pgfpoint{
12377 \ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12378 {\pgf@circ@res@up}}
12379 {\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/gm amp/height 2}\pgf@circ@res@up}}
12380 }
12381 \anchor{up}{
12382 \up
12383 }
12384 \anchor{down}{
12385 \up
12386 \pgf@y=-\pgf@y
12387 }
12388 \anchor{out}{
12389 \northwest
12390 \pgf@y=0pt
12391 \pgf@x=-\pgf@x
12392 }
12393 \anchor{west}{
12394 \left
12395 }
12396 \anchor{east}{
12397 \left
12398 \pgf@x=-\pgf@x
12399 }
12400 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12401 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12402 \anchor{north west}{ \northwest }
12403 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12404
12405 \anchor{text}{\northwest
12406 \pgf@x=\ctikzvalof{tripoles/op amp/port width}\pgf@x
12407 \pgfpoint{-.5\wd\pgfnodeparttextbox+.25\pgf@x}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12408
12409 \backgroundpath{
12410 \pgfsetcolor{\ctikzvalof{color}}
12411
12412 \northwest
12413 \pgf@circ@res@up = \pgf@y
12414 \pgf@circ@res@down = -\pgf@y
12415 \pgf@circ@res@right = -\pgf@x
12416 \pgf@circ@res@left = \pgf@x
12417 \pgf@circ@scaled@Rlen=\scaledRlen
12418
12419 \pgfscope
12420 \newdimen\pgf@circ@res@right@double
12421 \pgf@circ@res@right@double=2\pgf@circ@res@right
12422
12423 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12424 \pgftransformxshift{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12425 \pgf@circ@res@step=\pgf@circ@res@right
12426 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12427 \pgf@circ@res@step=\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@step
12428 %Umrandung:
12429 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right@double}{0}} %geändert startpunkt neu am ausgangsstrich
12430 \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
12431 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
12432 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
12433 \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
12434 \pgfpathclose
12435 \pgf@circ@draworfill
12436 \endpgfscope
12437
12438 \pgfpathmoveto{\pgfpoint
12439 {\pgf@circ@res@left}
12440 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
12441 \pgfpathlineto{\pgfpoint
12442 {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12443 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
12444 \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}
12445
12446
12447 \pgfpathmoveto{\pgfpoint
12448 {\pgf@circ@res@left}
12449 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
12450 \pgfpathlineto{\pgfpoint
12451 {\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
12452 {\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
12453 \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}
12454
12455 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12456 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{0pt}} %
12457 \pgfsetrectcap
12458 \pgfusepath{draw}
12459
12460 }
12461 }
12462
12463 % Instrumentation amplifier
12464 \pgfdeclareshape{inst amp}
12465 {
12466 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12467 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12468 % when tikz calls the anchor it wants the relative position in the lengths
12469 % \pgf@x \pgf@y
12470 % \pgfpoint* functions set that variables
12471 % anchors are visible outside and run on use
12472 \anchor{center}{\pgfpointorigin}
12473 % savedanchors are internals and run on node creation (not use)
12474 % bounding-box top left
12475 \savedanchor\northwest{%
12476 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12477 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12478 \pgf@y=.5\pgf@y
12479 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12480 \pgf@x=.5\pgf@x
12481 }
12482 \anchor{nw}{
12483 \northwest
12484 }
12485 \anchor{south}{
12486 \northwest
12487 \pgf@y=-\pgf@y
12488 }
12489 \anchor{north}{
12490 \northwest
12491 }
12492 \savedanchor\left{%
12493 \pgf@y=0pt
12494 }
12495 \anchor{leftedge}
12496 {\left
12497 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
12498 }
12499 \savedanchor\inOneFixed{%
12500 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12501 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12502 \pgf@y=.5\pgf@y
12503 \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
12504 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12505 \pgf@x=.5\pgf@x
12506 }
12507 \anchor{in up}{
12508 \inOneFixed
12509 }
12510 \anchor{in down}{
12511 \inOneFixed
12512 \pgf@y=-\pgf@y
12513 }
12514 \savedanchor\inOne{%
12515 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12516 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12517 \pgf@y=.5\pgf@y
12518 \pgf@y=\ctikzvalof{tripoles/inst amp/input height}\pgf@y
12519 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12520 \pgf@x=.5\pgf@x
12521 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12522 }
12523 \anchor{-}{
12524 \inOne
12525 }
12526 \anchor{+}{
12527 \inOne
12528 \pgf@y=-\pgf@y
12529 }
12530 \savedanchor\up{%
12531 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12532 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12533 \pgf@y=.5\pgf@y
12534 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12535 \pgf@x=.5\pgf@x
12536 \pgf@circ@res@up = \pgf@y
12537 \pgf@circ@res@right = -\pgf@x
12538 \pgf@circ@res@left = \pgf@x
12539 \pgfpointlineattime{
12540 \ctikzvalof{tripoles/inst amp/up pos}}{
12541 \pgfpoint{
12542 \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12543 {\pgf@circ@res@up}}
12544 {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
12545 }
12546 \anchor{up}{
12547 \up
12548 }
12549 \anchor{down}{
12550 \up
12551 \pgf@y=-\pgf@y
12552 }
12553 % reference voltage input anchors.
12554 \savedanchor\refv{%
12555 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12556 \pgf@y=\ctikzvalof{tripoles/inst amp/height}\pgf@circ@scaled@Rlen
12557 \pgf@y=.5\pgf@y
12558 \pgf@x=-\ctikzvalof{tripoles/inst amp/width}\pgf@circ@scaled@Rlen
12559 \pgf@x=.5\pgf@x
12560 \pgf@circ@res@up = \pgf@y
12561 \pgf@circ@res@right = -\pgf@x
12562 \pgf@circ@res@left = \pgf@x
12563 \pgfpointlineattime{
12564 \ctikzvalof{tripoles/inst amp/refv pos}}{
12565 \pgfpoint{
12566 \ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12567 {\pgf@circ@res@up}}
12568 {\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
12569 }
12570 % we need both because they are normally drawn under the amp, and if you
12571 % mirror it vertically you need them
12572 \anchor{refv up}{
12573 \refv
12574 }
12575 \anchor{refv down}{
12576 \refv
12577 \pgf@y=-\pgf@y
12578 }
12579 \anchor{out}{
12580 \northwest
12581 \pgf@y=0pt
12582 \pgf@x=-\pgf@x
12583 }
12584 \anchor{west}{
12585 \left
12586 }
12587 \anchor{east}{
12588 \left
12589 \pgf@x=-\pgf@x
12590 }
12591 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12592 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12593 \anchor{north west}{ \northwest }
12594 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12595
12596 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12597
12598 % let's start drawing the component
12599 \backgroundpath{
12600 \pgfsetcolor{\ctikzvalof{color}}
12601 %
12602 \northwest
12603 \pgf@circ@res@up = \pgf@y
12604 \pgf@circ@res@down = -\pgf@y
12605 \pgf@circ@res@right = -\pgf@x
12606 \pgf@circ@res@left = \pgf@x
12607 \pgf@circ@scaled@Rlen=\scaledRlen
12608
12609 % main component, normally in thicker lines
12610 \pgfscope
12611 \newdimen\pgf@circ@res@right@double
12612 \pgf@circ@res@right@double=2\pgf@circ@res@right
12613
12614 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12615 \pgftransformxshift{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12616 \pgf@circ@res@step=\pgf@circ@res@right
12617 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12618 \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@step
12619 %first point (near output)
12620 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{0}}
12621 %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
12622 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@up}}
12623 % and then to the input "front up", "down", to the output short side "down"
12624 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12625 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12626 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right@double}{\ctikzvalof{tripoles/inst amp/height 2}\pgf@circ@res@down}}
12627 % ...and close
12628 \pgfpathclose
12629 \pgf@circ@draworfill
12630 \endpgfscope
12631
12632 % Negative input terminal
12633 \pgfpathmoveto{\pgfpoint
12634 {\pgf@circ@res@left}
12635 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
12636 %
12637 \pgfpathlineto{\pgfpoint
12638 {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12639 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
12640 %
12641 \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}
12642
12643 % Positive input terminal
12644 \pgfpathmoveto{\pgfpoint
12645 {\pgf@circ@res@left}
12646 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
12647 %
12648 \pgfpathlineto{\pgfpoint
12649 {\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
12650 {\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
12651 \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}
12652
12653 % Output terminal
12654 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12655 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@right}{0pt}} %
12656 %
12657 \pgfsetrectcap
12658 \pgfusepath{draw}
12659 }
12660 }
12661
12662 % Instrumentation amplifier with terminals for gain resistance between inputs
12663 \pgfdeclareshape{inst amp ra}
12664 {
12665 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12666 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12667 \anchor{center}{\pgfpointorigin}
12668 % bounding-box top left
12669 \savedanchor\northwest{%
12670 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12671 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
12672 \pgf@y=.5\pgf@y
12673 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12674 \pgf@x=.5\pgf@x
12675 }
12676 \anchor{nw}{
12677 \northwest
12678 }
12679 \anchor{south}{
12680 \northwest
12681 \pgf@y=-\pgf@y\pgf@x=0pt\relax
12682 }
12683 \anchor{north}{
12684 \northwest\pgf@x=0pt\relax
12685 }
12686 \savedanchor\left{%
12687 \pgf@y=0pt
12688 }
12689 \anchor{leftedge}
12690 {\left
12691 \pgf@x = \ctikzvalof{tripoles/op amp/port width}\pgf@x
12692 }
12693 % inputs (+-)
12694 \savedanchor\inOneFixed{%
12695 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12696 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
12697 \pgf@y=.5\pgf@y
12698 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
12699 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12700 \pgf@x=.5\pgf@x
12701 }
12702 \anchor{in up}{
12703 \inOneFixed
12704 }
12705 \anchor{in down}{
12706 \inOneFixed
12707 \pgf@y=-\pgf@y
12708 }
12709 \savedanchor\inOne{%
12710 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12711 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
12712 \pgf@y=.5\pgf@y
12713 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
12714 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12715 \pgf@x=.5\pgf@x
12716 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12717 }
12718 \anchor{-}{
12719 \inOne
12720 }
12721 \anchor{+}{
12722 \inOne
12723 \pgf@y=-\pgf@y
12724 }
12725 % R ampli anchors. They are by default at 20% more than R-length distance
12726 % you can change that with the `ra pos` key (use 0.5 for one-R).
12727 \savedanchor\raOneFixed{%
12728 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12729 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
12730 \pgf@y=.5\pgf@y
12731 \pgf@y=\ctikzvalof{tripoles/inst amp ra/input height}\pgf@y
12732 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12733 \pgf@x=.5\pgf@x
12734 }
12735 \anchor{ra up}{
12736 \inOneFixed
12737 }
12738 \anchor{ra down}{
12739 \inOneFixed
12740 \pgf@y=-\pgf@y
12741 }
12742 \savedanchor\raOne{%
12743 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12744 \pgf@y=\pgf@circ@scaled@Rlen
12745 \pgf@y=\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@y
12746 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12747 \pgf@x=.5\pgf@x
12748 \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
12749 }
12750 \anchor{ra-}{
12751 \raOne
12752 }
12753 \anchor{ra+}{
12754 \raOne
12755 \pgf@y=-\pgf@y
12756 }
12757 % power supplies
12758 \savedanchor\up{%
12759 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12760 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
12761 \pgf@y=.5\pgf@y
12762 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12763 \pgf@x=.5\pgf@x
12764 \pgf@circ@res@up = \pgf@y
12765 \pgf@circ@res@right = -\pgf@x
12766 \pgf@circ@res@left = \pgf@x
12767 \pgfpointlineattime{
12768 \ctikzvalof{tripoles/inst amp ra/up pos}}{
12769 \pgfpoint{
12770 \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
12771 {\pgf@circ@res@up}}
12772 {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
12773 }
12774 \anchor{up}{
12775 \up
12776 }
12777 \anchor{down}{
12778 \up
12779 \pgf@y=-\pgf@y
12780 }
12781 % reference voltage input anchors.
12782 \savedanchor\refv{%
12783 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12784 \pgf@y=\ctikzvalof{tripoles/inst amp ra/height}\pgf@circ@scaled@Rlen
12785 \pgf@y=0.5\pgf@y
12786 \pgf@x=-\ctikzvalof{tripoles/inst amp ra/width}\pgf@circ@scaled@Rlen
12787 \pgf@x=0.5\pgf@x
12788 \pgf@circ@res@up = \pgf@y
12789 \pgf@circ@res@right = -\pgf@x
12790 \pgf@circ@res@left = \pgf@x
12791 \pgfpointlineattime{
12792 \ctikzvalof{tripoles/inst amp ra/refv pos}}{
12793 \pgfpoint{
12794 \ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
12795 {\pgf@circ@res@up}}
12796 {\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/inst amp ra/height 2}\pgf@circ@res@up}}
12797 }
12798 % we need both because they are normally drawn under the amp, and if you
12799 % mirror it vertically you need them
12800 \anchor{refv up}{
12801 \refv
12802 }
12803 \anchor{refv down}{
12804 \refv
12805 \pgf@y=-\pgf@y
12806 }
12807 \anchor{out}{
12808 \northwest
12809 \pgf@y=0pt
12810 \pgf@x=-\pgf@x
12811 }
12812 \anchor{west}{
12813 \left
12814 }
12815 \anchor{east}{
12816 \left
12817 \pgf@x=-\pgf@x
12818 }
12819 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12820 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12821 \anchor{north west}{ \northwest }
12822 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12823
12824 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12825
12826 % drawing of the component
12827 \backgroundpath{
12828 \pgfsetcolor{\ctikzvalof{color}}
12829
12830 \northwest
12831 \pgf@circ@res@up = \pgf@y
12832 \pgf@circ@res@down = -\pgf@y
12833 \pgf@circ@res@right = -\pgf@x
12834 \pgf@circ@res@left = \pgf@x
12835 \pgf@circ@scaled@Rlen=\scaledRlen
12836
12837 \newdimen\pgf@circ@res@right@double
12838 \pgf@circ@res@right@double=2\pgf@circ@res@right
12839
12840 % main component, normally in thicker lines
12841 \pgfscope
12842 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12843 \pgftransformxshift{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
12844 \pgf@circ@res@step=\pgf@circ@res@right
12845 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12846 \pgf@circ@res@step=\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@step
12847 %primer punto: la linea de salida (lado componente)
12848 \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right@double}{0}}
12849 %from the exit to the top (short side)... (note that the .6 must be copied in \up anchor
12850 \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}}
12851 % and then to the input "front up", "down", to the output short side "down"
12852 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12853 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12854 \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}}
12855 % ...and close
12856 \pgfpathclose
12857 \pgf@circ@draworfill
12858 \endpgfscope
12859
12860 % ra terminal -
12861 \pgfpathmoveto{\pgfpoint
12862 {\pgf@circ@res@left}
12863 {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
12864 %
12865 \pgfpathlineto{\pgfpoint
12866 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
12867 {\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
12868 % ra terminal +
12869 \pgfpathmoveto{\pgfpoint
12870 {\pgf@circ@res@left}
12871 {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
12872 %
12873 \pgfpathlineto{\pgfpoint
12874 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
12875 {-\ctikzvalof{tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
12876
12877 % Negative input terminal
12878 \pgfpathmoveto{\pgfpoint
12879 {\pgf@circ@res@left}
12880 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
12881 %
12882 \pgfpathlineto{\pgfpoint
12883 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
12884 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
12885 %
12886 \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}
12887
12888 % Positive input terminal
12889 \pgfpathmoveto{\pgfpoint
12890 {\pgf@circ@res@left}
12891 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
12892 %
12893 \pgfpathlineto{\pgfpoint
12894 {\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
12895 {\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
12896 \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}
12897
12898 % Output terminal
12899 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12900 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@right}{0pt}} %
12901 %
12902 \pgfsetrectcap
12903 \pgfusepath{draw}
12904 }
12905 }
12906
12907 % Buffer
12908 % Contributed by Danilo Piazzalunga
12909 \pgfdeclareshape{buffer}
12910 {
12911 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12912 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12913 \anchor{center}{\pgfpointorigin}
12914 \savedanchor\northwest{%
12915 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12916 \pgf@y=\ctikzvalof{bipoles/buffer/height}\pgf@circ@scaled@Rlen
12917 \pgf@y=.5\pgf@y
12918 \pgf@x=-\ctikzvalof{bipoles/buffer/width}\pgf@circ@scaled@Rlen
12919 \pgf@x=.5\pgf@x
12920 }
12921 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
12922 \anchor{west}{ \northwest \pgf@y=0pt }
12923 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
12924 \anchor{north}{ \northwest \pgf@x=0pt }
12925 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12926 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12927 \anchor{north west}{ \northwest }
12928 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12929 \savedanchor\left{%
12930 \pgf@y=0pt
12931 }
12932 \anchor{in}{
12933 \northwest
12934 \pgf@y=0pt
12935 }
12936 \anchor{out}{
12937 \northwest
12938 \pgf@y=0pt
12939 \pgf@x=-\pgf@x
12940 }
12941
12942 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
12943
12944 \backgroundpath{
12945 \pgfsetcolor{\ctikzvalof{color}}
12946
12947 \northwest
12948 \pgf@circ@res@up = \pgf@y
12949 \pgf@circ@res@down = -\pgf@y
12950 \pgf@circ@res@right = -\pgf@x
12951 \pgf@circ@res@left = \pgf@x
12952 \pgf@circ@scaled@Rlen=\scaledRlen
12953 \pgfscope
12954 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
12955 \pgftransformxshift{.7\pgf@circ@res@left}
12956 \pgf@circ@res@step=\pgf@circ@res@right
12957 \advance\pgf@circ@res@step by -\pgf@circ@res@left
12958 \pgf@circ@res@step=.7\pgf@circ@res@step
12959
12960 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
12961 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
12962 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
12963 \pgfpathclose
12964 \pgf@circ@draworfill
12965 \endpgfscope
12966
12967 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
12968 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
12969
12970 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
12971 \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
12972
12973 \pgfusepath{draw}
12974 }
12975 }
12976
12977 % plain amplifier, no symbols
12978 \pgfdeclareshape{plain amp}
12979 {
12980 \savedmacro{\ctikzclass}{\edef\ctikzclass{amplifiers}}
12981 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
12982 \anchor{center}{\pgfpointorigin}
12983 \savedanchor\northwest{%
12984 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
12985 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
12986 \pgf@y=.5\pgf@y
12987 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
12988 \pgf@x=.5\pgf@x
12989 }
12990 \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
12991 \anchor{west}{ \northwest \pgf@y=0pt }
12992 \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
12993 \anchor{north}{ \northwest \pgf@x=0pt }
12994 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
12995 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
12996 \anchor{north west}{ \northwest }
12997 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
12998 \savedanchor\left{%
12999 \pgf@y=0pt
13000 }
13001 \savedanchor\inOne{%
13002 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13003 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
13004 \pgf@y=.5\pgf@y
13005 \pgf@y=\ctikzvalof{tripoles/plain amp/input height}\pgf@y
13006 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
13007 \pgf@x=.5\pgf@x
13008 }
13009 \anchor{-}{
13010 \inOne
13011 }
13012 \anchor{+}{
13013 \inOne
13014 \pgf@y=-\pgf@y
13015 }
13016 \anchor{in up}{
13017 \inOne
13018 }
13019 \anchor{in down}{
13020 \inOne
13021 \pgf@y=-\pgf@y
13022 }
13023 \savedanchor\up{%
13024 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13025 \pgf@y=\ctikzvalof{tripoles/plain amp/height}\pgf@circ@scaled@Rlen
13026 \pgf@y=.5\pgf@y
13027 \pgf@x=-\ctikzvalof{tripoles/plain amp/width}\pgf@circ@scaled@Rlen
13028 \pgf@x=.5\pgf@x
13029 \pgf@circ@res@up = \pgf@y
13030 \pgf@circ@res@right = -\pgf@x
13031 \pgf@circ@res@left = \pgf@x
13032 \pgfpointlineattime{
13033 \ctikzvalof{tripoles/plain amp/up pos}}{
13034 \pgfpoint{
13035 \ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13036 {\pgf@circ@res@up}}
13037 {\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
13038 }
13039 \anchor{up}{
13040 \up
13041 }
13042 \anchor{down}{
13043 \up
13044 \pgf@y=-\pgf@y
13045 }
13046 \anchor{out}{
13047 \northwest
13048 \pgf@y=0pt
13049 \pgf@x=-\pgf@x
13050 }
13051
13052 \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
13053
13054 \backgroundpath{
13055 \pgfsetcolor{\ctikzvalof{color}}
13056
13057 \northwest
13058 \pgf@circ@res@up = \pgf@y
13059 \pgf@circ@res@down = -\pgf@y
13060 \pgf@circ@res@right = -\pgf@x
13061 \pgf@circ@res@left = \pgf@x
13062
13063 \pgfscope
13064 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13065 \pgftransformxshift{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13066 \pgf@circ@res@step=\pgf@circ@res@right
13067 \advance\pgf@circ@res@step by -\pgf@circ@res@left
13068 \pgf@circ@res@step=\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@step
13069
13070 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
13071 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13072 \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
13073 \pgfpathclose
13074 \pgf@circ@draworfill
13075 \endpgfscope
13076 \pgfpathmoveto{\pgfpoint
13077 {\pgf@circ@res@left}
13078 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
13079 \pgfpathlineto{\pgfpoint
13080 {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13081 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@up}}
13082
13083
13084 \pgfpathmoveto{\pgfpoint
13085 {\pgf@circ@res@left}
13086 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
13087 \pgfpathlineto{\pgfpoint
13088 {\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@left}
13089 {\ctikzvalof{tripoles/plain amp/input height}\pgf@circ@res@down}}
13090
13091 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
13092 \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/plain amp/port width}\pgf@circ@res@right}{0pt}}
13093
13094 \pgfusepath{draw}
13095 }
13096 }
13097
13098 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13099 %% electromechanical device (motor/generator)
13100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13101
13102 \pgfdeclareshape{elmech}
13103 {
13104 \savedmacro{\ctikzclass}{\edef\ctikzclass{electromechanicals}}
13105 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13106 \savedanchor\northwest{
13107 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13108 \pgf@y=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
13109 \pgf@y=.5\pgf@y
13110 \pgf@x=-\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
13111 \pgf@x=.5\pgf@x
13112 }
13113 \anchor{center}{
13114 \pgfpointorigin
13115 }
13116 \anchor{text}{
13117 \pgfpointorigin
13118 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
13119 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
13120 }
13121 \anchor{left}{%
13122 \northwest
13123 \pgf@y=0pt
13124 }
13125 \anchor{right}{%
13126 \northwest
13127 \pgf@y=0pt
13128 \pgf@x=-\pgf@x
13129 }
13130 \anchor{top}{
13131 \northwest
13132 \pgf@x=0pt
13133 }
13134 \anchor{pathstart}{
13135 \northwest
13136 \pgf@x=0pt
13137 }
13138 \anchor{pathend}{
13139 \northwest
13140 \pgf@x=0pt
13141 \pgf@y=-\pgf@y
13142 }
13143 \anchor{bottom}{
13144 \northwest
13145 \pgf@x=0pt
13146 \pgf@y=-\pgf@y
13147 }
13148 \anchor{center}{
13149 \pgf@y=0pt
13150 \pgf@x=0pt
13151 }
13152 \anchor{east}{
13153 \northwest
13154 \pgf@y=0pt
13155 \pgf@x=-\pgf@x
13156 }
13157 \anchor{west}{
13158 \northwest
13159 \pgf@y=0pt
13160 }
13161 \anchor{south}{
13162 \northwest
13163 \pgf@x=0pt
13164 \pgf@y=-\pgf@y
13165 }
13166 \anchor{north}{
13167 \northwest
13168 \pgf@x=0pt
13169 }
13170 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13171 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13172 \anchor{north west}{ \northwest }
13173 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13174 \anchorborder{%
13175 \@tempdima=\pgf@x\@tempdimb=\pgf@y
13176 \northwest\pgf@circ@res@other=-\pgf@x
13177 \pgfpointborderellipse{\pgfqpoint{\@tempdima}{\@tempdimb}}{\pgfqpoint{\pgf@circ@res@other}{\pgf@circ@res@other}}
13178 }
13179 \anchor{block north west}{\northwest\pgf@x=0.5\pgf@x}
13180 \anchor{block south west}{\northwest\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y}
13181 \anchor{block north east}{\northwest\pgf@x=-0.5\pgf@x}
13182 \anchor{block south east}{\northwest\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y}
13183 \anchor{block up right}{
13184 \northwest
13185 % remember that pgf@x is negative
13186 % center of the block is at 0.5*H+W*cos(30)/2
13187 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13188 \pgf@x=-0.5\pgf@x
13189 }
13190 \anchor{block up left}{
13191 \northwest
13192 % remember that pgf@x is negative
13193 % center of the block is at 0.5*H+W*cos(30)/2
13194 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13195 \pgf@x=0.5\pgf@x
13196 }
13197 \anchor{block down right}{
13198 \northwest
13199 % remember that pgf@x is negative
13200 % center of the block is at 0.5*H+W*cos(30)/2
13201 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13202 \pgf@y=-\pgf@y
13203 \pgf@x=-0.5\pgf@x
13204 }
13205 \anchor{block down left}{
13206 \northwest
13207 % remember that pgf@x is negative
13208 % center of the block is at 0.5*H+W*cos(30)/2
13209 \pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax
13210 \pgf@y=-\pgf@y
13211 \pgf@x=0.5\pgf@x
13212 }
13213 \behindbackgroundpath{
13214 \pgfsetcolor{\ctikzvalof{color}}
13215 \pgf@circ@scaled@Rlen=\scaledRlen
13216 \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
13217 \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
13218 \pgfscope
13219 \pgfstartlinewidth=\pgflinewidth
13220 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
13221 \pgfscope % clip the bar: whole size minus the circle
13222 \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
13223 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
13224 \pgfseteorule
13225 \pgfusepath{clip}
13226 \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
13227 \pgfsetfillcolor{\ctikzvalof{color}}
13228 \pgfusepath{fill, draw}
13229 \endpgfscope
13230 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
13231 \ifx\tikz@fillcolor\pgfutil@empty
13232 % set the default fill color to white
13233 \pgfsetfillcolor{white}
13234 % ...but override it if the class is defined!
13235 \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
13236 \else
13237 \pgfsetfillcolor{\tikz@fillcolor}
13238 \pgfusepath{draw, fill}
13239 \fi
13240 \endpgfscope
13241 }
13242 }
13243
13244 %%%%%%%%%%%%%%%%%%%
13245 %% Magnetron
13246 %%%%%%%%%%%%%%%%%%%
13247
13248 \pgfdeclareshape{magnetron}
13249 {
13250 \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}} % class of these components
13251 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13252 \savedanchor\northwest{
13253 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13254 \pgf@y=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
13255 \pgf@y=.5\pgf@y
13256 \pgf@x=-\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
13257 \pgf@x=.5\pgf@x
13258 }
13259 \anchor{center}{
13260 \pgfpointorigin
13261 }
13262 \anchor{anode}{
13263 \northwest
13264 \pgf@x=0pt
13265 \pgf@y=-\pgf@y
13266 }
13267 \anchor{cathode1}{
13268 \northwest
13269 \pgf@circ@res@step=\pgf@y
13270 \pgfmathparse{cos(105)}
13271 \pgf@x=\pgfmathresult\pgf@circ@res@step
13272 \pgfmathparse{sin(105)}
13273 \pgf@y=\pgfmathresult\pgf@circ@res@step
13274 %\pgfpointorigin
13275 %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
13276 }
13277 \anchor{cathode2}{
13278 \northwest
13279 \pgf@circ@res@step=\pgf@y
13280 \pgfmathparse{cos(75)}
13281 \pgf@x=\pgfmathresult\pgf@circ@res@step
13282 \pgfmathparse{sin(75)}
13283 \pgf@y=\pgfmathresult\pgf@circ@res@step
13284 %\pgfpointorigin
13285 %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
13286 }
13287 \anchor{text}{
13288 \pgfpointorigin
13289 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
13290 \advance \pgf@y by -.5\ht\pgfnodeparttextbox
13291 }
13292 \anchor{left}{%
13293 \northwest
13294 \pgf@y=0pt
13295 }
13296 \anchor{right}{%
13297 \northwest
13298 \pgf@y=0pt
13299 \pgf@x=-\pgf@x
13300 }
13301 \anchor{top}{
13302 \northwest
13303 \pgf@x=0pt
13304 }
13305 \anchor{pathstart}{
13306 \northwest
13307 \pgf@x=0pt
13308 }
13309 \anchor{pathend}{
13310 \northwest
13311 \pgf@x=0pt
13312 \pgf@y=-\pgf@y
13313 }
13314 \anchor{bottom}{
13315 \northwest
13316 \pgf@x=0pt
13317 \pgf@y=-\pgf@y
13318 }
13319 \anchor{center}{
13320 \pgf@y=0pt
13321 \pgf@x=0pt
13322 }
13323 \anchor{east}{
13324 \northwest
13325 \pgf@y=0pt
13326 \pgf@x=-\pgf@x
13327 }
13328 \anchor{west}{
13329 \northwest
13330 \pgf@y=0pt
13331 }
13332 \anchor{south}{
13333 \northwest
13334 \pgf@x=0pt
13335 \pgf@y=-\pgf@y
13336 }
13337 \anchor{north}{
13338 \northwest
13339 \pgf@x=0pt
13340 }
13341 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
13342 \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
13343 \anchor{north west}{ \northwest }
13344 \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
13345 \backgroundpath{
13346 \pgfsetcolor{\ctikzvalof{color}}
13347 \pgf@circ@scaled@Rlen=\scaledRlen
13348 \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
13349 \northwest
13350 \pgf@circ@res@up = \pgf@y
13351 \pgf@circ@res@down = -\pgf@y
13352 \pgf@circ@res@right = -\pgf@x
13353 \pgf@circ@res@left = \pgf@x
13354 \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
13355
13356 \pgfscope
13357 \pgfstartlinewidth=\pgflinewidth
13358 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
13359 %create outer circle
13360 \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
13361 \pgf@circ@draworfill
13362 %create chambers
13363 \foreach \angle in {45,135,225,315}{
13364 \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
13365 \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
13366 }
13367 \pgfsetroundcap
13368 \pgfusepath{draw}
13369 \pgfscope
13370 %draw connection from outside
13371 %anode
13372 \pgfsetlinewidth{\pgfstartlinewidth}
13373 \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
13374 \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
13375 %cathodes
13376 \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
13377 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13378 \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
13379 \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13380 \pgfsetbuttcap
13381 \pgfusepath{draw}
13382 \endpgfscope
13383 %create cathode
13384 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13385 \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
13386 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
13387 \pgfusepath{draw}
13388 %create anode
13389 \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
13390 \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
13391
13392 \pgfsetbuttcap
13393 \pgfusepath{draw}
13394 \endpgfscope
13395 }
13396 }
13397
13398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13399 % Electronic tubes, submitted by J. op den Brouw
13400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13401
13402 % Draw tube outline
13403 \def\pgf@circ@tubes@drawtube{%
13404 \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
13405 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
13406 \pgfutil@tempdima=\pgf@circ@res@right
13407 \advance\pgfutil@tempdima by -\pgf@circ@res@up
13408 \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
13409 \pgfpatharc{90}{-90}{\pgf@circ@res@up}
13410 \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
13411 \pgfpatharc{270}{90}{\pgf@circ@res@up}
13412 \else
13413 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
13414 \pgfutil@tempdima=\pgf@circ@res@up
13415 \advance\pgfutil@tempdima by -\pgf@circ@res@right
13416 \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
13417 \pgfpatharc{180}{0}{\pgf@circ@res@right}
13418 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
13419 \pgfpatharc{180}{0}{-\pgf@circ@res@right}
13420 \fi
13421 \pgfpathclose
13422 }
13423
13424 %% The diode (tube), triode, tetrode and pentode only differ in the
13425 %% number of grids. So we construct a generic declare function in
13426 %% which we can put code for the grid anchors and grid drawing code
13427 %% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
13428 \long\def\pgfcircdeclaretube#1#2#3{%
13429 \pgfdeclareshape{#1}{
13430 \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
13431 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13432 \anchor{center}{
13433 \pgfpointorigin
13434 }
13435 \savedanchor\northwest{%
13436 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13437 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
13438 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
13439 % x and y should be half the Rlen
13440 \pgf@y=\pgf@circ@res@up
13441 \pgf@y=.5\pgf@y
13442 \pgf@x=-\pgf@circ@res@right
13443 \pgf@x=.5\pgf@x
13444 }
13445 \anchor{north} {%
13446 \northwest
13447 \pgf@x=0pt
13448 }
13449 \anchor{east}{%
13450 \northwest
13451 \pgf@x=-\pgf@x
13452 \pgf@y=0pt
13453 }
13454 \anchor{south}{%
13455 \northwest
13456 \pgf@y=-\pgf@y
13457 \pgf@x=0pt
13458 }
13459 \anchor{west}{%
13460 \northwest
13461 \pgf@y=0pt
13462 }
13463 \anchor{north west}{%
13464 \northwest
13465 }
13466 \anchor{north east}{%
13467 \northwest
13468 \pgf@x=-\pgf@x
13469 }
13470 \anchor{south east}{
13471 \northwest
13472 \pgf@x=-\pgf@x
13473 \pgf@y=-\pgf@y
13474 }
13475 \anchor{south west}{
13476 \northwest
13477 \pgf@y=-\pgf@y
13478 }
13479 \anchor{anode} {%
13480 \northwest
13481 \pgf@x=0pt
13482 }
13483 \anchor{cathode}{%
13484 \northwest
13485 \pgf@y=-\pgf@y
13486 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
13487 }
13488 \anchor{cathode 1}{%
13489 \northwest
13490 \pgf@y=-\pgf@y
13491 \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
13492 }
13493 \anchor{cathode 2}{%
13494 \northwest
13495 \pgf@y=-\pgf@y
13496 \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
13497 }
13498 \anchor{filament 1}{%
13499 \northwest
13500 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
13501 \pgf@x=\pgfmathresult\pgf@x
13502 \pgf@y=-\pgf@y
13503 }
13504 \anchor{filament 2}{%
13505 \northwest
13506 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
13507 \pgf@x=-\pgfmathresult\pgf@x
13508 \pgf@y=-\pgf@y
13509 }
13510
13511 % Extra anchors
13512 #2
13513
13514 \backgroundpath{
13515 \pgfscope
13516 % Line width for tripoles
13517 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
13518 \pgf@circ@scaled@Rlen=\scaledRlen
13519
13520 % Setup to draw tube
13521 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
13522 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
13523 \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
13524 \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13525
13526 % Tube outline
13527 \pgf@circ@tubes@drawtube
13528
13529 % Setup to draw grid, filament, anode and cathode
13530 \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
13531 \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
13532 \pgf@circ@res@up=0.5\pgf@circ@res@up
13533 \pgf@circ@res@right=0.5\pgf@circ@res@right
13534
13535 % Tube fill color (if any)
13536 \pgf@circ@draworfill
13537
13538 % Grid drawing
13539 #3
13540
13541 % Filament (is not drawn by default)
13542 \ifpgf@circuit@tubes@filament
13543 \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
13544 \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
13545 \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
13546 \pgf@xa=\pgfmathresult\pgf@circ@res@right
13547 \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
13548 \pgf@ya=\pgfmathresult\pgf@circ@res@up
13549 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
13550 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
13551 \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
13552 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
13553 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
13554 \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
13555 \pgf@circuit@tubes@filamentfalse
13556 \fi
13557
13558 % Anode (or plate)
13559 \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
13560 \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
13561 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
13562 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
13563
13564 % Cathode
13565 \ifpgf@circuit@tubes@nocathode
13566 \pgf@circuit@tubes@nocathodefalse
13567 \else
13568 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
13569 \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
13570 \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
13571 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
13572 \ifpgf@circuit@tubes@fullcathode
13573 \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
13574 \pgf@circuit@tubes@fullcathodefalse
13575 \else
13576 \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}}
13577 \fi
13578 \fi
13579
13580 % Draw the background
13581 \pgfusepath{draw}
13582 \endpgfscope
13583 }
13584 }
13585 }
13586
13587 \pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
13588
13589 \pgfcircdeclaretube{triode}
13590 {
13591 \anchor{grid} {% should not be used
13592 \northwest
13593 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
13594 }
13595 \anchor{control} {%
13596 \northwest
13597 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
13598 }
13599 }
13600 {
13601 % Grid protrusion
13602 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13603 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
13604 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13605 \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13606 % Grid dashes: calculations
13607 \pgf@xb=2\pgf@circ@res@right
13608 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
13609 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
13610 \multiply\pgf@circ@count@a by 2\relax
13611 \advance\pgf@circ@count@a by 1\relax
13612 \advance\pgf@circ@res@step by -\pgf@xa
13613 \divide\pgf@circ@res@step by \pgf@circ@count@a
13614 % Grid dashes: draw
13615 \pgf@circ@res@temp=\pgf@xa
13616 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
13617 \loop
13618 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13619 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13620 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13621 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
13622 \advance\pgf@circ@count@a by-1
13623 \ifnum\pgf@circ@count@a>0\relax
13624 \repeat
13625 }
13626
13627 \pgfcircdeclaretube{tetrode}
13628 {
13629 \anchor{grid} {% should not be used
13630 \northwest
13631 \pgfutil@tempdima=\pgf@y
13632 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13633 \pgf@y=0.5\pgf@y
13634 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13635 }
13636 \anchor{control} {%
13637 \northwest
13638 \pgfutil@tempdima=\pgf@y
13639 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13640 \pgf@y=0.5\pgf@y
13641 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13642 }
13643 \anchor{screen} {%
13644 \northwest
13645 \pgfutil@tempdima=\pgf@y
13646 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
13647 \pgf@y=0.5\pgf@y
13648 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13649 }
13650 }
13651 {
13652 % Grid x/y points
13653 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13654 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
13655 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
13656 \pgfutil@tempdimb=-\pgfutil@tempdima
13657 \pgfutil@tempdima=0.5\pgfutil@tempdima
13658 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13659 \pgfutil@tempdimb=0.5\pgfutil@tempdimb
13660 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13661 % Grid protrusion
13662 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
13663 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
13664 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
13665 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
13666 % Grid dashes: calculations
13667 \pgf@xb=2\pgf@circ@res@right
13668 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
13669 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
13670 \multiply\pgf@circ@count@a by 2\relax
13671 \advance\pgf@circ@count@a by 1\relax
13672 \advance\pgf@circ@res@step by -\pgf@xa
13673 \divide\pgf@circ@res@step by \pgf@circ@count@a
13674 % Grid dashes: draw
13675 \pgf@circ@res@temp=\pgf@xa
13676 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
13677 \loop
13678 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13679 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
13680 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
13681 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
13682 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
13683 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13684 \advance\pgf@circ@count@a by-1
13685 \ifnum\pgf@circ@count@a>0\relax
13686 \repeat
13687 }
13688
13689 \pgfcircdeclaretube{pentode}
13690 {
13691 \anchor{grid} {% should not be used
13692 \northwest
13693 \pgfutil@tempdima=\pgf@y
13694 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13695 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13696 }
13697 \anchor{control} {%
13698 \northwest
13699 \pgfutil@tempdima=\pgf@y
13700 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13701 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13702 }
13703 \anchor{screen} {%
13704 \northwest
13705 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
13706 }
13707 \anchor{suppressor} {%
13708 \northwest
13709 \pgfutil@tempdima=\pgf@y
13710 \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
13711 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13712 }
13713 }
13714 {
13715 % Grid x/y points
13716 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13717 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
13718 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
13719 \pgfutil@tempdimb=-\pgfutil@tempdima
13720 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13721 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13722 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13723 % Grid protrusion
13724 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
13725 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
13726 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
13727 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
13728 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
13729 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
13730 % Grid dashes: calculations
13731 \pgf@xb=2\pgf@circ@res@right
13732 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
13733 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
13734 \multiply\pgf@circ@count@a by 2\relax
13735 \advance\pgf@circ@count@a by 1\relax
13736 \advance\pgf@circ@res@step by -\pgf@xa
13737 \divide\pgf@circ@res@step by \pgf@circ@count@a
13738 % Grid dashes: draw
13739 \pgf@circ@res@temp=\pgf@xa
13740 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
13741 \loop
13742 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13743 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
13744 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
13745 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
13746 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
13747 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
13748 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
13749 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13750 \advance\pgf@circ@count@a by-1
13751 \ifnum\pgf@circ@count@a>0\relax
13752 \repeat
13753 }
13754
13755 \pgfcircdeclaretube{pentode suppressor to cathode}
13756 {
13757 \anchor{grid} {% should not be used
13758 \northwest
13759 \pgfutil@tempdima=\pgf@y
13760 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13761 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13762 }
13763 \anchor{control} {%
13764 \northwest
13765 \pgfutil@tempdima=\pgf@y
13766 \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
13767 \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
13768 }
13769 \anchor{screen} {%
13770 \northwest
13771 \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
13772 }
13773 }
13774 {
13775 % Grid x/y points
13776 \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
13777 \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
13778 \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
13779 \pgfutil@tempdimb=-\pgfutil@tempdima
13780 \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13781 \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13782 \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
13783 % Grid protrusion
13784 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
13785 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
13786 \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}}
13787 \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}}
13788 % Grid dashes: calculations
13789 \pgf@xb=2\pgf@circ@res@right
13790 \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
13791 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
13792 \multiply\pgf@circ@count@a by 2\relax
13793 \advance\pgf@circ@count@a by 1\relax
13794 \advance\pgf@circ@res@step by -\pgf@xa
13795 \divide\pgf@circ@res@step by \pgf@circ@count@a
13796 % Grid dashes: draw
13797 \pgf@circ@res@temp=\pgf@xa
13798 \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
13799 \loop
13800 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13801 \ifnum\pgf@circ@count@a>1\relax
13802 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
13803 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
13804 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}}
13805 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}}
13806 \fi
13807 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
13808 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
13809 \advance\pgf@circ@res@temp by\pgf@circ@res@step
13810 \advance\pgf@circ@count@a by-1
13811 \ifnum\pgf@circ@count@a>0\relax
13812 \repeat
13813 % Grid: connection from suppressor to cathode
13814 \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
13815 \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
13816 \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}}
13817
13818 }
13819
13820 %%%---------- close: tex/pgfcirctripoles
13821 %%%%%%%%%%% Springe nach tex/pgfcircquadpoles
13822 %%%---------- open: tex/pgfcircquadpoles.tex
13823 % Copyright 2007-2009 by Massimo Redaelli
13824 %
13825 % This file may be distributed and/or modified
13826 %
13827 % 1. under the LaTeX Project Public License and/or
13828 % 2. under the GNU Public License.
13829 %
13830 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
13831
13832 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13833 %% Quadripoles
13834
13835 \long\def\pgfcircdeclarequadpole#1#2#3{
13836 \pgfdeclareshape{#1}
13837 {
13838 \savedmacro{\ctikzclass}{\edef\ctikzclass{inductors}}
13839 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
13840 % shapename
13841 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
13842 \anchor{center}{
13843 \northwest
13844 \pgf@x=0pt
13845 \pgf@y=0pt
13846 }
13847 \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
13848 \savedanchor\northwest{%
13849 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13850 \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
13851 \pgf@y=.5\pgf@y
13852 \pgf@x=.5\pgf@circ@scaled@Rlen
13853 \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
13854 }
13855 %% we define the upper right (positive coord) dot (which is B1)
13856 \savedanchor{\innerdot}{%
13857 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13858 \pgf@xa=.5\pgf@circ@scaled@Rlen
13859 \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
13860 % by default use the cute inductor size
13861 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
13862 % check if it's american
13863 \edef\pgf@circ@temp{\ctikzvalof{inductor}}
13864 \edef\pgf@temp{american}
13865 \ifx\pgf@circ@temp\pgf@temp
13866 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
13867 \fi
13868 % check if it's european
13869 \edef\pgf@temp{european}
13870 \ifx\pgf@circ@temp\pgf@temp
13871 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa-\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
13872 \fi
13873 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
13874 }
13875 \savedanchor{\outerdot}{%
13876 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
13877 \pgf@xa=.5\pgf@circ@scaled@Rlen
13878 \pgf@xa=-\ctikzvalof{quadpoles/#1/width}\pgf@xa
13879 % by default use the cute inductor size
13880 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@scaled@Rlen/2}
13881 % check if it's american
13882 \edef\pgf@circ@temp{\ctikzvalof{inductor}}
13883 \edef\pgf@temp{american}
13884 \ifx\pgf@circ@temp\pgf@temp
13885 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/americaninductor/height}*\pgf@circ@scaled@Rlen/2}
13886 \fi
13887 % check if it's european
13888 \edef\pgf@temp{european}
13889 \ifx\pgf@circ@temp\pgf@temp
13890 \pgfmathsetlength\pgf@x{-\stretto*\pgf@xa+\ctikzvalof{bipoles/fullgeneric/height}*\pgf@circ@scaled@Rlen/2}
13891 \fi
13892 \pgfmathsetlength\pgf@y{0.5*\pgf@circ@scaled@Rlen}
13893 }
13894 \anchor{A2}{
13895 \northwest
13896 \pgf@y=-\pgf@y
13897 }
13898 \anchor{B1}{
13899 \northwest
13900 \pgf@x=-\pgf@x
13901 }
13902 \anchor{A1}{
13903 \northwest
13904 }
13905 \anchor{B2}{
13906 \northwest
13907 \pgf@x=-\pgf@x
13908 \pgf@y=-\pgf@y
13909 }
13910 %% dot's anchors
13911 \anchor{inner dot A1}{\innerdot\pgf@x=-\pgf@x}
13912 \anchor{outer dot A1}{\outerdot\pgf@x=-\pgf@x}
13913 \anchor{inner dot A2}{\innerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
13914 \anchor{outer dot A2}{\outerdot\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
13915 \anchor{inner dot B1}{\innerdot}
13916 \anchor{outer dot B1}{\outerdot}
13917 \anchor{inner dot B2}{\innerdot\pgf@y=-\pgf@y}
13918 \anchor{outer dot B2}{\outerdot\pgf@y=-\pgf@y}
13919 % geographical
13920 \anchor{north}{
13921 \northwest
13922 \pgf@x=0pt
13923 }
13924 \anchor{south}{
13925 \northwest
13926 \pgf@x=0pt
13927 \pgf@y=-\pgf@y
13928 }
13929 \anchor{west}{
13930 \northwest
13931 \pgf@y=0pt
13932 }
13933 \anchor{east}{
13934 \northwest
13935 \pgf@y=0pt
13936 \pgf@x=-\pgf@x
13937 }
13938 \anchor{south west}{
13939 \northwest
13940 \pgf@y=-\pgf@y
13941 }
13942 \anchor{north east}{
13943 \northwest
13944 \pgf@x=-\pgf@x
13945 }
13946 \anchor{north west}{
13947 \northwest
13948 }
13949 \anchor{south east}{
13950 \northwest
13951 \pgf@x=-\pgf@x
13952 \pgf@y=-\pgf@y
13953 }
13954 \anchor{base}{
13955 \northwest
13956 \pgf@x=0pt
13957 }
13958 #3
13959 \backgroundpath{
13960 \pgfsetcolor{\ctikzvalof{color}}
13961
13962 \northwest
13963 \pgf@circ@res@up = \pgf@y
13964 \pgf@circ@res@down = -\pgf@y
13965 \pgf@circ@res@right = -\pgf@x
13966 \pgf@circ@res@left = \pgf@x
13967 #2
13968 }
13969 }
13970 }
13971
13972
13973 \def\pgf@circ@drawtransformerbasicanchor{
13974 \ctikzvalof{quadpoles/trans/height}
13975 \anchor{AA2}{
13976 \northwest
13977 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
13978 \pgf@x=.7\pgf@x
13979 \pgf@y=-\pgf@y
13980 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
13981 }
13982 \anchor{BB1}{
13983 \northwest
13984 \pgf@x=-\pgf@x
13985 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
13986 \pgf@x=.7\pgf@x
13987 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
13988 }
13989 \anchor{AA1}{
13990 \northwest
13991 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
13992 \pgf@x=.7\pgf@x
13993 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
13994 }
13995 \anchor{BB2}{
13996 \northwest
13997 \pgf@x=-\pgf@x
13998 \pgf@x=\ctikzvalof{quadpoles/transformer/width1}\pgf@x
13999 \pgf@x=.7\pgf@x
14000 \pgf@y=-\pgf@y
14001 \pgf@y=\ctikzvalof{quadpoles/transformer/height1}\pgf@y
14002 }
14003 }
14004
14005 %% Null styles that can be used to change individually the L1 and L2
14006 %% inductors of the transformer.
14007
14008 \ctikzset{transformer L1/.style={}}
14009 \ctikzset{transformer L2/.style={}}
14010
14011 \def\pgf@circ@drawtransformerbasicbody{
14012 \pgfscope
14013 \pgfslopedattimetrue
14014 \pgfallowupsidedownattimetrue
14015 \pgftransformlineattime{.5}{%
14016 \pgfpoint%
14017 {\stretto\pgf@circ@res@left}%
14018 {\pgf@circ@res@up}%
14019 }{%
14020 \pgfpoint
14021 {\stretto\pgf@circ@res@left}%
14022 {\pgf@circ@res@down}%
14023 }
14024
14025 \pgfkeys{\circuitikzbasekey/.cd, transformer L1}
14026 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
14027 \def\pgf@temp{european}%
14028 \ifx\pgf@temp\pgf@circ@temp%
14029 \pgfnode{fullgenericshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
14030 \else%
14031 \def\pgf@temp{cute}
14032 \ifx\pgf@temp\pgf@circ@temp%
14033 \pgfnode{cuteinductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
14034 \else%
14035 \pgfnode{americaninductorshape}{center}{}{\thisshape-L1}{\pgfusepath{stroke}}
14036 \fi%
14037 \fi%
14038
14039
14040 \endpgfscope
14041 \pgfscope
14042 \pgfslopedattimetrue
14043 \pgfallowupsidedownattimetrue
14044 \pgftransformlineattime{.5}{%
14045 \pgfpoint%
14046 {\stretto\pgf@circ@res@right}%
14047 {\pgf@circ@res@down}%
14048 }{%
14049 \pgfpoint
14050 {\stretto\pgf@circ@res@right}%
14051 {\pgf@circ@res@up}%
14052 }
14053
14054 \pgfkeys{\circuitikzbasekey/.cd, transformer L2}
14055 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
14056 \def\pgf@temp{european}%
14057 \ifx\pgf@temp\pgf@circ@temp%
14058 \pgfnode{fullgenericshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
14059 \else%
14060 \def\pgf@temp{cute}
14061 \ifx\pgf@temp\pgf@circ@temp%
14062 \pgfnode{cuteinductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
14063 \else%
14064 \pgfnode{americaninductorshape}{center}{}{\thisshape-L2}{\pgfusepath{stroke}}
14065 \fi%
14066 \fi%
14067
14068 \endpgfscope
14069
14070 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
14071 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
14072 \pgfpathlineto{\pgfpointanchor{\thisshape-L1}{b}}
14073
14074 \pgfpathmoveto{\pgfpointanchor{\thisshape-L1}{a}}
14075 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
14076 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
14077
14078 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
14079 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
14080 \pgfpathlineto{\pgfpointanchor{\thisshape-L2}{a}}
14081
14082 \pgfpathmoveto{\pgfpointanchor{\thisshape-L2}{b}}
14083 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
14084 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
14085
14086 \pgfusepath{draw}
14087
14088 }
14089
14090
14091 \pgfcircdeclarequadpole{transformer}{
14092 \pgf@circ@drawtransformerbasicbody
14093 }{\pgf@circ@drawtransformerbasicanchor}
14094
14095 \pgfcircdeclarequadpole{transformer core}{
14096
14097 \pgf@circ@drawtransformerbasicbody
14098
14099 % use the chocke line thickness
14100 \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
14101
14102 % Find the distance from center for the lines representing the core
14103 % the 2.5 is for backward compatibility --- the distance was calculated as a fraction
14104 % of the whole component, now as a fraction of the distance between coils, to be
14105 % compatible with the quadpoles "inner" style.
14106 \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@right}
14107
14108 \pgfmoveto{\pgfpoint%
14109 {\pgf@circ@res@other}%
14110 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
14111 }
14112 \pgflineto{
14113 \pgfpoint%
14114 {\pgf@circ@res@other}%
14115 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
14116 }
14117
14118 %% this should be just -\pgf@circ@res@other, but in case someone define an asymmetric trafo someday...
14119 \pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@left}
14120 \pgfmoveto{\pgfpoint%
14121 {\pgf@circ@res@other}%
14122 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
14123 }
14124 \pgflineto{
14125 \pgfpoint%
14126 {\pgf@circ@res@other}%
14127 {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
14128 }
14129
14130 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
14131 \pgfusepath{draw}
14132 }{\pgf@circ@drawtransformerbasicanchor}
14133
14134
14135 \pgfcircdeclarequadpole{gyrator}{
14136
14137 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
14138 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
14139 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
14140 \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
14141
14142 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
14143 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
14144 \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
14145 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
14146
14147 \pgfusepath{draw}
14148
14149 \pgf@circ@setlinewidth{quadpoles}{\pgflinewidth}
14150 \pgfmathsetlength{\pgf@circ@res@other}{min(.7*\stretto*\pgf@circ@res@up, .8*\pgf@circ@res@right)} % radius
14151 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{-\pgf@circ@res@other}}
14152 \pgfpatharc{-90}{90}{\pgf@circ@res@other}
14153 \pgfpathclose
14154 \pgf@circ@draworfill
14155
14156 \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@other}}
14157 \pgfpatharc{90}{270}{\pgf@circ@res@other}
14158 \pgfpathclose
14159 \pgf@circ@draworfill
14160 }{}
14161
14162 %%%%%%%%%%%%%%%%%%%%
14163 %% Block elements
14164 %%%%%%%%%%%%%%%%%%%%
14165
14166 \pgfdeclareshape{mixer}
14167 {
14168 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14169 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14170 \savedanchor\northwest{
14171 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14172 \ifpgf@circuit@boxed
14173 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14174 \pgf@y=.5\pgf@y
14175 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14176 \pgf@x=.5\pgf@x
14177 \else
14178 \pgf@y=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
14179 \pgf@y=.5\pgf@y
14180 \pgf@x=-\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
14181 \pgf@x=.5\pgf@x
14182 \fi
14183 }
14184 \anchor{center}{
14185 \pgfpointorigin
14186 }
14187 \anchor{left}{%
14188 \northwest
14189 \pgf@y=0pt
14190 }
14191 \anchor{1}{
14192 \northwest
14193 \pgf@y=0pt
14194 }
14195 \anchor{2}{
14196 \northwest
14197 \pgf@y=-\pgf@y
14198 \pgf@x=0pt
14199 }
14200 \anchor{3}{
14201 \northwest
14202 \pgf@y=0pt
14203 \pgf@x=-\pgf@x
14204 }
14205 \anchor{4}{
14206 \northwest
14207 \pgf@y=\pgf@y
14208 \pgf@x=0pt
14209 }
14210 \anchor{in 1}{
14211 \northwest
14212 \pgf@y=0pt
14213 }
14214 \anchor{in1}{
14215 \northwest
14216 \pgf@y=0pt
14217 }
14218 \anchor{in}{
14219 \northwest
14220 \pgf@y=0pt
14221 }
14222 \anchor{in 2}{
14223 \northwest
14224 \pgf@y=-\pgf@y
14225 \pgf@x=0pt
14226 }
14227 \anchor{in2}{
14228 \northwest
14229 \pgf@y=-\pgf@y
14230 \pgf@x=0pt
14231 }
14232 \anchor{out}{
14233 \northwest
14234 \pgf@y=0pt
14235 \pgf@x=-\pgf@x
14236 }
14237 \anchor{center}{
14238 \pgf@y=0pt
14239 \pgf@x=0pt
14240 }
14241 \anchor{east}{
14242 \northwest
14243 \pgf@y=0pt
14244 \pgf@x=-\pgf@x
14245 }
14246 \anchor{west}{
14247 \northwest
14248 \pgf@y=0pt
14249 }
14250 \anchor{south}{
14251 \northwest
14252 \pgf@x=0pt
14253 \pgf@y=-\pgf@y
14254 }
14255 \anchor{north}{
14256 \northwest
14257 \pgf@x=0pt
14258 }
14259 \anchor{south west}{
14260 \northwest
14261 \pgf@y=-\pgf@y
14262 }
14263 \anchor{north east}{
14264 \northwest
14265 \pgf@x=-\pgf@x
14266 }
14267 \anchor{north west}{
14268 \northwest
14269 }
14270 \anchor{south east}{
14271 \northwest
14272 \pgf@x=-\pgf@x
14273 \pgf@y=-\pgf@y
14274 }
14275 \backgroundpath{
14276 \pgfsetcolor{\ctikzvalof{color}}
14277 \pgf@circ@scaled@Rlen=\scaledRlen
14278
14279 \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
14280
14281 \pgfscope
14282 \pgfstartlinewidth=\pgflinewidth
14283
14284 % draw outer box
14285 \ifpgf@circuit@boxed
14286 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14287 \fi
14288
14289 % draw outer circle
14290 \ifpgf@circuit@boxed
14291 \pgf@circ@res@step=.7\pgf@circ@res@step
14292 \pgfsetdash{}{0pt} % draw solid circle if boxed
14293 \else
14294 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14295 \fi
14296 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14297 \pgf@circ@draworfill
14298
14299 % draw inner stuff
14300 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14301 \pgfsetlinewidth{\pgfstartlinewidth}
14302 \pgfpathmoveto{\pgfpointorigin}
14303 \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
14304 \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
14305 \pgfpathmoveto{\pgfpointorigin}
14306 \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
14307 \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
14308 \pgfusepath{draw}
14309
14310 \endpgfscope
14311 }
14312 }
14313
14314 \pgfdeclareshape{adder}
14315 {
14316 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14317 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14318 \savedanchor\northwest{
14319 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14320 \ifpgf@circuit@boxed
14321 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14322 \pgf@y=.5\pgf@y
14323 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14324 \pgf@x=.5\pgf@x
14325 \else
14326 \pgf@y=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
14327 \pgf@y=.5\pgf@y
14328 \pgf@x=-\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
14329 \pgf@x=.5\pgf@x
14330 \fi
14331 }
14332 \anchor{center}{
14333 \pgfpointorigin
14334 }
14335 \anchor{left}{%
14336 \northwest
14337 \pgf@y=0pt
14338 }
14339 \anchor{1}{
14340 \northwest
14341 \pgf@y=0pt
14342 }
14343 \anchor{2}{
14344 \northwest
14345 \pgf@y=-\pgf@y
14346 \pgf@x=0pt
14347 }
14348 \anchor{3}{
14349 \northwest
14350 \pgf@y=0pt
14351 \pgf@x=-\pgf@x
14352 }
14353 \anchor{4}{
14354 \northwest
14355 \pgf@y=\pgf@y
14356 \pgf@x=0pt
14357 }
14358 \anchor{in 1}{
14359 \northwest
14360 \pgf@y=0pt
14361 }
14362 \anchor{in1}{
14363 \northwest
14364 \pgf@y=0pt
14365 }
14366 \anchor{in}{
14367 \northwest
14368 \pgf@y=0pt
14369 }
14370 \anchor{in 2}{
14371 \northwest
14372 \pgf@y=-\pgf@y
14373 \pgf@x=0pt
14374 }
14375 \anchor{in2}{
14376 \northwest
14377 \pgf@y=-\pgf@y
14378 \pgf@x=0pt
14379 }
14380 \anchor{out}{
14381 \northwest
14382 \pgf@y=0pt
14383 \pgf@x=-\pgf@x
14384 }
14385 \anchor{center}{
14386 \pgf@y=0pt
14387 \pgf@x=0pt
14388 }
14389 \anchor{east}{
14390 \northwest
14391 \pgf@y=0pt
14392 \pgf@x=-\pgf@x
14393 }
14394 \anchor{west}{
14395 \northwest
14396 \pgf@y=0pt
14397 }
14398 \anchor{south}{
14399 \northwest
14400 \pgf@x=0pt
14401 \pgf@y=-\pgf@y
14402 }
14403 \anchor{north}{
14404 \northwest
14405 \pgf@x=0pt
14406 }
14407 \anchor{south west}{
14408 \northwest
14409 \pgf@y=-\pgf@y
14410 }
14411 \anchor{north east}{
14412 \northwest
14413 \pgf@x=-\pgf@x
14414 }
14415 \anchor{north west}{
14416 \northwest
14417 }
14418 \anchor{south east}{
14419 \northwest
14420 \pgf@x=-\pgf@x
14421 \pgf@y=-\pgf@y
14422 }
14423 \backgroundpath{
14424 \pgfsetcolor{\ctikzvalof{color}}
14425 \pgf@circ@scaled@Rlen=\scaledRlen
14426
14427 \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
14428
14429 \pgfscope
14430 \pgfstartlinewidth=\pgflinewidth
14431
14432 % draw outer box
14433 \ifpgf@circuit@boxed
14434 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14435 \fi
14436
14437 % draw outer circle
14438 \ifpgf@circuit@boxed
14439 \pgf@circ@res@step=.7\pgf@circ@res@step{}
14440 \pgfsetdash{}{0pt} % draw solid circle if boxed
14441 \else
14442 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14443 \fi
14444 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14445 \pgf@circ@draworfill
14446
14447 % draw inner stuff
14448 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14449 \pgfsetlinewidth{\pgfstartlinewidth}
14450
14451 \pgfpathmoveto{\pgfpointorigin}
14452 \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
14453 \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
14454 \pgfpathmoveto{\pgfpointorigin}
14455 \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
14456 \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
14457 \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
14458 \pgfusepath{draw}
14459
14460 \endpgfscope
14461 }
14462 }
14463
14464 \pgfdeclareshape{oscillator}
14465 {
14466 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14467 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14468 \savedanchor\northwest{
14469 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14470 \ifpgf@circuit@boxed
14471 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14472 \pgf@y=.5\pgf@y
14473 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14474 \else
14475 \pgf@y=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
14476 \pgf@y=.5\pgf@y
14477 \pgf@x=-\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
14478 \fi
14479 }
14480 \anchor{center}{
14481 \pgfpointorigin
14482 }
14483 \anchor{north}{
14484 \northwest
14485 \pgf@x=.5\pgf@x
14486 }
14487 \anchor{south}{
14488 \northwest
14489 \pgf@x=.5\pgf@x
14490 \pgf@y=-\pgf@y
14491 }
14492 \anchor{east}{
14493 \northwest
14494 \pgf@y=0pt
14495 \pgf@x=0pt
14496 }
14497 \anchor{west}{
14498 \northwest
14499 \pgf@y=0pt
14500 }
14501 \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
14502 \anchor{north east}{ \northwest \pgf@x=0pt\relax}
14503 \anchor{north west}{ \northwest }
14504 \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
14505 \anchor{text}{
14506 \pgf@x=-2\pgf@x
14507 \advance \pgf@x by -.5\wd\pgfnodeparttextbox
14508 \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
14509 }
14510 \backgroundpath{
14511 \pgfsetcolor{\ctikzvalof{color}}
14512 \pgf@circ@scaled@Rlen=\scaledRlen
14513
14514 \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen{}
14515
14516 \pgfscope
14517 \pgfstartlinewidth=\pgflinewidth
14518
14519 \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
14520
14521 % draw outer box
14522 \ifpgf@circuit@boxed{}
14523 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14524 \fi
14525
14526 % draw outer circle
14527 \ifpgf@circuit@boxed
14528 \pgf@circ@res@step=.7\pgf@circ@res@step{}
14529 \pgfsetdash{}{0pt} % draw solid circle if boxed
14530 \else
14531 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14532 \fi
14533 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14534 \pgf@circ@draworfill
14535
14536 % draw inner sine waves
14537 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14538 \pgfsetlinewidth{\pgfstartlinewidth}
14539 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
14540 \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
14541 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
14542 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
14543 \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
14544 \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
14545
14546 \pgfusepath{draw}
14547
14548 \endpgfscope
14549 }
14550 }
14551
14552 \pgfdeclareshape{circulator}
14553 {
14554 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14555 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14556 \savedanchor\northwest{
14557 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14558 \ifpgf@circuit@boxed
14559 \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14560 \pgf@y=.5\pgf@y
14561 \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
14562 \pgf@x=.5\pgf@x
14563 \else
14564 \pgf@y=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
14565 \pgf@y=.5\pgf@y
14566 \pgf@x=-\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
14567 \pgf@x=.5\pgf@x
14568 \fi
14569 }
14570 \anchor{center}{
14571 \pgfpointorigin
14572 }
14573 \anchor{left}{%
14574 \northwest
14575 \pgf@y=0pt
14576 }
14577 \anchor{1}{
14578 \northwest
14579 \pgf@y=0pt
14580 }
14581 \anchor{2}{
14582 \northwest
14583 \pgf@y=0pt
14584 \pgf@x=-\pgf@x
14585 }
14586 \anchor{3}{
14587 \northwest
14588 \pgf@y=-\pgf@y
14589 \pgf@x=0pt
14590 }
14591 \anchor{east}{
14592 \northwest
14593 \pgf@y=0pt
14594 \pgf@x=-\pgf@x
14595 }
14596 \anchor{west}{
14597 \northwest
14598 \pgf@y=0pt
14599 }
14600 \anchor{south}{
14601 \northwest
14602 \pgf@x=0pt
14603 \pgf@y=-\pgf@y
14604 }
14605 \anchor{north}{
14606 \northwest
14607 \pgf@x=0pt
14608 }
14609 \anchor{south west}{
14610 \northwest
14611 \pgf@y=-\pgf@y
14612 }
14613 \anchor{north east}{
14614 \northwest
14615 \pgf@x=-\pgf@x
14616 }
14617 \anchor{north west}{
14618 \northwest
14619 }
14620 \anchor{south east}{
14621 \northwest
14622 \pgf@x=-\pgf@x
14623 \pgf@y=-\pgf@y
14624 }
14625 \backgroundpath{
14626 \pgfsetcolor{\ctikzvalof{color}}
14627 \pgf@circ@scaled@Rlen=\scaledRlen
14628
14629 \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
14630
14631 \pgfscope
14632 \pgfstartlinewidth=\pgflinewidth
14633
14634 % draw outer box
14635 \ifpgf@circuit@boxed
14636 \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
14637 \fi
14638
14639 % draw outer circle
14640 \ifpgf@circuit@boxed{}
14641 \pgf@circ@res@step=.7\pgf@circ@res@step{}
14642 \pgfsetdash{}{0pt} % draw solid circle if boxed
14643 \else
14644 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14645 \fi
14646 \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
14647 \pgf@circ@draworfill
14648
14649 % inner arrow
14650 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14651 \pgfsetlinewidth{\pgfstartlinewidth}
14652
14653 \pgfsetarrowsend{latex}
14654 \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
14655 \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
14656 \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
14657 \pgfusepath{draw}
14658
14659 \endpgfscope
14660 }
14661 }
14662
14663
14664 % Wilkinson divider
14665 \pgfdeclareshape{wilkinson}{
14666 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14667 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14668 \savedanchor\northwest{%
14669 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14670 \pgf@y=\ctikzvalof{tripoles/wilkinson/height}\pgf@circ@scaled@Rlen
14671 \pgf@y=.5\pgf@y
14672 \pgf@x= \pgf@circ@scaled@Rlen
14673 \pgf@x=.5\pgf@x
14674 \pgf@x=-\ctikzvalof{tripoles/wilkinson/width}\pgf@x
14675 }
14676 \anchor{center}{
14677 \northwest
14678 \pgf@x=0pt
14679 \pgf@y=0pt
14680 }
14681 \anchor{north}{
14682 \northwest
14683 \pgf@x=0pt
14684 }
14685 \anchor{south}{
14686 \northwest
14687 \pgf@x=0pt
14688 \pgf@y=-\pgf@y
14689 }
14690 \anchor{west}{
14691 \northwest
14692 \pgf@y=0pt
14693 }
14694 \anchor{east}{
14695 \northwest
14696 \pgf@y=0pt
14697 \pgf@x=-\pgf@x
14698 }
14699 \anchor{south west}{
14700 \northwest
14701 \pgf@y=-\pgf@y
14702 }
14703 \anchor{north east}{
14704 \northwest
14705 \pgf@x=-\pgf@x
14706 }
14707 \anchor{north west}{
14708 \northwest
14709 }
14710 \anchor{south east}{
14711 \northwest
14712 \pgf@x=-\pgf@x
14713 \pgf@y=-\pgf@y
14714 }
14715 \anchor{in}{
14716 \northwest
14717 \pgf@y=0pt
14718 }
14719 \anchor{out1}{
14720 \northwest
14721 \pgf@x=-\pgf@x
14722 \pgf@y=-0.5\pgf@y
14723 }
14724 \anchor{out2}{
14725 \northwest
14726 \pgf@x=-\pgf@x
14727 \pgf@y=0.5\pgf@y
14728 }
14729 \anchor{text}{
14730 \northwest
14731 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
14732 \pgf@x=-.5\wd\pgfnodeparttextbox
14733 }
14734 \backgroundpath{
14735 \pgfsetcolor{\ctikzvalof{color}}
14736 \pgf@circ@scaled@Rlen=\scaledRlen
14737
14738 \northwest
14739 \pgf@circ@res@up = \pgf@y
14740 \pgf@circ@res@down = -\pgf@y
14741 \pgf@circ@res@right = -\pgf@x
14742 \pgf@circ@res@left = \pgf@x
14743
14744 \pgfstartlinewidth=\pgflinewidth
14745
14746 % draw outer box
14747 \pgf@circ@twoportbox
14748
14749 % draw inner stuff
14750 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14751 \pgfsetarrows{-} %never draw arrows
14752 \pgfsetlinewidth{\pgfstartlinewidth}
14753 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
14754 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
14755 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
14756 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
14757 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
14758 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
14759 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
14760
14761 \pgfusepath{draw}
14762
14763 \pgfsetdash{}{0pt} % always draw solid line for inner symbol
14764 % draw inner resisitor - european or american style is recognised
14765 {
14766 \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
14767 \pgftransformrotate{90}
14768
14769 % calculate size of resistor
14770 \ifpgf@circuit@europeanresistor
14771 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
14772 \pgftransformscale{\pgfmathresult}
14773 \pgfnode{genericshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
14774 \else
14775 \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
14776 \pgftransformscale{\pgfmathresult}
14777 \pgfnode{resistorshape}{center}{}{wilk@int@R}{\pgfusepath{fill}}
14778 \fi
14779 }
14780
14781 \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
14782 \pgfpathlineto{\pgfpointanchor{wilk@int@R}{right}}
14783
14784 \pgfpathmoveto{\pgfpointanchor{wilk@int@R}{left}}
14785 \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
14786 \pgfusepath{draw}
14787
14788 }
14789 }
14790
14791 %% couplers generics
14792 \long\def\pgfcircdeclarefourport#1#2{
14793
14794 \pgfdeclareshape{#1}{
14795 \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
14796 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
14797 \anchor{center}{
14798 \northwest
14799 \pgf@x=0pt
14800 \pgf@y=0pt
14801 }
14802 \savedanchor\northwest{%
14803 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
14804 \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen
14805 \pgf@y=.5\pgf@y
14806 \pgf@x=.5\pgf@circ@scaled@Rlen
14807 \pgf@x=-\ctikzvalof{quadpoles/#1/width}\pgf@x
14808 }
14809 \anchor{north}{
14810 \northwest
14811 \pgf@x=0pt
14812 }
14813 \anchor{south}{
14814 \northwest
14815 \pgf@x=0pt
14816 \pgf@y=-\pgf@y
14817 }
14818 \anchor{west}{
14819 \northwest
14820 \pgf@y=0pt
14821 }
14822 \anchor{east}{
14823 \northwest
14824 \pgf@y=0pt
14825 \pgf@x=-\pgf@x
14826 }
14827 \anchor{south west}{
14828 \northwest
14829 \pgf@y=-\pgf@y
14830 }
14831 \anchor{north east}{
14832 \northwest
14833 \pgf@x=-\pgf@x
14834 }
14835 \anchor{north west}{
14836 \northwest
14837 }
14838 \anchor{south east}{
14839 \northwest
14840 \pgf@x=-\pgf@x
14841 \pgf@y=-\pgf@y
14842 }
14843 \anchor{port1}{
14844 \northwest
14845 \pgf@y=-0.5\pgf@y
14846 }
14847 \anchor{port2}{
14848 \northwest
14849 \pgf@x=-\pgf@x
14850 \pgf@y=-0.5\pgf@y
14851 }
14852 \anchor{port3}{
14853 \northwest
14854 \pgf@x=-\pgf@x
14855 \pgf@y=0.5\pgf@y
14856 }
14857 \anchor{port4}{
14858 \northwest
14859 \pgf@y=0.5\pgf@y
14860 }
14861 \anchor{1}{
14862 \northwest
14863 \pgf@y=-0.5\pgf@y
14864 }
14865 \anchor{2}{
14866 \northwest
14867 \pgf@x=-\pgf@x
14868 \pgf@y=-0.5\pgf@y
14869 }
14870 \anchor{3}{
14871 \northwest
14872 \pgf@x=-\pgf@x
14873 \pgf@y=0.5\pgf@y
14874 }
14875 \anchor{4}{
14876 \northwest
14877 \pgf@y=0.5\pgf@y
14878 }
14879
14880 \anchor{text}{
14881 \northwest
14882 \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
14883 \pgf@x=-.5\wd\pgfnodeparttextbox
14884 }
14885 \backgroundpath{
14886 \pgfsetcolor{\ctikzvalof{color}}
14887
14888 \northwest
14889 \pgf@circ@res@up = \pgf@y
14890 \pgf@circ@res@down = -\pgf@y
14891 \pgf@circ@res@right = -\pgf@x
14892 \pgf@circ@res@left = \pgf@x
14893 \pgf@circ@scaled@Rlen=\scaledRlen
14894
14895 \pgfstartlinewidth=\pgflinewidth
14896
14897 % draw outer box
14898 \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
14899 \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
14900 \pgf@circ@draworfill
14901
14902 % draw inner stuff
14903 #2
14904
14905 % draw inner text
14906 \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
14907 }
14908 }
14909 }
14910
14911 % four-port
14912 \pgfcircdeclarefourport{fourport}{}
14913
14914 % straight coupler
14915 \pgfcircdeclarefourport{coupler}{
14916 \pgfsetlinewidth{\pgfstartlinewidth}
14917 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
14918 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
14919 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
14920 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
14921 \pgfusepath{draw}
14922
14923 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
14924 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
14925 \pgfsetarrows{latex-latex}
14926 \pgfusepath{draw}
14927 \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
14928 \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
14929 \pgfsetarrows{latex-latex}
14930 \pgfusepath{draw}
14931 }
14932
14933 % "bended" coupler
14934 \pgfcircdeclarefourport{coupler2}{
14935 \pgfsetlinewidth{\pgfstartlinewidth}
14936 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
14937 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
14938 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
14939 \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
14940 \pgfusepath{draw}
14941
14942 \pgfscope
14943 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
14944 \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
14945 \pgfsetarrowsend{latex}
14946 \pgfusepath{draw}
14947 \endpgfscope
14948 \pgfscope
14949 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
14950 \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
14951 \pgfsetarrowsend{latex}
14952 \pgfusepath{draw}
14953 \endpgfscope
14954 \pgfscope
14955 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
14956 \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
14957 \pgfsetarrowsend{latex}
14958 \pgfusepath{draw}
14959 \endpgfscope
14960 \pgfscope
14961 \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
14962 \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
14963 \pgfsetarrowsend{latex}
14964 \pgfusepath{draw}
14965 \endpgfscope
14966 }
14967
14968 %%%---------- close: tex/pgfcircquadpoles
14969 %%%%%%%%%%% Springe nach tex/pgfcircmultipoles
14970 %%%---------- open: tex/pgfcircmultipoles.tex
14971 % Copyright 2007-2009 by Massimo Redaelli
14972 % Copyright 2019 by Romano Giannetti
14973 %
14974 % This file may be distributed and/or modified
14975 %
14976 % 1. under the LaTeX Project Public License and/or
14977 % 2. under the GNU Public License.
14978 %
14979 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
14980
14981 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14982 %% Multipoles
14983 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14984
14985 %%%%%%%%%
14986 %% Chips
14987 %%%%%%%%%
14988
14989 % let's use the same shifts everywhere, no magic numbers
14990 \def\pgf@circ@dip@pin@shift{0.5}
14991 \def\pgf@circ@qfp@pin@shift{0.25}
14992
14993 % derived from https://tex.stackexchange.com/a/146753/38080
14994 % original author Mark Wibrow
14995 % Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
14996 % a lot of thanks to @marmot for the un-rotation hint
14997 % https://tex.stackexchange.com/a/473571/38080
14998
14999 % DIP (dual in line package) chips
15000
15001 \pgfdeclareshape{dipchip}{
15002 \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
15003 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15004 \savedmacro\numpins{%
15005 \pgf@circ@count@a=\ctikzvalof{multipoles/dipchip/num pins}%
15006 \def\numpins{\the\pgf@circ@count@a}
15007 }
15008 \savedanchor\centerpoint{%
15009 \pgf@x=-.5\wd\pgfnodeparttextbox%
15010 \pgf@y=-.5\ht\pgfnodeparttextbox%
15011 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
15012 }%
15013 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
15014 \anchor{center}{\origin}
15015 \anchor{text}{\centerpoint}% to adjust text
15016 \saveddimen\height{%
15017 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15018 \pgfmathsetlength\pgf@x{((\numpins)
15019 *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
15020 }%
15021 \saveddimen{\chipspacing}{
15022 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15023 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/pin spacing}}}
15024 \saveddimen{\width}{
15025 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15026 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}}
15027 \saveddimen{\extshift}{
15028 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15029 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
15030 % standard anchors
15031 \savedanchor\northwest{%
15032 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15033 \pgfmathsetlength\pgf@y{0.5*((\numpins)
15034 *\ctikzvalof{multipoles/dipchip/pin spacing})*\pgf@circ@scaled@Rlen/2}%
15035 \pgfmathsetlength\pgf@x{-0.5*\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/dipchip/width}}
15036 }
15037 \anchor{dot}{\northwest
15038 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
15039 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
15040 }
15041 \anchor{nw}{\northwest}
15042 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
15043 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
15044 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
15045 \anchor{north west}{\northwest}
15046 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
15047 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
15048 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
15049 \anchor{n}{\northwest\pgf@x=0pt }
15050 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15051 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15052 \anchor{w}{\northwest\pgf@y=0pt }
15053 \anchor{north}{\northwest\pgf@x=0pt }
15054 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15055 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15056 \anchor{west}{\northwest\pgf@y=0pt }
15057 % start drawing
15058 \backgroundpath{%
15059 \northwest
15060 \pgf@circ@res@up = \pgf@y
15061 \pgf@circ@res@down = -\pgf@y
15062 \pgf@circ@res@right = -\pgf@x
15063 \pgf@circ@res@left = \pgf@x
15064 \pgf@circ@scaled@Rlen=\scaledRlen
15065 \pgf@circ@res@step = \ctikzvalof{multipoles/dipchip/pin spacing}\pgf@circ@scaled@Rlen
15066 \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
15067 \pgfscope% (for the line width)
15068 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
15069 \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
15070 \pgf@circ@draworfill
15071 %% upside mark
15072 \ifpgf@circuit@chip@topmark
15073 \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
15074 \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
15075 \fi
15076 \pgfusepath{stroke}%
15077 \pgfsetcolor{\ctikzvalof{color}}
15078 % Adding the pin number
15079 \ifpgf@circuit@chip@shownumbers
15080 \pgf@circ@count@a=\numpins\relax
15081 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
15082 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
15083 \ifpgf@circuit@chip@straightnumbers
15084 \pgfgettransformentries\a\b\temp\temp\temp\temp
15085 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
15086 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
15087 \else
15088 \pgfmathsetmacro{\rot}{0}
15089 \pgfmathsetmacro{\quadrant}{0}
15090 \fi
15091 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
15092 \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
15093 \pgfmathloop%
15094 \ifnum\pgf@circ@count@a>0
15095 \ifcase\quadrant % rotation 0
15096 % left
15097 \pgf@circ@count@c=\pgf@circ@count@a
15098 \pgftext[left,
15099 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15100 rotate=\rot]{\mytext}
15101 % right
15102 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15103 \pgftext[right,
15104 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15105 rotate=\rot]{\mytext}
15106 \or % rotation -90
15107 % left
15108 \pgf@circ@count@c=\pgf@circ@count@a
15109 \pgftext[top,
15110 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15111 rotate=\rot]{\mytext}
15112 % right
15113 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15114 \pgftext[bottom,
15115 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15116 rotate=\rot]{\mytext}
15117 \or %rotation 180
15118 % left
15119 \pgf@circ@count@c=\pgf@circ@count@a
15120 \pgftext[right,
15121 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15122 rotate=\rot]{\mytext}
15123 % right
15124 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15125 \pgftext[left,
15126 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15127 rotate=\rot]{\mytext}
15128 \or % rotation +90
15129 % left
15130 \pgf@circ@count@c=\pgf@circ@count@a
15131 \pgftext[bottom,
15132 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15133 rotate=\rot]{\mytext}
15134 % right
15135 \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15136 \pgftext[top,
15137 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15138 rotate=\rot]{\mytext}
15139 \fi
15140 \advance\pgf@circ@count@a-1\relax%
15141 \repeatpgfmathloop
15142 \fi
15143 \endpgfscope
15144 \ifdim\pgf@circ@res@other>0pt
15145 \pgfscope
15146 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
15147 \pgf@circ@count@a=\numpins\relax
15148 \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a
15149 \pgfmathloop%
15150 \ifnum\pgf@circ@count@a>0
15151 \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
15152 \ifnum\padfrac>0
15153 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
15154 % left side pads
15155 \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}}
15156 \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}}
15157 \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}}
15158 \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}}
15159 % right side pads
15160 \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}}
15161 \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}}
15162 \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}}
15163 \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}}
15164 \else
15165 % left side pins
15166 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15167 \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}}
15168 % right side pins
15169 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15170 \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}}
15171 \fi
15172 \advance\pgf@circ@count@a by -1\relax%
15173 \repeatpgfmathloop
15174 \pgfusepath{stroke}
15175 \endpgfscope
15176 \fi
15177 }%
15178 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
15179 % and is executed just before a node is drawn.
15180 \pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
15181 % Start with the maximum pin number and go backwards.
15182 \pgf@circ@count@a=\numpins\relax
15183 \pgfmathloop%
15184 \ifnum\pgf@circ@count@a>0
15185 % we will create two anchors per pin: the "normal one" like `pin 1` for the
15186 % electrical contact, and the "border one" like `bpin 1` for labels.
15187 % they will coincide if `external pins width` is set to 0.
15188 \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{%
15189 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}%
15190 }
15191 \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{%
15192 \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}%
15193 }
15194 \advance\pgf@circ@count@a by -1\relax%
15195 \repeatpgfmathloop%
15196 }%
15197 }
15198
15199 % QFP (quad flat package) chips
15200
15201 \pgfdeclareshape{qfpchip}{
15202 \savedmacro{\ctikzclass}{\edef\ctikzclass{chips}}
15203 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15204 \savedmacro\numpins{%
15205 \pgf@circ@count@a=\ctikzvalof{multipoles/qfpchip/num pins}%
15206 \def\numpins{\the\pgf@circ@count@a}
15207 }
15208 \savedanchor\centerpoint{%
15209 \pgf@x=-.5\wd\pgfnodeparttextbox%
15210 \pgf@y=-.5\ht\pgfnodeparttextbox%
15211 \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
15212 }%
15213 \savedanchor\origin{\pgfpoint{0pt}{0pt}}
15214 \anchor{center}{\origin}
15215 \anchor{text}{\centerpoint}% to adjust text
15216 \saveddimen\height{%
15217 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15218 \pgfmathsetlength\pgf@x{((\numpins+2)
15219 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
15220 }%
15221 \saveddimen\width{%
15222 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15223 \pgfmathsetlength\pgf@x{((\numpins+2)
15224 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
15225 }%
15226 \saveddimen{\chipspacing}{
15227 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15228 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/qfpchip/pin spacing}}}
15229 \saveddimen{\extshift}{
15230 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15231 \pgfmathsetlength\pgf@x{\pgf@circ@scaled@Rlen*\ctikzvalof{multipoles/external pins width}}}
15232 % standard anchors
15233 \savedanchor\northwest{%
15234 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15235 \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
15236 *\ctikzvalof{multipoles/qfpchip/pin spacing})*\pgf@circ@scaled@Rlen/4}%
15237 \pgf@x=-\pgf@y
15238 }
15239 \anchor{dot}{\northwest
15240 \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
15241 \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
15242 }
15243 \anchor{nw}{\northwest}
15244 \anchor{ne}{\northwest\pgf@x=-\pgf@x}
15245 \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
15246 \anchor{sw}{\northwest\pgf@y=-\pgf@y}
15247 \anchor{north west}{\northwest}
15248 \anchor{north east}{\northwest\pgf@x=-\pgf@x}
15249 \anchor{south east}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
15250 \anchor{south west}{\northwest\pgf@y=-\pgf@y}
15251 \anchor{n}{\northwest\pgf@x=0pt }
15252 \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15253 \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15254 \anchor{w}{\northwest\pgf@y=0pt }
15255 \anchor{north}{\northwest\pgf@x=0pt }
15256 \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
15257 \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
15258 \anchor{west}{\northwest\pgf@y=0pt }
15259 % start drawing
15260 \backgroundpath{%
15261 \northwest
15262 \pgf@circ@res@up = \pgf@y
15263 \pgf@circ@res@down = -\pgf@y
15264 \pgf@circ@res@right = -\pgf@x
15265 \pgf@circ@res@left = \pgf@x
15266 \pgf@circ@scaled@Rlen=\scaledRlen
15267 \pgf@circ@res@step = \ctikzvalof{multipoles/qfpchip/pin spacing}\pgf@circ@scaled@Rlen
15268 \pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
15269 \pgfscope% (for the line width)
15270 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
15271 %% upside mark
15272 \ifpgf@circuit@chip@topmark
15273 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
15274 \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
15275 \else
15276 \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
15277 \fi
15278 %% rest of the shape
15279 \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
15280 \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
15281 \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
15282 \pgfpathclose
15283 \pgf@circ@draworfill
15284 % Adding the pin number
15285 \pgfsetcolor{\ctikzvalof{color}}
15286 \ifpgf@circuit@chip@shownumbers
15287 \pgf@circ@count@a=\numpins%
15288 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
15289 % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
15290 \ifpgf@circuit@chip@straightnumbers
15291 \pgfgettransformentries\a\b\temp\temp\temp\temp
15292 \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
15293 \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
15294 \else
15295 \pgfmathsetmacro{\rot}{0}
15296 \pgfmathsetmacro{\quadrant}{0}
15297 \fi
15298 \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
15299 \def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
15300 \pgfmathloop%
15301 \ifnum\pgf@circ@count@a>0
15302 \ifcase\quadrant % rotation 0
15303 % left
15304 \pgf@circ@count@c=\pgf@circ@count@a
15305 \pgftext[left,
15306 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15307 rotate=\rot]{\mytext}
15308 % bottom
15309 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15310 \pgftext[bottom,
15311 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15312 rotate=\rot]{\mytext}
15313 % right
15314 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15315 \pgftext[right,
15316 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15317 rotate=\rot]{\mytext}
15318 % top
15319 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15320 \pgftext[top,
15321 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15322 rotate=\rot]{\mytext}
15323 \or % rotation -90
15324 % left
15325 \pgf@circ@count@c=\pgf@circ@count@a
15326 \pgftext[top,
15327 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15328 rotate=\rot]{\mytext}
15329 % bottom
15330 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15331 \pgftext[left,
15332 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15333 rotate=\rot]{\mytext}
15334 % right
15335 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15336 \pgftext[bottom,
15337 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15338 rotate=\rot]{\mytext}
15339 % top
15340 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15341 \pgftext[right,
15342 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15343 rotate=\rot]{\mytext}
15344 \or %rotation 180
15345 % left
15346 \pgf@circ@count@c=\pgf@circ@count@a
15347 \pgftext[right,
15348 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15349 rotate=\rot]{\mytext}
15350 % bottom
15351 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15352 \pgftext[top,
15353 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15354 rotate=\rot]{\mytext}
15355 % right
15356 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15357 \pgftext[left,
15358 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15359 rotate=\rot]{\mytext}
15360 % top
15361 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15362 \pgftext[bottom,
15363 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15364 rotate=\rot]{\mytext}
15365 \or % rotation +90
15366 % left
15367 \pgf@circ@count@c=\pgf@circ@count@a
15368 \pgftext[bottom,
15369 at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15370 rotate=\rot]{\mytext}
15371 % bottom
15372 \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax
15373 \pgftext[right,
15374 at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down},
15375 rotate=\rot]{\mytext}
15376 % right
15377 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax
15378 \pgftext[top,
15379 at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step},
15380 rotate=\rot]{\mytext}
15381 % top
15382 \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax
15383 \pgftext[left,
15384 at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up},
15385 rotate=\rot]{\mytext}
15386 \fi
15387 \advance\pgf@circ@count@a-1\relax%
15388 \repeatpgfmathloop
15389 \fi
15390 \endpgfscope
15391 \ifdim\pgf@circ@res@other>0pt
15392 \pgfscope
15393 \pgfsetlinewidth{\ctikzvalof{multipoles/external pins thickness}\pgflinewidth}
15394 \pgf@circ@count@a=\numpins%
15395 \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
15396 \pgfmathloop%
15397 \ifnum\pgf@circ@count@a>0
15398 \edef\padfrac{\ctikzvalof{multipoles/external pad fraction}}
15399 \ifnum\padfrac>0
15400 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
15401 % left side pads
15402 \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}}
15403 \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}}
15404 \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}}
15405 \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}}
15406 % bottom side pads
15407 \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}}
15408 \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}}
15409 \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}}
15410 \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}}
15411 % right side pads
15412 \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}}
15413 \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}}
15414 \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}}
15415 \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}}
15416 % top side pads
15417 \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}}
15418 \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}}
15419 \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}}
15420 \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}}
15421 \else
15422 % left side pins
15423 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15424 \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}}
15425 % bottom side pins
15426 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}}
15427 \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}}
15428 % right side pins
15429 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}}
15430 \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}}
15431 % top side pins
15432 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}}
15433 \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}}
15434 \fi
15435 \advance\pgf@circ@count@a-1\relax%
15436 \repeatpgfmathloop
15437 \pgfusepath{stroke}
15438 \endpgfscope
15439 \fi
15440 }%
15441 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
15442 % and is executed just before a node is drawn.
15443 \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
15444 % Start with the maximum pin number and go backwards.
15445 \pgf@circ@count@a=\numpins%
15446 \pgfmathloop%
15447 \ifnum\pgf@circ@count@a>0
15448 \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{%
15449 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}%
15450 }
15451 \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{%
15452 \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}%
15453 }
15454 \advance\pgf@circ@count@a-1\relax%
15455 \repeatpgfmathloop%
15456 }%
15457 }
15458
15459 %% anchors for DIP
15460 \def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
15461 \c@pgf@countc=\numpins\relax
15462 \divide\c@pgf@countc by 2
15463 \ifnum #1 > \the\c@pgf@countc
15464 % right side
15465 \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
15466 \else
15467 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
15468 \fi
15469 }
15470
15471 %% anchors for QFP
15472 \def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
15473 \c@pgf@countc=\numpins\relax
15474 \divide\c@pgf@countc by 4
15475 \ifnum #1 > \the\c@pgf@countc
15476 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
15477 \ifnum #1 > \the\c@pgf@countb
15478 \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
15479 \ifnum #1 > \the\c@pgf@countb
15480 % 3*npins/4 < pin, top side
15481 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
15482 \else
15483 % 2*npins/4 < pin <= 3*npins/4, right side
15484 \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
15485 \fi
15486 \else
15487 % npins/4 < pin <= 2*npins/4, bottom side
15488 \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
15489 \fi
15490 \else
15491 % <= npins/4, left side
15492 \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
15493 \fi
15494 }
15495
15496 %%%%%%%%%%%%%%%%%
15497 %% Rotary Switch
15498 %%%%%%%%%%%%%%%%%
15499
15500 \pgfdeclareshape{rotaryswitch}
15501 {
15502 \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
15503 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15504 \savedanchor\northeast{%
15505 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15506 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15507 % the magic number is 0.25/cos(35)
15508 % try to recalculate it for the actual switch
15509 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15510 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
15511 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
15512 \edef\r{\ctikzvalof{nodes width}}
15513 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
15514 \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@scaled@Rlen + \pgf@circ@res@temp}
15515 }
15516 \savedanchor\northwest{%
15517 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15518 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15519 % the magic number is 0.25/cos(35)
15520 % try to recalculate it for the actual switch
15521 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15522 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
15523 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
15524 \edef\r{\ctikzvalof{nodes width}}
15525 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
15526 \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@scaled@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
15527 }
15528 \savedanchor\central{%
15529 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15530 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15531 % the magic number is 0.25/cos(35)
15532 % try to recalculate it for the actual switch
15533 \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15534 \pgf@circ@res@temp=.3052\pgf@circ@res@temp
15535 \edef\a{\ctikzvalof{multipoles/rotary/angle}}
15536 \edef\r{\ctikzvalof{nodes width}}
15537 \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@scaled@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
15538 \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
15539 }
15540 % external square limits
15541 \savedanchor\extnorthwest{%
15542 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15543 \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
15544 % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
15545 \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
15546 \pgf@x=2.5\pgf@x % external square size
15547 \pgf@y=-\pgf@x %square thing when angle=180?
15548 }
15549 \saveddimen{\width}{
15550 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15551 \pgfmathsetlength\pgf@x{0.3052*\pgf@circ@scaled@Rlen*\ctikzvalof{tripoles/spdt/width}}}
15552 % radius of the connector
15553 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
15554 \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
15555 % shapename
15556 \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
15557 % shape type
15558 \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
15559 \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
15560 \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
15561 \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
15562 \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
15563 % mid of the lever, to stack switches
15564 %\anchor{mid}{\midlever}
15565 \anchor{mid}{\northwest
15566 \pgf@circ@res@temp=-\pgf@x
15567 \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
15568 \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
15569 }
15570 % center anchors
15571 \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
15572 % horizontal angles
15573 \anchor{in}{ \northwest \pgf@y=0pt}
15574 \anchor{ain}{ \northwest \pgf@y=0pt}
15575
15576 \anchor{center}{ \central \pgf@y=0pt }
15577 \anchor{east}{ \northeast \pgf@y=0pt }
15578 \anchor{west}{ \northwest \pgf@y=0pt }
15579 \anchor{south}{ \central \pgf@y=-\pgf@y }
15580 \anchor{north}{ \central }
15581 \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
15582 \anchor{north east}{ \northeast }
15583 \anchor{north west}{ \northwest }
15584 \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
15585
15586 \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
15587 \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
15588 \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
15589 \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
15590 \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
15591 \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
15592 \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
15593 \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
15594 \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
15595
15596 \backgroundpath{
15597 \pgfsetcolor{\ctikzvalof{color}}
15598 \pgf@circ@res@right = \width
15599 \pgf@circ@res@left = -\width
15600
15601 \pgfscope %wiper
15602 % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
15603 \pgf@circ@res@temp=\radius\relax
15604 \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
15605 \pgfsetlinewidth{2\pgf@circ@res@temp}
15606 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
15607 \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
15608 \pgfsetroundcap\pgfusepath{draw}
15609 \endpgfscope
15610
15611 \ifpgf@circ@rotaryarrow
15612 \pgfscope % arrow
15613 \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
15614 \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
15615 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
15616 \pgftransformrotate{\wiper}
15617 \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
15618 \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
15619 \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
15620 \pgfusepath{draw}
15621 \endpgfscope
15622 \fi
15623
15624 % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa}
15625 \pgf@circ@count@a=\channels\relax
15626 \pgfmathsetmacro{\currenta}{-\angle}
15627 \pgfmathloop%
15628 \ifnum\pgf@circ@count@a>0
15629 % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
15630 \pgfscope
15631 \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
15632 \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}}
15633 \endpgfscope
15634 \pgfmathsetmacro{\currenta}{\currenta+\stepa}
15635 % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
15636 \advance\pgf@circ@count@a by -1\relax%
15637 \repeatpgfmathloop
15638
15639 \pgfscope % input
15640 \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
15641 \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
15642 \endpgfscope
15643 }
15644 % \pgf@sh@s@<name of the shape here> contains all the code for the shape
15645 % and is executed just before a node is drawn.
15646 \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
15647 % Start with the maximum pin number and go backwards.
15648 \pgf@circ@count@a=\channels\relax
15649 \pgfmathloop%
15650 \ifnum\pgf@circ@count@a>0
15651 % we will create two anchors per pin: the "normal one" like `pin 1` for the
15652 % electrical contact, and the "border one" like `bpin 1` for labels.
15653 % they will coincide if `external pins width` is set to 0.
15654 \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{%
15655 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}%
15656 }
15657 \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{%
15658 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}%
15659 }
15660 \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{%
15661 \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}%
15662 }
15663 \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{%
15664 \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}%
15665 }
15666 \advance\pgf@circ@count@a by -1\relax%
15667 \repeatpgfmathloop%
15668 }%
15669 }
15670
15671 \def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
15672 \pgf@circ@res@temp=\width
15673 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
15674 \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
15675 \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
15676 \advance\pgf@x by -\pgf@circ@res@temp
15677 }
15678
15679 \def\pgf@circ@rotarysqanchor#1{% external square anchors
15680 \pgf@circ@res@temp=\width
15681 \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
15682 \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
15683 \advance\pgf@x by -\pgf@circ@res@temp
15684 }
15685
15686 %%%%%%%%%%%%%%%%%%%%%%%%%%
15687 % Seven segments displays
15688 %%%%%%%%%%%%%%%%%%%%%%%%%%
15689
15690 \pgfdeclareshape{bare7seg}{
15691 \savedmacro{\ctikzclass}{\edef\ctikzclass{displays}}
15692 \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
15693 \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
15694 \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
15695 \ifpgf@circ@sevenseg@dot
15696 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
15697 \else
15698 \pgf@x=0pt
15699 \fi
15700 }
15701 % The object extension is more or less (-width/2,-width) to (width/2,width)
15702 % and adjusted for line thickness (both sides) and eventually the dot
15703 \saveddimen{\width}{
15704 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15705 \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}}
15706 \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
15707 \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
15708 \savedanchor{\southwest}{% both negative
15709 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15710 \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
15711 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
15712 \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
15713 -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
15714 }
15715 \savedanchor{\northeast}{% both positive
15716 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15717 \ifpgf@circ@sevenseg@dot
15718 \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
15719 \else
15720 \pgf@circ@res@other=0pt
15721 \fi
15722 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
15723 +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
15724 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen
15725 +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
15726 }
15727 \savedanchor{\topright}{% anchor without the box sep and the thickness
15728 \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
15729 \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
15730 \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@scaled@Rlen}
15731 }
15732 \anchor{center}{\pgfpointorigin}
15733 \anchor{north west}{\southwest\pgf@y=-\pgf@y}
15734 \anchor{north east}{\northeast}
15735 \anchor{south east}{\northeast\pgf@y=-\pgf@y}
15736 \anchor{south west}{\southwest}
15737 \anchor{north}{\northeast\pgf@x=0pt}
15738 \anchor{east}{\northeast\pgf@y=0pt}
15739 \anchor{south}{\southwest\pgf@x=0pt}
15740 \anchor{west}{\southwest\pgf@y=0pt}
15741 \anchor{a}{\topright\pgf@x=0pt}
15742 \anchor{b}{\topright\pgf@y=0.5\pgf@y}
15743 \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
15744 \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
15745 \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
15746 \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
15747 \anchor{g}{\pgfpointorigin}
15748 \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
15749 \behindbackgroundpath{%
15750 \southwest % I do not want the dot here, it will stick out
15751 \pgf@circ@res@up = -\pgf@y
15752 \pgf@circ@res@down = \pgf@y
15753 \pgf@circ@res@right = \pgf@x
15754 \pgf@circ@res@left = -\pgf@x
15755 \pgfscope
15756 \pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
15757 \pgfsetcolor{\ctikzvalof{color}}
15758 \pgfpathrectanglecorners%
15759 {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
15760 {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
15761 \ifpgf@circ@sevenseg@box
15762 \pgf@circ@draworfill
15763 \else
15764 \pgf@circ@maybefill
15765 \fi
15766 \endpgfscope
15767 \edef\bits{\ctikzvalof{seven seg/bits}}
15768 \pgfscope
15769 \pfg@circ@sseg@drawbits{\bits}
15770 \endpgfscope
15771 \pgfscope
15772 \ifpgf@circ@sevenseg@dot
15773 \pgf@circ@sseg@drawdots
15774 \fi
15775 \endpgfscope
15776 }
15777 }
15778
15779 \def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
15780 \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
15781 }
15782 \def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
15783 \ifnum #1 > 0\relax
15784 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
15785 \else
15786 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
15787 \fi
15788 \pgfpathmoveto{\pgfpoint{#2}{#3}}
15789 \pgfpathlineto{\pgfpoint{#4}{#5}}
15790 \pgfusepath{draw}
15791 }
15792 \def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
15793 \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
15794 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
15795 \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
15796 % \pgfsetroundcap
15797 \pgfsetarrowsstart{Triangle Cap[]}
15798 \pgfsetarrowsend{Triangle Cap[]}
15799 % segments
15800 \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
15801 \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
15802 \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
15803 \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
15804 \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
15805 \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
15806 \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
15807 }
15808 \def\pgf@circ@sseg@drawdots{% dots
15809 \edef\what{empty}
15810 \ifx\what\pgf@circ@sevenseg@dotstate
15811 % do nothing
15812 \else
15813 \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
15814 \edef\what{off}
15815 \ifx\what\pgf@circ@sevenseg@dotstate
15816 % dot off
15817 \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
15818 \pgfsetcolor{\ctikzvalof{seven seg/color off}}
15819 \else
15820 % dot on
15821 \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
15822 \pgfsetcolor{\ctikzvalof{seven seg/color on}}
15823 \fi
15824 \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
15825 \pgfusepath{draw,fill}
15826 \fi
15827 }
15828 %%%---------- close: tex/pgfcircmultipoles
15829
15830 %%%%%%%%%%% Springe nach tex/pgfcirclabel
15831 %%%---------- open: tex/pgfcirclabel.tex
15832 % Copyright 2007-2009 by Massimo Redaelli
15833 %
15834 % This file may be distributed and/or modified
15835 %
15836 % 1. under the LaTeX Project Public License and/or
15837 % 2. under the GNU Public License.
15838 %
15839 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
15840
15841 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15842 %% Bipole label positioning
15843
15844 %% bipole labels and annotation extra style
15845
15846 \ctikzset{bipole label style/.style={}}
15847 \tikzset{bipole label style/.code={
15848 \ctikzset{bipole label style/.style={#1}}
15849 }}
15850 \tikzset{bipole label append style/.code={
15851 \ctikzset{bipole label style/.append style={#1}}
15852 }}
15853 \ctikzset{bipole annotation style/.style={}}
15854 \tikzset{bipole annotation style/.code={
15855 \ctikzset{bipole annotation style/.style={#1}}
15856 }}
15857 \tikzset{bipole annotation append style/.code={
15858 \ctikzset{bipole annotation style/.append style={#1}}
15859 }}
15860
15861 %% Options
15862 \ctikzset{label/.style = { l=#1 } }
15863 \ctikzset{l/.code = {
15864 \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
15865 \ctikzsetvalof{bipole/label/unit}{}
15866 \ifpgf@circ@siunitx
15867 \pgf@circ@handleSI{#1}
15868 \ifpgf@circ@siunitx@res
15869 \edef\pgf@temp{\pgf@circ@handleSI@val}
15870 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
15871 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15872 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
15873 \else
15874 \fi
15875 \else
15876 \fi
15877 }}
15878
15879 \ctikzset{label above/.code = {
15880 l=#1,
15881 \circuitikzbasekey/bipole/label/position=90 }
15882 }
15883
15884 \ctikzset{l^/.style = {
15885 l=#1,
15886 \circuitikzbasekey/bipole/label/position=90 }
15887 }
15888
15889 \ctikzset{label below/.code = {
15890 l=#1,
15891 \circuitikzbasekey/bipole/label/position=-90 }
15892 }
15893
15894 \ctikzset{l_/.style = {
15895 l=#1,
15896 \circuitikzbasekey/bipole/label/position=-90 }
15897 }
15898
15899 \ctikzset{annotation/.style = { a=#1 } }
15900 \ctikzset{a/.code = {
15901 \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
15902 \ctikzsetvalof{bipole/annotation/unit}{}
15903 \ifpgf@circ@siunitx
15904 \pgf@circ@handleSI{#1}
15905 \ifpgf@circ@siunitx@res
15906 \edef\pgf@temp{\pgf@circ@handleSI@val}
15907 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
15908 \edef\pgf@temp{\pgf@circ@handleSI@unit}
15909 \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
15910 \else
15911 \fi
15912 \else
15913 \fi
15914 }}
15915
15916 \ctikzset{annotation above/.code = {
15917 a=#1,
15918 \circuitikzbasekey/bipole/annotation/position=90 }
15919 }
15920
15921 \ctikzset{a^/.style = {
15922 a=#1,
15923 \circuitikzbasekey/bipole/annotation/position=90 }
15924 }
15925
15926 \ctikzset{annotation below/.code = {
15927 a=#1,
15928 \circuitikzbasekey/bipole/annotation/position=-90 }
15929 }
15930 \ctikzset{a_/.style = {
15931 a=#1,
15932 \circuitikzbasekey/bipole/annotation/position=-90 }
15933 }
15934
15935 % This is to adjust spacing for the labels so that they are not cramped on components
15936 \def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
15937
15938 \def\pgf@circ@drawlabels#1{
15939 \pgfextra{
15940 % This function will be called with argument #1 equal
15941 % to "label" or "annotation" form pgfcircpath.tex.
15942 % pgf@circ@direction is the direction of the path,
15943 % its value is set in pgfcircpath.tex
15944 \pgfmathsubtract{\pgf@circ@direction}{90}
15945 \pgfmathround{\pgfmathresult} % avoid precision loss errors
15946 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15947
15948 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
15949 \ifnum \pgf@circ@temp < 0
15950 \pgfmathadd{\pgf@circ@labanc}{180}
15951 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15952 \fi
15953 % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
15954 %
15955 % normalize the angle values
15956 %
15957 \pgfmathmod{\pgf@circ@labanc}{360}
15958 \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15959 %
15960 \ifpgf@circuit@bipole@inverted
15961 \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
15962 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15963 \fi
15964 %
15965 \ifnum \ctikzvalof{mirror value} = -1
15966 \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
15967 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15968 \fi
15969 % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
15970 }
15971 %Firstly, place a coordinate directly at the edge of the shape
15972 (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
15973 %now decide, which labels should be drawn
15974 \pgfextra{
15975 \edef\pgf@temp{\ctikzvalof{label/align}}
15976 \def\pgf@circ@temp{straight}
15977 }
15978 \ifx\pgf@temp\pgf@circ@temp %straight
15979 \pgf@circ@drawreglabels{#1}
15980 \else
15981 \pgfextra{\def\pgf@circ@temp{rotate}}
15982 \ifx\pgf@temp\pgf@circ@temp %rotate
15983 \pgf@circ@drawrotlabels{#1}
15984 \else% smart
15985 \pgf@circ@drawsmartlabels{#1}
15986 \fi
15987 \fi
15988 }
15989
15990
15991 \def\pgf@circ@drawsmartlabels#1{
15992 \pgfextra{
15993 \pgfmathmod{\pgf@circ@direction}{90}
15994 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
15995 }
15996 \ifnum \pgfcircmathresult > 20
15997 \ifnum \pgfcircmathresult < 70
15998 \pgf@circ@drawrotlabels{#1}
15999 \else
16000 \pgf@circ@drawreglabels{#1}
16001 \fi
16002 \else
16003 \pgf@circ@drawreglabels{#1}
16004 \fi
16005 }
16006
16007
16008 \def\pgf@circ@drawrotlabels#1{
16009 \pgfextra{
16010 % scale the distances in function of zoom, so that they are not
16011 % dependent on it but on font size. Thanks to @marmot
16012 % https://tex.stackexchange.com/a/476018/38080
16013 % the coeffcient is adjusted so that the distance is more or less
16014 % the same for rotated labels and straight ones (although it will
16015 % depend on the font, so it's not exact).
16016 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
16017 \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
16018 \ifnum \ctikzvalof{bipole/#1/position}>0
16019 %we need some more space for placement below, due to mid-anchor
16020 \else % we do not have <= in \ifnum...
16021 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
16022 \fi
16023 %Calculate rotation of the label from direction and strip decimals
16024 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
16025 % rotate the label at second or third quadrant:
16026 \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
16027 \pgfmathsubtract{\pgf@circ@direction}{180}
16028 \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16029 %invert the space relationships due to rotated strings
16030 \ifnum \ctikzvalof{bipole/#1/position}>0
16031 \pgf@circ@res@temp=1.5\pgf@circ@res@temp
16032 \fi
16033 \fi\fi
16034 \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
16035 \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16036 }
16037 % reset cm is not working correctly here
16038 (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) coordinate(labelcoor)
16039 node[anchor=mid, rotate=\pgfcirclabrot, \circuitikzbasekey/bipole #1 style]
16040 (\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
16041 }
16042
16043 \def\pgf@circ@drawreglabels#1{
16044 %Now calculate all shape positions
16045 %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
16046 %All points between will be addressed by angled-anchors:
16047 \pgfextra{
16048 % scale ex-distance to make it independent on scale
16049 % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
16050 \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
16051 \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
16052 \pgfmathadd{\pgf@circ@labanc}{90}
16053 \pgfmathround{\pgfmathresult}
16054 \def\pgf@circ@labanctext{\pgf@circ@labanc}
16055 \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16056 \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
16057 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16058 }
16059 %Values around 90 are at both y-axis
16060 \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
16061 \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
16062 \ifnum \pgf@circ@labpos > 180
16063 \ifnum \ctikzvalof{bipole/#1/position} > 0
16064 \pgfextra{\def\pgf@circ@labanctext{mid west}}
16065 \else
16066 \pgfextra{\def\pgf@circ@labanctext{mid east}}
16067 \fi
16068 \else
16069 \ifnum \ctikzvalof{bipole/#1/position} > 0
16070 \pgfextra{\def\pgf@circ@labanctext{mid east}}
16071 \else
16072 \pgfextra{\def\pgf@circ@labanctext{mid west}}
16073 \fi
16074 \fi
16075 \fi\fi
16076 %Values between -5 and 5 are at pos /neg x-axis
16077 \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
16078 \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
16079 \ifnum \ctikzvalof{bipole/#1/position} < 0
16080 \ifnum \pgf@circ@labanc > 90
16081 % using base coordinate instead of south to naturally align
16082 % symbols with descendants; but this invalidate the effect of
16083 % the inner sep, so recover it by shifting the anchor
16084 % reset cm is not working sometime, use @marmot solution
16085 % see https://tex.stackexchange.com/a/476018/38080
16086 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
16087 \pgfextra{\def\pgf@circ@labanctext{base}}%base
16088 \else
16089 \pgfextra{\def\pgf@circ@labanctext{north}}%north
16090 \fi
16091 \else
16092 \ifnum \pgf@circ@labanc < 90
16093 % shift, as above
16094 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
16095 \pgfextra{\def\pgf@circ@labanctext{base}}%base
16096 \else
16097 \ifnum \pgf@circ@labanc > 180
16098 % this shouldn't happen, but somehow it does (270 degree anchors)
16099 % shift, as above
16100 (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
16101 \pgfextra{\def\pgf@circ@labanctext{base}}%base
16102 \else
16103 \pgfextra{\def\pgf@circ@labanctext{north}}%north
16104 \fi
16105 \fi
16106 \fi
16107 \fi\fi
16108 (labelcoor) node[anchor=\pgf@circ@labanctext,
16109 inner sep=0.5\pgf@circ@res@temp, outer sep=0pt, \circuitikzbasekey/bipole #1 style,
16110 ](\ctikzvalof{bipole/name}#1){\strut\pgf@circ@finallabels{#1}%
16111 }
16112 }
16113
16114 \def\pgf@circ@finallabels#1{%
16115 \edef\pgf@temp{}%
16116 \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
16117 \ifx\pgf@temp\pgf@circ@temp%
16118 \ctikzvalof{bipole/#1/name}%
16119 \else%
16120 $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
16121 \fi%
16122 }
16123
16124 \ctikzset{text/.style={t=#1}}
16125 \ctikzset{t/.code={%
16126 \ctikzsetvalof{bipoles/twoport/text}{#1}%
16127 }}
16128
16129 %%%% Stacked labels
16130 %
16131 % stacked labels by Romano Giannetti [email protected]
16132 % heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
16133 % \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
16134 %
16135 % labels are in a tabular, globally aligned:
16136 % vertically with key l2 valign (default c)
16137 % c: center t: top b: bottom
16138 % horizontally with key l2 align (default l)
16139 % l: left c: centered r: right
16140 % you can switch sides using l2_=... and l2^=...
16141 % syntax is l2_ = line1 and line2 (same for l2^)
16142 %
16143 \ctikzset{%
16144 l2 valign/.store in=\ltwo@valign, l2 valign=c,
16145 l2 halign/.store in=\ltwo@halign, l2 halign=l,
16146 }
16147 \ctikzset{l2base/.code n args={2}{
16148 \pgfkeys{/tikz/circuitikz/bipole/label/name=%
16149 \bgroup
16150 \setlength{\tabcolsep}{2pt}%
16151 \def\ltwo@tabu{\tabular[\ltwo@valign]}%
16152 \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
16153 #1\\ #2%
16154 \endtabular
16155 \egroup
16156 }%
16157 \ctikzsetvalof{bipole/label/unit}{}
16158 \ifpgf@circ@siunitx
16159 \pgf@circ@handleSI{#2}
16160 \ifpgf@circ@siunitx@res
16161 \edef\pgf@temp{\pgf@circ@handleSI@val}
16162 \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
16163 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16164 \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
16165 \else
16166 \fi
16167 \else
16168 \fi
16169 }}
16170 \ctikzset{l2/.style args={#1 and #2}{
16171 l2base={#1}{#2},
16172 \circuitikzbasekey/bipole/label/position=90 }
16173 }
16174 \ctikzset{l2 above/.style args={#1 and #2}{
16175 l2base={#1}{#2},
16176 \circuitikzbasekey/bipole/label/position=90 }
16177 }
16178 \ctikzset{l2^/.style args={#1 and #2}{
16179 l2base={#1}{#2},
16180 \circuitikzbasekey/bipole/label/position=90 }
16181 }
16182 \ctikzset{l2 below/.style args={#1 and #2}{
16183 l2base={#1}{#2},
16184 \circuitikzbasekey/bipole/label/position=-90 }
16185 }
16186 \ctikzset{l2_/.style args={#1 and #2}{
16187 l2base={#1}{#2},
16188 \circuitikzbasekey/bipole/label/position=-90 }
16189 }
16190
16191 %%%---------- close: tex/pgfcirclabel
16192 %%%%%%%%%%% Springe nach tex/pgfcircvoltage
16193 %%%---------- open: tex/pgfcircvoltage.tex
16194 % Copyright 2007-2009 by Massimo Redaelli
16195 %
16196 % This file may be distributed and/or modified
16197 %
16198 % 1. under the LaTeX Project Public License and/or
16199 % 2. under the GNU Public License.
16200 %
16201 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
16202
16203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16204 %% Voltage management
16205
16206 %% styles
16207 \ctikzset{bipole voltage style/.style={}}
16208 \tikzset{bipole voltage style/.code={
16209 \ctikzset{bipole voltage style/.style={#1}}
16210 }}
16211 \tikzset{bipole voltage append style/.code={
16212 \ctikzset{bipole voltage style/.append style={#1}}
16213 }}
16214
16215 \ctikzset{v^>/.style = {
16216 v = #1,
16217 \circuitikzbasekey/bipole/voltage/direction = forward,
16218 \circuitikzbasekey/bipole/voltage/position = above
16219 }
16220 }
16221
16222 \ctikzset{v^</.style = {
16223 v = #1,
16224 \circuitikzbasekey/bipole/voltage/direction = backward,
16225 \circuitikzbasekey/bipole/voltage/position = above
16226 }
16227 }
16228
16229 \ctikzset{v_>/.style = {
16230 v = #1,
16231 \circuitikzbasekey/bipole/voltage/direction = forward,
16232 \circuitikzbasekey/bipole/voltage/position = below
16233 }
16234 }
16235
16236 \ctikzset{v_</.style = {
16237 v = #1,
16238 \circuitikzbasekey/bipole/voltage/direction = backward,
16239 \circuitikzbasekey/bipole/voltage/position = below
16240 }
16241 }
16242
16243 \ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
16244 \ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
16245 \ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
16246 \ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
16247
16248 % Default position varies whether the component is a voltage source
16249 % or not
16250 \ctikzset{v/.code = {
16251 \ifpgf@circuit@bipole@isvoltage
16252 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
16253 \circuitikzbasekey/bipole/voltage/direction=forward}
16254 \else
16255 \ifpgf@circ@oldvoltagedirection
16256 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16257 \circuitikzbasekey/bipole/voltage/direction=backward}
16258 \else
16259 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16260 \circuitikzbasekey/bipole/voltage/direction=forward}
16261 \fi
16262 \fi
16263 \ifpgf@circ@oldvoltagedirection
16264 \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
16265 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16266 \circuitikzbasekey/bipole/voltage/direction=forward}
16267 \fi\fi
16268 \else
16269 \ifpgf@circuit@bipole@iscurrent
16270 \ifpgf@circuit@bipole@current@backward
16271 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16272 \circuitikzbasekey/bipole/voltage/direction=forward}
16273 \else
16274 \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
16275 \circuitikzbasekey/bipole/voltage/direction=backward}
16276 \fi\fi\fi
16277 \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
16278 \ctikzsetvalof{bipole/voltage/label/unit}{}
16279 \ifpgf@circ@siunitx
16280 \pgf@circ@handleSI{#1}
16281 \ifpgf@circ@siunitx@res
16282 \edef\pgf@temp{\pgf@circ@handleSI@val}
16283 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
16284 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16285 \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
16286 \else
16287 \fi
16288 \else
16289 \fi
16290 }
16291 }
16292
16293 % american voltage font selection and symbol definition
16294 % the default font command is {} --- nothing
16295 \def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
16296 %
16297 % plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
16298 %
16299 \def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
16300 \def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
16301
16302 %%
16303 \def\setscaledRlenforclass{%
16304 \csname pgf@sh@ma@\ctikzvalof{bipole/name}\endcsname
16305 \ifdefined\ctikzclass
16306 \edef\pgf@temp{/tikz/circuitikz/\ctikzclass/scale}
16307 \pgfkeysifdefined{\pgf@temp}
16308 {\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
16309 {\pgf@circ@scaled@Rlen=\pgf@circ@Rlen}
16310 \else
16311 \pgf@circ@scaled@Rlen=\pgf@circ@Rlen
16312 \fi
16313 }
16314
16315 %% Output routine for generic bipoles
16316
16317 \def\pgf@circ@drawvoltagegeneric{
16318 \pgfextra{
16319 % \typeout{NAME:\ctikzvalof{bipole/name}}
16320 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}
16321 \pgfkeysifdefined{\pgf@temp}
16322 {
16323 \edef\partheight{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/straight label distance}}
16324 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
16325 }
16326 {
16327 \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
16328 {
16329 \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
16330 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen)}
16331 }
16332 {%calculate default value from part height
16333 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
16334 \pgfkeysifdefined{\pgf@temp}
16335 {
16336 \edef\partheight{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
16337 \edef\tmpdistfromline{(\partheight\pgf@circ@scaled@Rlen+0.2\pgf@circ@scaled@Rlen)}
16338 }
16339 {
16340 \edef\tmpdistfromline{(.5\pgf@circ@scaled@Rlen)} %fallback to fixed value
16341 }
16342 }
16343 }
16344 % \typeout{KIND:\ctikzvalof{bipole/kind}\space RLEN:\the\pgf@circ@Rlen\space SCALED:\the\pgf@circ@scaled@Rlen}
16345 \ifnum \ctikzvalof{mirror value}=-1
16346 \ifpgf@circuit@bipole@inverted
16347 \ifpgf@circuit@bipole@voltage@straight
16348 \def\distfromline{\tmpdistfromline}
16349 \else
16350 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16351 \fi
16352 \else
16353 \ifpgf@circuit@bipole@voltage@straight
16354 \def\distfromline{-\tmpdistfromline}
16355 \else
16356 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16357 \fi
16358 \fi
16359 \else
16360 \ifpgf@circuit@bipole@inverted
16361 \ifpgf@circuit@bipole@voltage@straight
16362 \def\distfromline{-\tmpdistfromline}
16363 \else
16364 \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16365 \fi
16366 \else
16367 \ifpgf@circuit@bipole@voltage@straight
16368 \def\distfromline{\tmpdistfromline}
16369 \else
16370 \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@scaled@Rlen}
16371 \fi
16372 \fi
16373 \fi
16374 \ifpgf@circuit@bipole@voltage@below
16375 \def\pgf@circ@voltage@angle{90}
16376 \else
16377 \def\pgf@circ@voltage@angle{-90}
16378 \fi
16379 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}
16380 \pgfkeysifdefined{\pgf@temp}
16381 { \edef\distancefromnode{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/distance from node}} }
16382 { \edef\distancefromnode{\ctikzvalof{voltage/distance from node}} }
16383 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}
16384 \pgfkeysifdefined{\pgf@temp}
16385 { \edef\bumpb{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/bump b}} }
16386 { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
16387 \edef\shiftv{\ctikzvalof{voltage/shift}}
16388 \newdimen{\absvshift}
16389 \pgfmathsetlength{\absvshift}{\shiftv*\distfromline+\distfromline}
16390 % put this to true to see the voltage label coordinate anchors
16391 \newif\ifpgf@circ@debugv\pgf@circ@debugvfalse
16392 }
16393 % %\pgf@circ@Rlen/\ctikzvalof{current arrow scale} is equal to the length of the currarrow
16394 coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
16395 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorstartnode)$)
16396 coordinate (pgfcirc@Vfrom@flat) at (pgfcirc@midtmp)
16397 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
16398
16399 coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\ctikzvalof{current arrow scale} ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
16400 coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distancefromnode ! (anchorendnode)$)
16401 coordinate (pgfcirc@Vto@flat) at (pgfcirc@midtmp)
16402 coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
16403
16404 \ifpgf@circuit@bipole@voltage@below
16405 \ifpgf@circ@debugv
16406 node [ocirc, fill=red] at (anchorstartnode) {}
16407 node [ocirc, fill=blue] at (anchorendnode) {}
16408 node [ocirc, fill=green] at (pgfcirc@Vto) {}
16409 node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
16410 node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
16411 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
16412 \fi
16413 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! \absvshift!90 : (anchorendnode)$)
16414 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! \absvshift!-90 : (anchorstartnode)$)
16415 coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
16416 coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
16417 coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! -\absvshift!90 : (pgfcirc@Vcont2t)$)
16418 coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! -\absvshift!-90 : (pgfcirc@Vcont1t)$)
16419 \ifpgf@circ@debugv
16420 node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
16421 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
16422 node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
16423 node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
16424 \fi
16425 \else
16426 \ifpgf@circ@debugv
16427 node [ocirc, fill=red] at (anchorstartnode) {}
16428 node [ocirc, fill=blue] at (anchorendnode) {}
16429 node [ocirc, fill=green] at (pgfcirc@Vto) {}
16430 node [ocirc, fill=yellow] at (pgfcirc@Vfrom) {}
16431 node [odiamondpole, fill=green] at (pgfcirc@Vto@flat) {}
16432 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom@flat) {}
16433 \fi
16434 coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto@flat) ! -\absvshift!90 : (anchorendnode)$)
16435 coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom@flat) ! -\absvshift!-90 : (anchorstartnode)$)
16436 coordinate (pgfcirc@Vcont1t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
16437 coordinate (pgfcirc@Vcont2t) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
16438 coordinate (pgfcirc@Vcont1) at ($(pgfcirc@Vcont1t) ! \absvshift!90 : (pgfcirc@Vcont2t)$)
16439 coordinate (pgfcirc@Vcont2) at ($(pgfcirc@Vcont2t) ! \absvshift!-90 : (pgfcirc@Vcont1t)$)
16440 \ifpgf@circ@debugv
16441 node [odiamondpole, fill=green] at (pgfcirc@Vto) {}
16442 node [odiamondpole, fill=yellow] at (pgfcirc@Vfrom) {}
16443 node [osquarepole, fill=red] at (pgfcirc@Vcont1) {}
16444 node [osquarepole, fill=blue] at (pgfcirc@Vcont2) {}
16445 \fi
16446 \fi
16447
16448 \ifpgf@circuit@europeanvoltage
16449 \ifpgf@circuit@bipole@voltage@straight
16450 \ifpgf@circuit@bipole@voltage@backward
16451 (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
16452 \else
16453 (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
16454 \fi
16455 \else
16456 \ifpgf@circuit@bipole@voltage@backward
16457 (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
16458 node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
16459 (pgfcirc@Vfrom)
16460 \else
16461 (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
16462 node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {}
16463 (pgfcirc@Vto)
16464 \fi
16465 \fi
16466 \else
16467 \ifpgf@circuit@bipole@voltage@backward
16468 \ifpgf@circ@oldvoltagedirection
16469 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16470 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16471 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16472 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16473 \else
16474 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16475 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16476 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16477 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16478 \fi
16479 \else
16480 \ifpgf@circ@oldvoltagedirection
16481 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16482 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16483 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16484 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16485 \else
16486 (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
16487 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
16488 (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
16489 anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
16490 \fi
16491 \fi
16492 \fi
16493 }
16494
16495 %% Output routine for voltage sources
16496 \def\pgf@circ@drawvoltagegenerator{
16497 % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
16498 % it's not perfect, but I can't find the way to do it correctly...
16499 \pgfextra{
16500 \edef\shiftv{\ctikzvalof{voltage/shift}}
16501 \edef\bumpa{\ctikzvalof{voltage/bump a}}
16502 \pgfmathsetmacro{\bumpaplus}{\bumpa + 0.5*\shiftv} % coefficient added "by feel". Sorry.
16503 }
16504 \ifpgf@circuit@bipole@voltage@below
16505 coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
16506 coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
16507 \else
16508 coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
16509 coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.60)$)
16510 \fi
16511 % fix the (unused in this case) Vcont1/2 coords for label placement along the line
16512 coordinate (pgfcirc@Vcont1) at (pgfcirc@Vto)
16513 coordinate (pgfcirc@Vcont2) at (pgfcirc@Vfrom)
16514 \ifpgf@circuit@europeanvoltage
16515 \ifpgf@circuit@bipole@voltage@backward
16516 (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vfrom)
16517 \else
16518 (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1, anchor=tip] {} (pgfcirc@Vto)
16519 \fi
16520 \else% american voltage
16521 \ifpgf@circuit@bipole@voltageoutsideofsymbol
16522 % if it is a battery, must put + and -
16523
16524 \ifpgf@circ@fixbatteries
16525 \ifpgf@circuit@bipole@voltage@backward
16526 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16527 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16528 \else
16529 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16530 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16531 \fi
16532 \else
16533 \ifpgf@circuit@bipole@voltage@backward
16534 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16535 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16536 \else
16537 (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
16538 (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
16539 \fi
16540 \fi
16541 \fi
16542 \fi
16543 }
16544
16545 %% Output routine
16546 \def\pgf@circ@drawvoltage{% node name
16547 \pgfextra{ %WARNING: indentation is probably wrong
16548 \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
16549 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
16550 \ifpgf@circuit@bipole@voltage@below
16551 \def\pgf@circ@bipole@voltage@label@anchor{north west}
16552 \else
16553 \def\pgf@circ@bipole@voltage@label@anchor{south east}
16554 \fi
16555 \fi\fi
16556 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
16557 \ifpgf@circuit@bipole@voltage@below
16558 \def\pgf@circ@bipole@voltage@label@anchor{west}
16559 \else
16560 \def\pgf@circ@bipole@voltage@label@anchor{east}
16561 \fi
16562 \fi\fi
16563 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
16564 \ifpgf@circuit@bipole@voltage@below
16565 \def\pgf@circ@bipole@voltage@label@anchor{south west}
16566 \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
16567 \fi
16568 \fi\fi
16569 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
16570 \ifpgf@circuit@bipole@voltage@below
16571 \def\pgf@circ@bipole@voltage@label@anchor{south}
16572 \else\def\pgf@circ@bipole@voltage@label@anchor{north}
16573 \fi
16574 \fi\fi
16575 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
16576 \ifpgf@circuit@bipole@voltage@below
16577 \def\pgf@circ@bipole@voltage@label@anchor{south east}
16578 \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
16579 \fi
16580 \fi\fi
16581 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
16582 \ifpgf@circuit@bipole@voltage@below
16583 \def\pgf@circ@bipole@voltage@label@anchor{east}
16584 \else \def\pgf@circ@bipole@voltage@label@anchor{west}
16585 \fi
16586 \fi\fi
16587 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
16588 \ifpgf@circuit@bipole@voltage@below
16589 \def\pgf@circ@bipole@voltage@label@anchor{north east}
16590 \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
16591 \fi
16592 \fi\fi
16593 \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
16594 \ifpgf@circuit@bipole@voltage@below
16595 \def\pgf@circ@bipole@voltage@label@anchor{north}
16596 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
16597 \fi
16598 \fi\fi
16599 \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
16600 \ifpgf@circuit@bipole@voltage@below
16601 \def\pgf@circ@bipole@voltage@label@anchor{north}
16602 \else\def\pgf@circ@bipole@voltage@label@anchor{south}
16603 \fi
16604 \fi\fi
16605
16606 % this must be set *before* changing for mirroring and inverting; in that case
16607 % the xscale/yscale parameters take it into account
16608 \ifpgf@circuit@bipole@voltage@below
16609 \def\pgf@circ@bipole@voltage@label@where{-90}
16610 \else
16611 \def\pgf@circ@bipole@voltage@label@where{90}
16612 \fi
16613
16614 % magic to counteract the scale and yscale effects (there should be a better way...)
16615 \ifnum \ctikzvalof{mirror value}=-1
16616 \ifpgf@circuit@bipole@voltage@below
16617 \pgf@circuit@bipole@voltage@belowfalse
16618 \else
16619 \pgf@circuit@bipole@voltage@belowtrue
16620 \fi
16621 \fi
16622
16623 \ifpgf@circuit@bipole@inverted
16624 \ifpgf@circuit@bipole@voltage@below
16625 \pgf@circuit@bipole@voltage@belowfalse
16626 \else
16627 \pgf@circuit@bipole@voltage@belowtrue
16628 \fi
16629 \fi
16630
16631 % take into account scaling
16632 \setscaledRlenforclass
16633
16634 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}
16635 \pgfkeysifdefined{\pgf@temp}
16636 { \edef\eudist{\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/voltage/european label distance}} }
16637 { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
16638 % find the height of the bipole or use a default value
16639 \edef\pgf@temp{/tikz/circuitikz/bipoles/\ctikzvalof{bipole/kind}/height}
16640 \pgfkeysifdefined{\pgf@temp}
16641 {\pgfmathsetmacro{\partheightf}{0.5*\ctikzvalof{bipoles/\ctikzvalof{bipole/kind}/height}}
16642 \edef\partheight{\partheightf\pgf@circ@scaled@Rlen}}
16643 {\edef\partheight{(.5\pgf@circ@scaled@Rlen)}} %fallback to fixed value
16644 \newdimen{\alshift}
16645 % this is more or less the same of the legacy code; we shift the american label a bit
16646 % outside the (+) -- (-) line
16647 \pgfmathsetlength{\alshift}{(\ctikzvalof{voltage/american label distance}-0.6)*\partheight}
16648 \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
16649 }%end pgfextra
16650
16651 \ifpgf@circuit@bipole@isvoltage
16652 \pgf@circ@drawvoltagegenerator
16653 \else
16654 \pgf@circ@drawvoltagegeneric
16655 \fi
16656
16657 \ifpgf@circuit@bipole@voltage@straight
16658 coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
16659 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
16660 \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
16661 at (Vlab) {\pgf@circ@finallabels{voltage/label}}
16662 \else
16663 \ifpgf@circuit@europeanvoltage
16664 coordinate (Vlab) at ($(pgfcirc@Vcont1)!0.5!(pgfcirc@Vcont2)$)
16665 \else
16666 coordinate (Vlab) at ($(pgfcirc@Vfrom)!0.5!(pgfcirc@Vto)$)
16667 \ifpgf@circuit@bipole@isvoltage\else
16668 % add a bit of space for american labels above their symbols in the normal case. You can avoid that
16669 % with voltage/american label distance=0.5 (it's measured from the center of the component, in heights)
16670 coordinate (Vlab) at ($(Vlab) ! \alshift ! \pgf@circ@bipole@voltage@label@where :(pgfcirc@Vto)$)
16671 \fi
16672 \fi
16673 node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt,
16674 \circuitikzbasekey/bipole voltage style](\ctikzvalof{bipole/name}voltage)
16675 at (Vlab) {\pgf@circ@finallabels{voltage/label}}
16676 \fi
16677 }%end drawvoltages
16678 %%%---------- close: tex/pgfcircvoltage
16679 %%%%%%%%%%% Springe nach tex/pgfcirccurrent
16680 %%%---------- open: tex/pgfcirccurrent.tex
16681 % Copyright 2007-2009 by Massimo Redaelli
16682 %
16683 % This file may be distributed and/or modified
16684 %
16685 % 1. under the LaTeX Project Public License and/or
16686 % 2. under the GNU Public License.
16687 %
16688 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
16689
16690 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16691 %% Current handling
16692
16693 %% styles
16694 \ctikzset{bipole current style/.style={}}
16695 \tikzset{bipole current style/.code={
16696 \ctikzset{bipole current style/.style={#1}}
16697 }}
16698 \tikzset{bipole current append style/.code={
16699 \ctikzset{bipole current style/.append style={#1}}
16700 }}
16701
16702 %% Options
16703 \ctikzset{i^>/.style = {
16704 i = #1,
16705 \circuitikzbasekey/bipole/current/direction = forward,
16706 \circuitikzbasekey/bipole/current/x position = after,
16707 \circuitikzbasekey/bipole/current/y position = above
16708 }
16709 }
16710
16711 \ctikzset{i_>/.style = {
16712 i = #1,
16713 \circuitikzbasekey/bipole/current/direction = forward,
16714 \circuitikzbasekey/bipole/current/x position = after,
16715 \circuitikzbasekey/bipole/current/y position = below
16716 }
16717 }
16718
16719 \ctikzset{i>^/.style = {
16720 i = #1,
16721 \circuitikzbasekey/bipole/current/direction = forward,
16722 \circuitikzbasekey/bipole/current/x position = before,
16723 \circuitikzbasekey/bipole/current/y position = above
16724 }
16725 }
16726
16727 \ctikzset{i>_/.style = {
16728 i = #1,
16729 \circuitikzbasekey/bipole/current/direction = forward,
16730 \circuitikzbasekey/bipole/current/x position = before,
16731 \circuitikzbasekey/bipole/current/y position = below
16732 }
16733 }
16734
16735 \ctikzset{i^</.style = {
16736 i = #1,
16737 \circuitikzbasekey/bipole/current/direction = backward,
16738 \circuitikzbasekey/bipole/current/x position = after,
16739 \circuitikzbasekey/bipole/current/y position = above
16740 }
16741 }
16742
16743 \ctikzset{i_</.style = {
16744 i = #1,
16745 \circuitikzbasekey/bipole/current/direction = backward,
16746 \circuitikzbasekey/bipole/current/x position = after,
16747 \circuitikzbasekey/bipole/current/y position = below
16748 }
16749 }
16750
16751 \ctikzset{i<^/.style = {
16752 i = #1,
16753 \circuitikzbasekey/bipole/current/direction = backward,
16754 \circuitikzbasekey/bipole/current/x position = before,
16755 \circuitikzbasekey/bipole/current/y position = above
16756 }
16757 }
16758
16759 \ctikzset{i<_/.style = {
16760 i = #1,
16761 \circuitikzbasekey/bipole/current/direction = backward,
16762 \circuitikzbasekey/bipole/current/x position = before,
16763 \circuitikzbasekey/bipole/current/y position = below
16764 }
16765 }
16766
16767 \ctikzset{i/.code = {
16768 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
16769 \circuitikzbasekey/bipole/current/x position = after,
16770 \circuitikzbasekey/bipole/current/y position = above }
16771 \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
16772 \ctikzsetvalof{bipole/current/label/unit}{}
16773 \ifpgf@circ@siunitx
16774 \pgf@circ@handleSI{#1}
16775 \ifpgf@circ@siunitx@res
16776 \edef\pgf@temp{\pgf@circ@handleSI@val}
16777 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
16778 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16779 \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
16780 \else
16781 \fi
16782 \else
16783 \fi
16784 %reverse current direction for voltage sources
16785 \ifpgf@circ@oldvoltagedirection\else
16786 \ifpgf@circuit@bipole@isvoltage
16787 \ifpgf@circuit@bipole@voltage@backward
16788 \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
16789 \circuitikzbasekey/bipole/current/x position = after,
16790 \circuitikzbasekey/bipole/current/y position = below }
16791 \else
16792 \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
16793 \circuitikzbasekey/bipole/current/x position = before,
16794 \circuitikzbasekey/bipole/current/y position = above }
16795 \fi\fi\fi
16796 }
16797 }
16798
16799 \ifpgf@circ@oldvoltagedirection
16800 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
16801 \else
16802 \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
16803 \fi
16804 \ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
16805 \ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
16806 \ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
16807
16808 %% Output routine
16809 \def\pgf@circ@drawcurrent{
16810 \pgfextra{
16811 \edef\pgf@circ@ffffff{\pgf@circ@direction}
16812 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
16813
16814 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
16815 \ifpgf@circuit@bipole@current@below
16816 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
16817 \fi
16818 \fi\fi
16819 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
16820 \ifpgf@circuit@bipole@current@below
16821 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
16822 \fi
16823 \fi\fi
16824 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
16825 \ifpgf@circuit@bipole@current@below
16826 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
16827 \fi
16828 \fi\fi
16829 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
16830 \ifpgf@circuit@bipole@current@below
16831 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
16832 \fi
16833 \fi\fi
16834 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
16835 \ifpgf@circuit@bipole@current@below
16836 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
16837 \fi
16838 \fi\fi
16839 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
16840 \ifpgf@circuit@bipole@current@below
16841 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
16842 \fi
16843 \fi\fi
16844 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
16845 \ifpgf@circuit@bipole@current@below
16846 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
16847 \fi
16848 \fi\fi
16849 \ifnum\pgfcircmathresult <5
16850 \ifpgf@circuit@bipole@current@below
16851 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
16852 \fi
16853 \fi
16854 \ifnum\pgfcircmathresult >355
16855 \ifpgf@circuit@bipole@current@below
16856 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
16857 \fi
16858 \fi
16859
16860 \ifpgf@circuit@bipole@current@below
16861 \def\pgf@circ@bipole@current@label@where{-90}
16862 \else
16863 \def\pgf@circ@bipole@current@label@where{+90}
16864 \fi
16865 }
16866
16867 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
16868 \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
16869 (\tikztostart)--(\tikztotarget)
16870 \else% normal bipole or source
16871 \ifpgf@circuit@bipole@current@before
16872 (\tikztostart)--(anchorstartnode)
16873 \else
16874 (anchorendnode)--(\tikztotarget)
16875 \fi
16876 \fi
16877 \ifpgf@circuit@bipole@current@backward
16878 \pgfextra{
16879 \pgfmathsubtract{\pgf@circ@ffffff}{180}
16880 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
16881 }
16882 \fi
16883 coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff,
16884 anchor=center](Iarrow)
16885 (Iarrow.\pgf@circ@bipole@current@label@where)
16886 node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole current style]
16887 (\ctikzvalof{bipole/name}current){\pgf@circ@finallabels{current/label}}
16888 }
16889
16890 %%%---------- close: tex/pgfcirccurrent
16891 %%%%%%%%%%% Springe nach tex/pgfcircflow
16892 %%%---------- open: tex/pgfcircflow.tex
16893 % Copyright 2007-2009 by Massimo Redaelli
16894 %
16895 % This file may be distributed and/or modified
16896 %
16897 % 1. under the LaTeX Project Public License and/or
16898 % 2. under the GNU Public License.
16899 %
16900 % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
16901
16902 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16903 %% flow handling
16904
16905 %% styles
16906 \ctikzset{bipole flow style/.style={}}
16907 \tikzset{bipole flow style/.code={
16908 \ctikzset{bipole flow style/.style={#1}}
16909 }}
16910 \tikzset{bipole flow append style/.code={
16911 \ctikzset{bipole flow style/.append style={#1}}
16912 }}
16913
16914 %% Options
16915 \ctikzset{f^>/.style = {
16916 f = #1,
16917 \circuitikzbasekey/bipole/flow/direction = forward,
16918 \circuitikzbasekey/bipole/flow/x position = after,
16919 \circuitikzbasekey/bipole/curflowrent/y position = above
16920 }
16921 }
16922
16923 \ctikzset{f_>/.style = {
16924 f = #1,
16925 \circuitikzbasekey/bipole/flow/direction = forward,
16926 \circuitikzbasekey/bipole/flow/x position = after,
16927 \circuitikzbasekey/bipole/flow/y position = below
16928 }
16929 }
16930
16931 \ctikzset{f>^/.style = {
16932 f = #1,
16933 \circuitikzbasekey/bipole/flow/direction = forward,
16934 \circuitikzbasekey/bipole/flow/x position = before,
16935 \circuitikzbasekey/bipole/flow/y position = above
16936 }
16937 }
16938
16939 \ctikzset{f>_/.style = {
16940 f = #1,
16941 \circuitikzbasekey/bipole/flow/direction = forward,
16942 \circuitikzbasekey/bipole/flow/x position = before,
16943 \circuitikzbasekey/bipole/flow/y position = below
16944 }
16945 }
16946
16947 \ctikzset{f^</.style = {
16948 f = #1,
16949 \circuitikzbasekey/bipole/flow/direction = backward,
16950 \circuitikzbasekey/bipole/flow/x position = after,
16951 \circuitikzbasekey/bipole/flow/y position = above
16952 }
16953 }
16954
16955 \ctikzset{f_</.style = {
16956 f = #1,
16957 \circuitikzbasekey/bipole/flow/direction = backward,
16958 \circuitikzbasekey/bipole/flow/x position = after,
16959 \circuitikzbasekey/bipole/flow/y position = below
16960 }
16961 }
16962
16963 \ctikzset{f<^/.style = {
16964 f = #1,
16965 \circuitikzbasekey/bipole/flow/direction = backward,
16966 \circuitikzbasekey/bipole/flow/x position = before,
16967 \circuitikzbasekey/bipole/flow/y position = above
16968 }
16969 }
16970
16971 \ctikzset{f<_/.style = {
16972 f = #1,
16973 \circuitikzbasekey/bipole/flow/direction = backward,
16974 \circuitikzbasekey/bipole/flow/x position = before,
16975 \circuitikzbasekey/bipole/flow/y position = below
16976 }
16977 }
16978
16979 \ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
16980 \ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
16981 \ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
16982 \ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
16983
16984 \ctikzset{f/.code = {
16985 \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
16986 \circuitikzbasekey/bipole/flow/x position = after,
16987 \circuitikzbasekey/bipole/flow/y position = above }
16988 \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
16989 \ctikzsetvalof{bipole/flow/label/unit}{}
16990 \ifpgf@circ@siunitx
16991 \pgf@circ@handleSI{#1}
16992 \ifpgf@circ@siunitx@res
16993 \edef\pgf@temp{\pgf@circ@handleSI@val}
16994 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
16995 \edef\pgf@temp{\pgf@circ@handleSI@unit}
16996 \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
16997 \else
16998 \fi
16999 \else
17000 \fi
17001 }
17002 }
17003
17004 %% Output routine
17005 \def\pgf@circ@drawflow{
17006 \pgfextra{
17007 \edef\pgf@circ@ffffff{\pgf@circ@direction}
17008 \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
17009
17010 \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
17011 \ifpgf@circuit@bipole@flow@below
17012 \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
17013 \fi
17014 \fi\fi
17015 \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
17016 \ifpgf@circuit@bipole@flow@below
17017 \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
17018 \fi
17019 \fi\fi
17020 \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
17021 \ifpgf@circuit@bipole@flow@below
17022 \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
17023 \fi
17024 \fi\fi
17025 \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
17026 \ifpgf@circuit@bipole@flow@below
17027 \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
17028 \fi
17029 \fi\fi
17030 \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
17031 \ifpgf@circuit@bipole@flow@below
17032 \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
17033 \fi
17034 \fi\fi
17035 \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
17036 \ifpgf@circuit@bipole@flow@below
17037 \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
17038 \fi
17039 \fi\fi
17040 \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
17041 \ifpgf@circuit@bipole@flow@below
17042 \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
17043 \fi
17044 \fi\fi
17045 \ifnum\pgfcircmathresult <5
17046 \ifpgf@circuit@bipole@flow@below
17047 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
17048 \fi
17049 \fi
17050 \ifnum\pgfcircmathresult >355
17051 \ifpgf@circuit@bipole@flow@below
17052 \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
17053 \fi
17054 \fi
17055
17056 \ifpgf@circuit@bipole@flow@below
17057 \def\pgf@circ@bipole@flow@label@where{-90}
17058 \else
17059 \def\pgf@circ@bipole@flow@label@where{+90}
17060 \fi
17061 }
17062
17063 \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
17064 \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
17065 (\tikztostart)--(\tikztotarget)
17066 \else% normal bipole or source
17067 \ifpgf@circuit@bipole@flow@before
17068 (\tikztostart)--(anchorstartnode)
17069 \else
17070 (anchorendnode)--(\tikztotarget)
17071 \fi
17072 \fi
17073 \pgfextra{
17074 \ifpgf@circuit@bipole@flow@backward
17075 \ifpgf@circuit@bipole@flow@below
17076 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17077 \else
17078 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17079 \fi
17080 \pgfmathsubtract{\pgf@circ@ffffff}{180}
17081 \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
17082 \else
17083 \ifpgf@circuit@bipole@flow@below
17084 \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17085 \else
17086 \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
17087 \fi
17088 \fi
17089 }
17090 coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset, anchor=center](Farrowpos)
17091 (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir, \circuitikzbasekey/bipole flow style]
17092 (\ctikzvalof{bipole/name}flow){\pgf@circ@finallabels{flow/label}}
17093 }
17094
17095 %%%---------- close: tex/pgfcircflow
17096
17097 % defaults
17098
17099 \setupmodule
17100 [current=european,
17101 voltage=european,
17102 resistor=american,
17103 inductor=cute,
17104 logic=american,
17105 siunitx=true,
17106 arrowmos=false]
17107
17108 \processaction
17109 [\currentmoduleparameter{voltage}]
17110 [european=>\ctikzset{voltage=european},
17111 american=>\ctikzset{voltage=american}]
17112
17113 \processaction
17114 [\currentmoduleparameter{current}]
17115 [european=>\ctikzset{ current=european},
17116 american=>\ctikzset{ current=american}]
17117
17118 \processaction
17119 [\currentmoduleparameter{label}]
17120 [straight=>\ctikzset{label/align = straight},
17121 align=>\ctikzset{label/align = rotate},
17122 smart=>\ctikzset{label/align = smart}]
17123
17124 \processaction
17125 [\currentmoduleparameter{resistor}]
17126 [european=>\ctikzset{ resistor=european},
17127 american=>\ctikzset{ resistor=american}]
17128
17129 \processaction
17130 [\currentmoduleparameter{inductor}]
17131 [european=>\ctikzset{ inductor=european},
17132 american=>\ctikzset{ inductor=american},
17133 cute=>\ctikzset{ inductor=cute}]
17134
17135 \processaction
17136 [\currentmoduleparameter{diode}]
17137 [full=>\ctikzset{ diode=full},
17138 empty=>\ctikzset{ diode=empty}]
17139
17140 \processaction
17141 [\currentmoduleparameter{logic}]
17142 [european=>\ctikzset{ logic ports=european},
17143 american=>\ctikzset{ logic ports=american}]
17144
17145 \processaction
17146 [\currentmoduleparameter{siunitx}]
17147 [true=>\def\SI#1#2{#1\,#2}
17148 \def\ampere{\rm{A}}
17149 \def\volt{\rm{V}}
17150 \def\ohm{\Omega}
17151 \def\siemens{\rm{S}}
17152 \def\farad{\rm{F}}
17153 \def\henry{\rm{H}}
17154 \def\second{\rm{s}}
17155 \def\coulomb{\rm{C}}
17156 \def\siemens{\rm{S}}
17157 \def\radians{\rm{rad}}
17158 \def\milli{\rm{m}}
17159 \def\micro{\mu}
17160 \def\nano{\rm{n}}
17161 \def\pico{\rm{p}}
17162 \def\kilo{\rm{k}}
17163 \def\mega{\rm{M}}
17164 \def\giga{\rm{G}}
17165 \def\tera{\rm{T}},
17166 false=>]
17167 % \s!default=>\pgf@circ@siunitxtrue,
17168
17169 \processaction
17170 [\currentmoduleparameter{arrowmos}]
17171 [true=>\pgf@circuit@mos@arrowstrue,
17172 false=>\pgf@circuit@mos@arrowsfalse]
17173 % \s!default=>\pgf@circuit@mos@arrowstrue,
17174
17175
17176 \ifpgf@circ@siunitx
17177 % nothing! siunitx and xstrings don't work in context
17178 \fi
17179
17180
17181 % Context specific
17182
17183 \ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]}
17184
17185 %%%%%%%%%%% Springe nach tex/pgfcircpath
17186 %%%---------- open: tex/pgfcircpath.tex
17187
17188 \def\pgf@circ@direction{0.0}
17189
17190 % Names
17191 \ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
17192 \ctikzset{n/.code = {
17193 \pgfkeys{/tikz/circuitikz/bipole/name=#1}
17194 }}
17195
17196 % Reflect the node along
17197 \ctikzset{mirrored/.is choice}
17198 \ctikzset{mirror value/.initial=1}
17199 \ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
17200 \ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
17201 \ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
17202
17203 % Invert node along path
17204 \ctikzset{inverted/.is choice}
17205 \ctikzset{invert value/.initial=1}
17206 \ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
17207 \ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
17208 \ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
17209 \newif\ifpgf@circuit@bipole@inverted
17210 \ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
17211
17212 \newif\ifpgf@circuit@bipole@voltage@backward
17213 \ctikzset{bipole/voltage/direction/.is choice}
17214 \ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
17215 \ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
17216
17217 % Initialize paths
17218 \def\pgfcircresetpath{
17219 \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
17220 bipole/inverted=false, bipole/kind=,
17221 bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
17222 bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
17223 bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
17224 bipole/current/y position=above, bipole/current/direction=forward,
17225 mirrored=false
17226 }
17227 }
17228
17229 %% Helper function for path-function to ensure using anchors between nodes
17230 \def\set@explicit@center@anchor#1{
17231 \pgfutil@ifundefined{pgf@sh@ns@#1}
17232 {
17233 %This coordinate is no node(but a relative position or a coordinate), no further handling needed
17234 }{
17235 \pgfutil@in@.{#1}
17236 \ifpgfutil@in@
17237 % Anchor is used, do nothing!
17238 \else%
17239 \let\tikz@moveto@waiting=\relax
17240 \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
17241 \edef#1{#1.center}%ensure using center anchor
17242 \fi
17243 }
17244 }
17245
17246
17247 %% Generic bipole path
17248 %% I am not user what the second argument is needed for
17249 \def\pgf@circ@bipole@path#1#2{
17250
17251 \pgfextra{
17252 \set@explicit@center@anchor{\tikztostart}
17253 \set@explicit@center@anchor{\tikztotarget}
17254 \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
17255 \ctikzset{bipole/kind = #1}
17256 \edef\pgf@temp{\ctikzvalof{bipole/name}}
17257 \def\pgf@circ@temp{}
17258 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
17259 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
17260 \ctikzset{bipole/name = #1\pgf@circ@rand} % create it (re-usage should not create problem, but...)
17261 \fi
17262 }
17263
17264 (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relative start/end or constructions like ((node1)-|(node2))
17265 (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
17266 \pgfextra{
17267 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
17268 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
17269 \pgfmathround{\pgfmathresult}
17270 \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
17271 \pgfsyssoftpath@setcurrentpath{\myp@th}
17272 }
17273 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
17274 \ifx\pgf@temp\pgf@circ@temp % if it is an open
17275 \else
17276 --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
17277 \fi
17278 ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
17279 node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
17280 (\ctikzvalof{bipole/name}) {}
17281 \ifpgf@circuit@bipole@inverted
17282 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
17283 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
17284 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
17285 \else
17286 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
17287 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
17288 \fi
17289 \else
17290 \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
17291 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
17292 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
17293 \else
17294 coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
17295 coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
17296 \fi
17297 \fi
17298 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
17299 \ifx\pgf@temp\pgf@circ@temp % if it is an open
17300 \else
17301 (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
17302 (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
17303 \fi
17304
17305 \drawpoles
17306 \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
17307 \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
17308 \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
17309 \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
17310 \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
17311 \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
17312 \ifx\pgf@temp\pgf@circ@temp % if it is an open
17313 (\ctikzvalof{bipole/name}end)%Move to end of path
17314 \else
17315 ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
17316 %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
17317
17318 \fi
17319 % reset
17320 \pgfextra{
17321 \pgfcircresetpath
17322 }
17323 \tikztonodes%draw pending nodes an path
17324 }
17325
17326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17327 %% Handling of terminals
17328
17329 \ctikzset{bipole/nodes/.is family}
17330 \ctikzset{bipole/nodes/left/.initial=none}
17331 \ctikzset{bipole/nodes/right/.initial=none}
17332 \tikzset{bipole nodes/.style n args={2}{%
17333 \circuitikzbasekey/bipole/nodes/left=#1,
17334 \circuitikzbasekey/bipole/nodes/right=#2
17335 }
17336 }
17337
17338 %% Easily usable styles
17339
17340 \ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17341 \ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17342 \ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
17343 \ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17344 \ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
17345 \ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17346 \ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17347 \ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
17348 \ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
17349 \ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
17350 \ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17351 \ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
17352 \ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
17353 \ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17354 \ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17355
17356 % rectjoinfill workarounds
17357
17358 \ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
17359 \ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
17360 \ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
17361 \ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
17362 \ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17363 \ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17364 \ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17365 \ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17366 \ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
17367
17368 \tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
17369
17370 \def\drawpoles{
17371 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
17372 \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
17373 \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
17374 \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
17375 }
17376
17377 %% Path definitions
17378 \def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
17379 \def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
17380 \def\pgf@circ@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi}
17381 \def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
17382 \def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
17383 \def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
17384 \def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
17385 \def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
17386 \def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
17387 \def\pgf@circ@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#1}}
17388 \def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
17389 %% polar capacitor is deprectaed, use curved capacitor instead
17390 \def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
17391 \def\pgf@circ@ccapacitor@path#1{\pgf@circ@bipole@path{ccapacitor}{#1}}
17392 \def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
17393 \def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
17394 \def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
17395 \def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
17396 \def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
17397 \def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
17398 \def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
17399 \def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
17400 \def\pgf@circ@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#1}}
17401 \def\pgf@circ@inductor@path#1{%
17402 \pgfextra{
17403 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
17404 \def\pgf@temp{european}%
17405 }
17406 \ifx\pgf@temp\pgf@circ@temp%
17407 \pgf@circ@europeaninductor@path{#1}%
17408 \else%
17409 \pgfextra{ \def\pgf@temp{cute} }%
17410 \ifx\pgf@temp\pgf@circ@temp%
17411 \pgf@circ@cuteinductor@path{#1}%
17412 \else%
17413 \pgf@circ@americaninductor@path{#1}%
17414 \fi%
17415 \fi%
17416 }
17417 \def\pgf@circ@vinductor@path#1{
17418 \pgfextra{
17419 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
17420 \def\pgf@temp{european}%
17421 }
17422 \ifx\pgf@temp\pgf@circ@temp%
17423 \pgf@circ@veuropeaninductor@path{#1}%
17424 \else%
17425 \pgfextra{ \def\pgf@temp{cute} }%
17426 \ifx\pgf@temp\pgf@circ@temp%
17427 \pgf@circ@vcuteinductor@path{#1}%
17428 \else%
17429 \pgf@circ@vamericaninductor@path{#1}%
17430 \fi%
17431 \fi%
17432 }
17433 \def\pgf@circ@inductivesens@path#1{%
17434 \pgfextra{
17435 \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
17436 \def\pgf@temp{european}%
17437 }
17438 \ifx\pgf@temp\pgf@circ@temp%
17439 \pgf@circ@europeaninductivesens@path{#1}%
17440 \else%
17441 \pgfextra{ \def\pgf@temp{cute} }%
17442 \ifx\pgf@temp\pgf@circ@temp%
17443 \pgf@circ@cuteinductivesens@path{#1}%
17444 \else%
17445 \pgf@circ@americaninductivesens@path{#1}%
17446 \fi%
17447 \fi%
17448 }
17449 \def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
17450 \def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
17451 \def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
17452 \def\pgf@circ@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
17453 \def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
17454 \def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
17455 \def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
17456 \def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#1}}
17457 \def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
17458 \def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
17459 \def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
17460 \def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
17461 \def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
17462 \def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
17463 \def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
17464 \def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
17465 \def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
17466 \def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
17467 \def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
17468 \def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
17469 \def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
17470 \def\pgf@circ@ecsource@path#1{\pgf@circ@bipole@path{ecsource}{#1}}
17471 \def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
17472 \def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
17473 \def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
17474 \def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
17475 \def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
17476 \def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
17477 \def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
17478 \def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
17479 \def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
17480 \def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
17481 \def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
17482 \def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
17483 \def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
17484 \def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
17485 \def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
17486 \def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
17487 \def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
17488 \def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
17489 \def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
17490 \def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
17491 \def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
17492 \def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
17493 \def\pgf@circ@oscope@path#1{\pgf@circ@bipole@path{oscope}{#1}}
17494 \def\pgf@circ@empty@path#1{}
17495 \def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
17496 \def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
17497 \def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
17498 \def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
17499 \def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
17500 \def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
17501 \def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
17502 \def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
17503 \def\pgf@circ@mstline@path#1{\pgf@circ@bipole@path{mstline}{#1}}
17504 \def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
17505 \def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
17506 \def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
17507 \def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
17508 \def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
17509
17510 \def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
17511 \def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
17512 \def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
17513
17514 \def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
17515 \def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
17516 \def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
17517 \def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
17518 \def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
17519 \def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
17520 \def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
17521 \def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
17522 \def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
17523 \def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
17524 \def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
17525 \def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
17526 \def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
17527 \def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
17528 \def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
17529 \def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
17530 \def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
17531 \def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
17532 \def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
17533
17534 %%Mechanical
17535 \def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
17536 \def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
17537 \def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
17538 \def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
17539
17540 %% Styles
17541
17542 \def\comnpatname{\ifpgf@circuit@compat *\else\fi}
17543 \def\compattikzset#1{\tikzset{\comnpatname#1}}
17544
17545 %\def\ctikzsetbipole#1#2{%
17546 % \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
17547 %}
17548
17549 \compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
17550 \compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
17551 \compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
17552 \compattikzset{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@path, l=#1}}
17553 \compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
17554 \compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
17555 \compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
17556 \compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
17557 \compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
17558 \compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
17559 \compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
17560 \compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
17561 \compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
17562 \compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
17563 \compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
17564 \compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
17565 \compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
17566 \compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
17567 \compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
17568 \compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
17569 \compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
17570 % polar capacitor is deprecated, use curved capacitor instead
17571 \compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
17572 \compattikzset{curved capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ccapacitor@path, l=#1}}
17573 \compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
17574 \compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
17575 \compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17576 \compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17577 \compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17578 \compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
17579 \compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
17580 \compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
17581 \compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
17582 \compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
17583 \compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
17584 \compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
17585 \compattikzset{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@path, l=#1}}
17586 \compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
17587 \compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
17588 \compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
17589 \compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
17590 \compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
17591 \compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
17592 \compattikzset{transmission line/.style = {tline = #1}}
17593 \compattikzset{TL/.style = {tline = #1}}
17594 \compattikzset{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#1}}
17595 \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}}
17596 \compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17597 \compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17598 \compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17599 \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}}
17600 \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}}
17601 \compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17602 \compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17603 \compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17604 \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 }}
17605 \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 }}
17606 \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 }}
17607 \compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17608 \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}}
17609 \compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17610
17611 \compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17612 \compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
17613 \compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
17614 \compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
17615
17616
17617 \compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
17618 \compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
17619 \compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
17620 \compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
17621 \compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
17622 \compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
17623 \compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
17624
17625 \compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
17626 \compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
17627
17628 \compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
17629 \compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
17630 \compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
17631 \compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
17632 \compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
17633
17634 \compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
17635 \compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
17636 \compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
17637 \compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
17638 \compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
17639 \compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
17640 \compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
17641 \compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
17642 \compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
17643 \compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
17644 \compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
17645 \compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
17646 \compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
17647 \compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
17648 \compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
17649 \compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
17650 \compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
17651 \compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
17652 \compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
17653
17654 % % % % % %
17655 % % Begin of Diodes
17656 % % % % % %
17657
17658 \def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
17659 \def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
17660 \def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
17661 \def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
17662 \def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
17663 \def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
17664 \def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
17665 \def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
17666 \def\pgf@circ@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#1}}
17667 \def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
17668 \def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
17669 \def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
17670 \def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
17671 \def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
17672 \def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
17673 \def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
17674 \def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
17675 \def\pgf@circ@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#1}}
17676
17677 \compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
17678 \compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
17679 \compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
17680 \compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
17681 \compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
17682 \compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
17683 \compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
17684 \compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
17685 \compattikzset{full bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@path}}
17686 \compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
17687 \compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
17688
17689 \compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
17690 \compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
17691 \compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
17692 \compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
17693 \compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
17694 \compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
17695 \compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
17696 \compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
17697 \compattikzset{empty bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@path}}
17698 \compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
17699 \compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
17700
17701 \compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
17702 \compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
17703 \compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
17704 \compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
17705 \compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
17706 \compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
17707 \compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
17708 \compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
17709 \compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
17710 %\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
17711
17712 \def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
17713
17714 \compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
17715 \compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
17716 \compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
17717 \compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
17718 \compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
17719 \compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
17720 \compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
17721 \compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
17722 \compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
17723 \compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
17724 \compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
17725
17726 %% Define Shortcuts
17727 \compattikzset{Do/.style = {\comnpatname empty diode}}
17728 \compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
17729 \compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
17730 \compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
17731 \compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
17732 \compattikzset{pDo/.style = {\comnpatname empty photodiode}}
17733 \compattikzset{leDo/.style = {\comnpatname empty led}}
17734 \compattikzset{VCo/.style = {\comnpatname empty varcap}}
17735 \compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
17736 \compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
17737 \compattikzset{Tro/.style = {\comnpatname empty triac}}
17738
17739 \compattikzset{D*/.style = {\comnpatname full diode}}
17740 \compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
17741 \compattikzset{zD*/.style = {\comnpatname full Zener diode}}
17742 \compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
17743 \compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
17744 \compattikzset{pD*/.style = {\comnpatname full photodiode}}
17745 \compattikzset{leD*/.style = {\comnpatname full led}}
17746 \compattikzset{VC*/.style = {\comnpatname full varcap}}
17747 \compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
17748 \compattikzset{Ty*/.style = {\comnpatname full thyristor}}
17749 \compattikzset{Tr*/.style = {\comnpatname full triac}}
17750
17751 \compattikzset{D/.style = {\comnpatname diode}}
17752 \compattikzset{tD/.style = {\comnpatname tunnel diode}}
17753 \compattikzset{zD/.style = {\comnpatname Zener diode}}
17754 \compattikzset{zzD/.style = {\comnpatname ZZener diode}}
17755 \compattikzset{sD/.style = {\comnpatname Schottky diode}}
17756 \compattikzset{pD/.style = {\comnpatname photodiode}}
17757 \compattikzset{leD/.style = {\comnpatname led}}
17758 \compattikzset{VC/.style = {\comnpatname varcap}}
17759 \compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
17760 \compattikzset{Ty/.style = {\comnpatname thyristor}}
17761 \compattikzset{Tr/.style = {\comnpatname triac}}
17762
17763 \compattikzset{D-/.style = {\comnpatname stroke diode}}
17764 \compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
17765 \compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
17766 \compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
17767 \compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
17768 \compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
17769 \compattikzset{leD-/.style = {\comnpatname stroke led}}
17770 \compattikzset{VC-/.style = {\comnpatname stroke varcap}}
17771 \compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
17772 \compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
17773 \compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
17774
17775 % % % % % %
17776 % % End of Diodes
17777 % % % % % %
17778
17779
17780 \compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
17781 \compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
17782 \compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
17783 \compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
17784 \compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
17785 \compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
17786 \compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
17787 \compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
17788 \compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
17789 \compattikzset{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
17790 \compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
17791 \compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
17792 \compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
17793 \compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
17794
17795 \compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
17796 \compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
17797 \compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
17798 \tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
17799
17800 % cute switches
17801 %% closed cute switch
17802 \def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
17803 \compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
17804 \compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
17805
17806 %% open cute switch
17807 \def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
17808 \compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
17809 \compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
17810
17811 %% closing cute switch
17812 \def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
17813 \compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
17814 \compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
17815
17816 %% opening cute switch
17817 \def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
17818 \compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
17819 \compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
17820
17821
17822 % short forms
17823 \compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17824 \compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17825 \compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
17826 \compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
17827
17828 \compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
17829 \compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
17830
17831 \compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
17832 \compattikzset{isource/.style = {\comnpatname current source = #1}}
17833 \compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
17834 \compattikzset{ecsource/.style = {\comnpatname empty controlled source = #1}}
17835 \compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
17836 \compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
17837 \compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
17838 \compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
17839 \compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
17840 \compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
17841 \compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
17842
17843 \compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
17844 \compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
17845 \compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
17846 \compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
17847
17848 \compattikzset{R/.style= {\comnpatname resistor = #1}}
17849 \compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
17850 \compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
17851 \compattikzset{thR/.style= {\comnpatname thermistor = #1}}
17852 \compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
17853 \compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
17854 \compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
17855 \compattikzset{C/.style = {\comnpatname capacitor = #1}}
17856 \compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
17857 %% pC is deprecated, use cC instead
17858 \compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
17859 \compattikzset{cC/.style = {\comnpatname curved capacitor = #1}}
17860 \compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
17861 \compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
17862 \compattikzset{L/.style = {\comnpatname inductor = #1}}
17863 \compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
17864 \compattikzset{V/.style = {\comnpatname voltage source = #1}}
17865 \compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
17866 \compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
17867 \compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
17868 \compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
17869 \compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
17870 \def\pgf@temp#1{
17871 \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
17872 \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
17873 \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
17874 \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
17875 }
17876 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
17877 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
17878
17879 %current sources
17880 \compattikzset{I/.style = {\comnpatname current source = #1}}
17881 \compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
17882 \compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
17883 \compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
17884 \def\pgf@temp#1{
17885 \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
17886 \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
17887 \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
17888 \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
17889 }
17890 \pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
17891 \pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
17892 \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
17893
17894 % cute sources
17895 \def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
17896 \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}}
17897 \compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
17898 \compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
17899
17900 \def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
17901 \compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17902 \compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
17903 \compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
17904
17905 \def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
17906 \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}}
17907 \compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
17908 \compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
17909
17910 \def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
17911 \compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17912 \compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
17913 \compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
17914
17915 % noise sources
17916 \def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
17917 \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}}
17918 \compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
17919 \compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
17920
17921 \def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
17922 \compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
17923 \compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
17924 \compattikzset{nI/.style= {\comnpatname noise current source= #1}}
17925
17926 % resistive sensor american style
17927 \def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
17928 \compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
17929 \compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
17930 \compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
17931 \compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
17932
17933 \compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
17934 \compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
17935
17936 \compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
17937 \compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
17938 \compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
17939 \compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
17940 \compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
17941
17942 \compattikzset{Mr/.style = {\comnpatname memristor}}
17943
17944 \compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
17945 \compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
17946 \compattikzset{spst/.style = {\comnpatname switch = #1}}
17947
17948 \compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
17949
17950 \compattikzset{vdd/.style = {\comnpatname vcc = #1}}
17951 \compattikzset{vss/.style = {\comnpatname vee = #1}}
17952
17953 % activate the to-style crossing
17954 \def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
17955 \compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
17956 \compattikzset{xing/.style= {\comnpatname crossing= #1}}
17957
17958 %% loudspeaker and microphone
17959
17960 \def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
17961 \compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
17962
17963 \def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
17964 \compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
17965
17966 % more instrument
17967 \def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
17968 \compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
17969 \def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
17970 \compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
17971 \def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
17972 \compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
17973 % current loop probes
17974 \def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
17975 \compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
17976 \def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
17977 \compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
17978 % qucs-style probes
17979 \def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
17980 \compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
17981 \def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
17982 \compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
17983 \def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
17984 \compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
17985
17986
17987 % Transistor like bipoles
17988
17989 \def\pgf@circ@trans@path#1#2{
17990 \pgfextra{
17991 \edef\pgf@temp{\ctikzvalof{bipole/name}}
17992 \def\pgf@circ@temp{#2}
17993 \ifx\pgf@temp\pgf@circ@temp % if it has not a name
17994 \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
17995 \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
17996 \fi
17997 }
17998 \ifpgf@circuit@bipole@inverted
17999 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
18000 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
18001 \else
18002 (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
18003 (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
18004 \fi
18005 \pgfextra{
18006 \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
18007 {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
18008 \pgfmathadd{\pgfmathresult}{-90}
18009 \pgfmathround{\pgfmathresult}
18010 \edef\pgf@circ@direction{\pgfmathresult}
18011 }
18012 ($(\tikztostart) ! .5 ! (\tikztotarget)$)
18013 node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
18014 (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
18015 \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
18016 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
18017 (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
18018 \else
18019 (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
18020 (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
18021 \fi
18022 \drawpoles
18023 \pgfextra{
18024 \pgfcircresetpath
18025 }
18026 (\tikztotarget) \tikztonodes % e si continua
18027 }
18028
18029
18030 \def\pgf@circ@definetranspath#1{
18031 \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
18032 }
18033
18034 \pgf@circ@definetranspath{elmech}
18035 \pgf@circ@definetranspath{nmos}
18036 \pgf@circ@definetranspath{pmos}
18037 \pgf@circ@definetranspath{hemt}
18038 \pgf@circ@definetranspath{npn}
18039 \pgf@circ@definetranspath{pnp}
18040 \pgf@circ@definetranspath{nfet}
18041 \pgf@circ@definetranspath{nigfete}
18042 \pgf@circ@definetranspath{nigfetd}
18043 \pgf@circ@definetranspath{nigfetebulk}
18044 \pgf@circ@definetranspath{pfet}
18045 \pgf@circ@definetranspath{pigfete}
18046 \pgf@circ@definetranspath{pigfetd}
18047 \pgf@circ@definetranspath{pigfetebulk}
18048 \pgf@circ@definetranspath{njfet}
18049 \pgf@circ@definetranspath{pjfet}
18050 \pgf@circ@definetranspath{pigbt}
18051 \pgf@circ@definetranspath{nigbt}
18052 \pgf@circ@definetranspath{Lpigbt}
18053 \pgf@circ@definetranspath{Lnigbt}
18054 %%%---------- close: tex/pgfcircpath
18055
18056 \catcode`\@=\tikzatcode
18057 \catcode`\|=\tikzbarcode
18058 \catcode`\!=\tikzexclaimcode
18059
18060 % define the environment
18061 \long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture}
18062
18063 \protect
18064
18065 \stopmodule
18066
18067 \endinput