diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-15 21:47:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-15 21:47:32 +0000 |
commit | ad669530a9056a6c30abd6a337d481e646c5bc82 (patch) | |
tree | e7616304c393504e0ddfb3631c71db49ef830ee5 /Master/texmf-dist/tex | |
parent | ff006c2d366e4f0f3503a131959ab1ae04ea5e5f (diff) |
circuitikz (15may15)
git-svn-id: svn://tug.org/texlive/trunk@37410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
18 files changed, 3892 insertions, 787 deletions
diff --git a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex new file mode 100644 index 00000000000..4184114b75b --- /dev/null +++ b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex @@ -0,0 +1,123 @@ +\def\pgfcircversion{0.4} +\writestatus{loading}{2015/05/15 The CircuiTikz circuit drawing package version \pgfcircversion} + +\usemodule[tikz] + +\startmodule[circuitikz] + +\unprotect + +\edef\tikzatcode{\the\catcode`\@} +\edef\tikzbarcode{\the\catcode`\|} +\edef\tikzexclaimcode{\the\catcode`\!} +\catcode`\@=11 +\catcode`\|=12 +\catcode`\!=12 + +\usepgflibrary [decorations.pathmorphing] +\usetikzlibrary[calc] + +\input circuitikz.code.tex + +% defaults + +\setupmodule + [current=european, + voltage=european, + resistor=american, + inductor=cute, + logic=american, + siunitx=true, + arrowmos=false] + +\processaction + [\currentmoduleparameter{voltage}] + [european=>\ctikzset{voltage=european}, + american=>\ctikzset{voltage=american}] + +\processaction + [\currentmoduleparameter{current}] + [european=>\ctikzset{ current=european}, + american=>\ctikzset{ current=american}] + +\processaction + [\currentmoduleparameter{label}] + [straight=>\ctikzset{label/align = straight}, + align=>\ctikzset{label/align = rotate}, + smart=>\ctikzset{label/align = smart}] + +\processaction + [\currentmoduleparameter{resistor}] + [european=>\ctikzset{ resistor=european}, + american=>\ctikzset{ resistor=american}] + +\processaction + [\currentmoduleparameter{inductor}] + [european=>\ctikzset{ inductor=european}, + american=>\ctikzset{ inductor=american}, + cute=>\ctikzset{ inductor=cute}] + +\processaction + [\currentmoduleparameter{diode}] + [full=>\ctikzset{ diode=full}, + empty=>\ctikzset{ diode=empty}] + +\processaction + [\currentmoduleparameter{logic}] + [european=>\ctikzset{ logic ports=european}, + american=>\ctikzset{ logic ports=american}] + +\processaction + [\currentmoduleparameter{siunitx}] + [true=>\def\SI#1#2{#1\,#2} + \def\ampere{\rm{A}} + \def\volt{\rm{V}} + \def\ohm{\Omega} + \def\siemens{\rm{S}} + \def\farad{\rm{F}} + \def\henry{\rm{H}} + \def\second{\rm{s}} + \def\coulomb{\rm{C}} + \def\siemens{\rm{S}} + \def\radians{\rm{rad}} + \def\milli{\rm{m}} + \def\micro{\mu} + \def\nano{\rm{n}} + \def\pico{\rm{p}} + \def\kilo{\rm{k}} + \def\mega{\rm{M}} + \def\giga{\rm{G}} + \def\tera{\rm{T}}, + false=>] +% \s!default=>\pgf@circ@siunitxtrue, + +\processaction + [\currentmoduleparameter{arrowmos}] + [true=>\pgf@circuit@mos@arrowstrue, + false=>\pgf@circuit@mos@arrowsfalse] +% \s!default=>\pgf@circuit@mos@arrowstrue, + + +\ifpgf@circ@siunitx + % nothing! siunitx and xstrings don't work in context +\fi + + +% Context specific + +\ctikzset{tripoles/op amp/font/.initial=\switchtobodyfont[small]} + +\input circuitikz1.code.tex + +\catcode`\@=\tikzatcode +\catcode`\|=\tikzbarcode +\catcode`\!=\tikzexclaimcode + +% define the environment +\long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture} + +\protect + +\stopmodule + +\endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex b/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex index 3ed036a7cab..4dfe979f86b 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.code.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/circuitikz.code.tex @@ -17,6 +17,15 @@ \def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}} \def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}} + +\newif\ifpgf@circ@siunitx +\newif\ifpgf@circuit@compat + +\newif\ifpgf@circuit@inputarrow +\ctikzset{inputarrow/.is choice} +\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}} +\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}} + \ctikzset{bipoles/.is family} \ctikzset{bipoles/border margin/.initial=1.1} \ctikzset{bipoles/thickness/.initial=2} @@ -27,6 +36,10 @@ \ctikzset{monopoles/.is family} \ctikzset{monopoles/ground/width/.initial=.25} +\ctikzset{monopoles/tground/thickness/.initial=3} +\ctikzset{monopoles/vcc/width/.initial=.2} +\ctikzset{monopoles/match/width/.initial=.4} +\ctikzset{monopoles/oscillator/width/.initial=.7} \ctikzset{monopoles/chassis/width/.initial=.25} \ctikzset{monopoles/alternative chassis/width/.initial=.25} \ctikzset{monopoles/equipotentiality/width/.initial=.25} @@ -66,22 +79,37 @@ \ctikzset{bipoles/vresistor/height/.initial=.6} \ctikzset{bipoles/vresistor/width/.initial=.8} \ctikzset{bipoles/cuteinductor/height/.initial=.3} -\ctikzset{bipoles/cuteinductor/width/.initial=.8} +\ctikzset{bipoles/cuteinductor/width/.initial=.6} \ctikzset{bipoles/cuteinductor/coils/.initial=6} +\ctikzset{bipoles/cuteinductor/coil height/.initial=.15} +\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.25} +\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.05} \ctikzset{bipoles/americaninductor/height/.initial=.3} \ctikzset{bipoles/americaninductor/height 2/.initial=.1} \ctikzset{bipoles/americaninductor/width/.initial=.8} \ctikzset{bipoles/americaninductor/coils/.initial=4} -\ctikzset{bipoles/vcuteinductor/height/.initial=.6} -\ctikzset{bipoles/vcuteinductor/coil height/.initial=.3} -\ctikzset{bipoles/vcuteinductor/width/.initial=.8} +\ctikzset{bipoles/americaninductor/coil height/.initial=.15} +\ctikzset{bipoles/vcuteinductor/height/.initial=.3} +\ctikzset{bipoles/vcuteinductor/width/.initial=.6} \ctikzset{bipoles/vcuteinductor/coils/.initial=6} +\ctikzset{bipoles/vcuteinductor/coil height/.initial=.15} +\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.25} +\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.05} \ctikzset{bipoles/vamericaninductor/height/.initial=.6} \ctikzset{bipoles/vamericaninductor/height 2/.initial=.2} \ctikzset{bipoles/vamericaninductor/width/.initial=.8} \ctikzset{bipoles/vamericaninductor/coils/.initial=4} +\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15} +\ctikzset{bipoles/esource/height/.initial=.60} +\ctikzset{bipoles/esource/width/.initial=.60} \ctikzset{bipoles/isource/height/.initial=.60} \ctikzset{bipoles/isource/width/.initial=.60} +\ctikzset{bipoles/dcisource/height/.initial=.60} +\ctikzset{bipoles/dcisource/width/.initial=.60} +\ctikzset{bipoles/dcvsource/height/.initial=.60} +\ctikzset{bipoles/dcvsource/width/.initial=.60} +\ctikzset{bipoles/vsourcetri/height/.initial=.60} +\ctikzset{bipoles/vsourcetri/width/.initial=.60} \ctikzset{bipoles/isourceam/height/.initial=.60} \ctikzset{bipoles/isourceam/width/.initial=.60} \ctikzset{bipoles/vsource/height/.initial=.60} @@ -129,6 +157,15 @@ \ctikzset{bipoles/interr/height 2/.initial=.1} \ctikzset{bipoles/generic/height/.initial=.30} \ctikzset{bipoles/generic/width/.initial=.80} +\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30} +\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80} +\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30} +\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60} +\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60} +\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15} +\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25} +\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45} +\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1} \ctikzset{bipoles/fuse/height/.initial=.20} \ctikzset{bipoles/fuse/width/.initial=.50} \ctikzset{bipoles/afuse/height/.initial=.20} @@ -151,6 +188,8 @@ \ctikzset{bipoles/open/width/.initial=.8} \ctikzset{bipoles/ammeter/height/.initial=.60} \ctikzset{bipoles/ammeter/width/.initial=.60} +\ctikzset{bipoles/ohmmeter/height/.initial=.60} +\ctikzset{bipoles/ohmmeter/width/.initial=.60} \ctikzset{bipoles/voltmeter/height/.initial=.60} \ctikzset{bipoles/voltmeter/width/.initial=.60} \ctikzset{bipoles/buffer/height/.initial=1} @@ -173,6 +212,27 @@ \ctikzset{bipoles/pushbutton/height 2/.initial=.0} \ctikzset{bipoles/pushbutton/width/.initial=.50} +\ctikzset{bipoles/twoport/width/.initial=.7} +\ctikzset{bipoles/twoport/height/.initial=.7} +\ctikzset{bipoles/twoport/text/.initial=} +\ctikzset{bipoles/vco/width/.initial=.7} +\ctikzset{bipoles/bandpass/width/.initial=.7} +\ctikzset{bipoles/highpass/width/.initial=.7} +\ctikzset{bipoles/lowpass/width/.initial=.7} +\ctikzset{bipoles/adc/width/.initial=.7} +\ctikzset{bipoles/dac/width/.initial=.7} +\ctikzset{bipoles/dsp/width/.initial=.7} +\ctikzset{bipoles/fft/width/.initial=.7} +\ctikzset{bipoles/amp/width/.initial=.7} +\ctikzset{bipoles/vamp/width/.initial=.7} +\ctikzset{bipoles/piattenuator/width/.initial=.7} +\ctikzset{bipoles/vpiattenuator/width/.initial=.7} +\ctikzset{bipoles/tattenuator/width/.initial=.7} +\ctikzset{bipoles/vtattenuator/width/.initial=.7} +\ctikzset{bipoles/phaseshifter/width/.initial=.7} +\ctikzset{bipoles/vphaseshifter/width/.initial=.7} +\ctikzset{bipoles/detector/width/.initial=.7} + \newif\ifpgf@circuit@mos@arrows \ctikzset{tripoles/mos style/.is choice} \ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}} @@ -218,6 +278,13 @@ \ctikzset{tripoles/nigfetd/base width/.initial=.5} \ctikzset{tripoles/nigfetd/gate width/.initial=.62} +\ctikzset{tripoles/nigfetebulk/width/.initial=.7} +\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35} +\ctikzset{tripoles/nigfetebulk/base height/.initial=.5} +\ctikzset{tripoles/nigfetebulk/height/.initial=1.1} +\ctikzset{tripoles/nigfetebulk/base width/.initial=.5} +\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62} + \ctikzset{tripoles/pigfete/width/.initial=.7} \ctikzset{tripoles/pigfete/gate height/.initial=.35} \ctikzset{tripoles/pigfete/base height/.initial=.5} @@ -232,6 +299,13 @@ \ctikzset{tripoles/pigfetd/base width/.initial=.5} \ctikzset{tripoles/pigfetd/gate width/.initial=.62} +\ctikzset{tripoles/pigfetebulk/width/.initial=.7} +\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35} +\ctikzset{tripoles/pigfetebulk/base height/.initial=.5} +\ctikzset{tripoles/pigfetebulk/height/.initial=1.1} +\ctikzset{tripoles/pigfetebulk/base width/.initial=.5} +\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62} + \ctikzset{tripoles/npn/width/.initial=.6} \ctikzset{tripoles/npn/gate height/.initial=.45} \ctikzset{tripoles/npn/gate height 2/.initial=.15} @@ -385,6 +459,12 @@ \ctikzset{tripoles/op amp/height/.initial=1.4} \ctikzset{tripoles/op amp/input height/.initial=.5} \ctikzset{tripoles/op amp/up pos/.initial=.45} +\ctikzset{tripoles/op amp/font/.initial=} +\ctikzset{tripoles/gm amp/width/.initial=1.7} +\ctikzset{tripoles/gm amp/port width/.initial=.7} +\ctikzset{tripoles/gm amp/height/.initial=1.4} +\ctikzset{tripoles/gm amp/input height/.initial=.5} +\ctikzset{tripoles/gm amp/up pos/.initial=.45} \ctikzset{tripoles/plain amp/width/.initial=1.7} \ctikzset{tripoles/plain amp/port width/.initial=.7} \ctikzset{tripoles/plain amp/height/.initial=1.4} @@ -411,9 +491,12 @@ \ctikzset{tripoles/toggleswitch/height 2/.initial=.0} \ctikzset{tripoles/toggleswitch/width/.initial=.80} -\ctikzset{tripoles/mixer/height/.initial=.85} -\ctikzset{tripoles/mixer/width/.initial=.85} -\ctikzset{tripoles/mixer/margin/.initial=.75} +\ctikzset{tripoles/mixer/width/.initial=0.7} +\ctikzset{tripoles/adder/width/.initial=0.7} +\ctikzset{tripoles/circulator/width/.initial=.7} + +\ctikzset{tripoles/wilkinson/height/.initial=1.3} +\ctikzset{tripoles/wilkinson/width/.initial=1.3} \ctikzset{quadpoles/transformer/width/.initial=1.5} \ctikzset{quadpoles/transformer/width1/.initial=.4} @@ -425,6 +508,8 @@ \ctikzset{quadpoles/transformer core/core width/.initial=.05} \ctikzset{quadpoles/gyrator/width/.initial=1.5} \ctikzset{quadpoles/gyrator/height/.initial=1.5} +\ctikzset{quadpoles/coupler/width/.initial=1.3} +\ctikzset{quadpoles/coupler/height/.initial=1.3} @@ -483,6 +568,8 @@ \ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}} + + \newif\ifpgf@circuit@europeanresistor \ctikzset{resistor/.is choice} \ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse } @@ -555,6 +642,14 @@ \tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } } \tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } } \tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } } + +\newif\ifpgf@circuit@europeangfsurgearrester +\ctikzset{gas filled surge arrester/.is choice} +\ctikzset{gas filled surge arrester/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } } +\ctikzset{gas filled surge arrester/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } } + +\tikzset{american gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = american } } +\tikzset{european gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = european } } \tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } } \tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } } \tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } } @@ -562,8 +657,8 @@ \tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty } } \tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } } \tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } } -\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports } } -\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports } } +\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester } } +\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester } } \tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } } % I should try to make the tree clearer (this voltaege conflicts with the options above) @@ -585,20 +680,31 @@ %% dependencies -\input pgfcircutils.sty -\input pgfcircmath.sty -\input pgfcircshapes.sty -\input pgfcircmonopoles.sty -\input pgfcircbipoles.sty -\input pgfcirctripoles.sty -\input pgfcircquadpoles.sty -\input pgfcirclabel.sty -\input pgfcircvoltage.sty -\input pgfcirccurrent.sty +%%%%%%%%%% new +\pgfkeys{\circuitikzbasekey/.search also={/tikz}} + + + + +\input pgfcircutils.tex +\input pgfcircmath.tex + +\input pgfcircshapes.tex +\input pgfcircmonopoles.tex +\input pgfcircbipoles.tex +\input pgfcirctripoles.tex +\input pgfcircquadpoles.tex +\input pgfcircnpoles.tex + +\input pgfcirclabel.tex +\input pgfcircvoltage.tex +\input pgfcirccurrent.tex +\input pgfcircinputarrows.tex + diff --git a/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex b/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex new file mode 100644 index 00000000000..3319bc18c1f --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/circuitikz1.code.tex @@ -0,0 +1,548 @@ +%%%%%%%%%%%% +%% Dimensions + +% coordinate bipoli +\newdimen\pgf@circ@res@up \newdimen\pgf@circ@res@down \newdimen\pgf@circ@res@zero +\newdimen\pgf@circ@res@left \newdimen\pgf@circ@res@right +\newdimen\pgf@circ@res@other +\newdimen\pgf@circ@res@step +\newdimen\pgf@circ@res@temp + +% thickness iniziale +\newdimen \pgfstartlinewidth + +\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + + + +% Names +\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@ +\ctikzset{n/.code = { + \pgfkeys{/tikz/circuitikz/bipole/name=#1} +}} + +% Reflect the node along +\ctikzset{mirrored/.is choice} +\ctikzset{mirror value/.initial=1} +\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} } +\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} } +\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}} + +% Initialize paths +\def\pgfcircresetpath{ + \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, + bipole/reversed=false, bipole/kind=, + bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below, + bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false, + bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after, + bipole/current/y position=above, bipole/current/direction=forward, + mirrored=false + } +} + + +%% Generic bipole path +\def\pgf@circ@bipole@path#1#2{ + \pgfextra{ + \ctikzset{bipole/kind = #1} + + \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} + \def\pgf@circ@temp{} + \ifx\pgf@temp\pgf@circ@temp % if it has not a name + \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} + \ctikzset{bipole/name = #2\pgf@circ@rand} % create it + \fi + + \def\pgf@temp{open} + \def\pgf@circ@temp{#1} + } + \ifpgf@circuit@bipole@reversed + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} + \else + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} + \fi + \pgfextra{ + \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} + {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} + \edef\pgf@circ@direction{\pgfmathresult} + } + ($(\tikztostart) ! .5 ! (\tikztotarget)$) + node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}] + (\ctikzvalof{bipole/name}) {} + \ifx\pgf@temp\pgf@circ@temp % if it is an open + \else + (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) + (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) + \fi + \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabel\fi + \drawpoles + \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi + \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi + % reset + \pgfextra{ + \pgfcircresetpath + } + (\tikztotarget) \tikztonodes % e si continua +} + + +%% Path definitions + +\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi} +\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi} +\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi} +\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}} +\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}} +\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}} +\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}} +\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}} +\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}} +\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}} +\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} +\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}} +\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} +\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}} +\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}} +\def\pgf@circ@inductor@path#1{% + \pgfextra{ + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + } + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@europeaninductor@path{#1}% + \else% + \pgfextra{ \def\pgf@temp{cute} }% + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@cuteinductor@path{#1}% + \else% + \pgf@circ@americaninductor@path{#1}% + \fi% + \fi% +} +\def\pgf@circ@vinductor@path#1{ + \pgfextra{ + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + } + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@veuropeaninductor@path{#1}% + \else% + \pgfextra{ \def\pgf@temp{cute} }% + \ifx\pgf@temp\pgf@circ@temp% + \pgf@circ@vcuteinductor@path{#1}% + \else% + \pgf@circ@vamericaninductor@path{#1}% + \fi% + \fi% +} +\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} +\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}} +\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}} +\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}} +\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}} +\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}} +\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}} +\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}} +\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}} +\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}} +\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}} +\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}} +\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}} +\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}} +\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}} +\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}} +\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}} +\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}} +\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}} +\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}} +\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}} +\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}} +\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}} +\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}} +\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}} +\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}} +\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}} +\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}} +\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}} +\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}} +\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}} +\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}} +\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}} +\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}} +\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}} +\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}} +\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}} +\def\pgf@circ@spst@path#1{\pgf@circ@bipole@path{spst}{#1}} +\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}} +\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}} +\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}} +\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}} +\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}} +\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}} +\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} +\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} +\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}} +\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}} +\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}} +\def\pgf@circ@empty@path#1{} +\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}} +\def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}} +\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}} +\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}} +\def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}} +\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}} +\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}} +\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}} +\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}} +\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}} +\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}} + +\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi} +\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}} +\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}} + +\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}} +\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}} +\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}} +\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}} +\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}} +\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}} +\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}} +\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}} +\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}} +\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}} +\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}} +\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}} +\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}} +\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}} +\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}} +\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}} +\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}} +\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}} + + +%% Styles + +%% Aggiungere per thyristor e tripoli semplici + +\def\comnpatname{\ifpgf@circuit@compat *\else\fi} +\def\compattikzset#1{\tikzset{\comnpatname#1}} + +%\def\ctikzsetbipole#1#2{% +% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}% +%} + +\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}} +\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}} +\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}} +\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}} +\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}} +\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}} +\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}} +\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}} +\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}} +\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}} +\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}} +\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}} +\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}} +\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}} +\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}} +\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}} +\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} +\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}} +\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} +\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}} +\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}} +\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}} +\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}} +\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}} +\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}} +\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}} +\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}} +\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}} +\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}} +\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}} +\compattikzset{transmission line/.style = {tline = #1}} +\compattikzset{TL/.style = {tline = #1}} +\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} +\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} + +\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}} +\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}} + + +\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}} +\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}} +\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}} +\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}} +\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}} +\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}} +\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}} + +\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}} + +\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}} +\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}} +\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}} +\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}} +\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}} + +\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}} +\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}} +\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}} +\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}} +\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}} +\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}} +\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}} +\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}} +\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}} +\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}} +\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}} +\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}} +\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}} +\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}} +\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}} +\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}} +\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}} +\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}} + +\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}} +\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}} +\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}} +\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}} +\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}} +\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}} +\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}} + +\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}} +\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}} +\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}} +\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}} +\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}} +\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}} +\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}} + + \compattikzset{Schottky diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}} + \compattikzset{Zener diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi Zener diode}} + \compattikzset{tunnel diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}} + \compattikzset{photodiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi photodiode}} + \compattikzset{led/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi led}} + \compattikzset{varcap/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi varcap}} + \compattikzset{diode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi diode}} %%%%%%%%%%%%@@@ + + + + +\compattikzset{thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thyristor@path}} +\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}} +\compattikzset{triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@triac@path}} + +\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}} +\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}} +\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spst@path, l=#1}} +\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}} +\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}} + +\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}} +\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}} +\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}} + +% short forms +\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} +\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, l=#1}} +\compattikzset{myvsource/.style = {\comnpatname dcvsource = #1}}%For compability, not documented, can be removed in further versions +\compattikzset{myisource/.style = {\comnpatname dcisource = #1}}%For compability, not documented, can be removed in further versions +\compattikzset{vsource/.style = {\comnpatname voltage source = #1}} +\compattikzset{isource/.style = {\comnpatname current source = #1}} +\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}} +\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}} +\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}} +\compattikzset{vsourcetri/.style = {triangle voltage source = #1}} +\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}} +\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} +\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} + +\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}} +\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}} +\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}} + +\compattikzset{R/.style= {\comnpatname resistor = #1}} +%\ifpgf@circuit@compat\else\compattikzset{R/.style= {resistor = #1}}\fi +\compattikzset{vR/.style= {\comnpatname variable resistor = #1}} +\compattikzset{phR/.style= {\comnpatname photoresistor = #1}} +\compattikzset{thR/.style= {\comnpatname thermistor = #1}} +\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}} +\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}} +\compattikzset{pR/.style= {\comnpatname potentiometer = #1}} +\compattikzset{C/.style = {\comnpatname capacitor = #1}} +\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}} +\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}} +\compattikzset{L/.style = {\comnpatname inductor = #1}} +\compattikzset{vL/.style = {\comnpatname variable inductor = #1}} +\compattikzset{V/.style = {\comnpatname voltage source = #1}} +\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}} +\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}} +\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}} +\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}} +\def\pgf@temp#1{ + \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} } + \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} } + \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} } + \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} } +} +\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} +\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} +\compattikzset{I/.style = {\comnpatname current source = #1}} +\compattikzset{cI/.style = {\comnpatname controlled current source = #1}} +\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}} +\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}} +\def\pgf@temp#1{ + \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} } + \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} } + \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} } + \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} } +} +\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} +\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^} +\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} +\compattikzset{Do/.style = {\comnpatname empty diode}} +\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}} +\compattikzset{zDo/.style = {\comnpatname empty Zener diode}} +\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}} +\compattikzset{pDo/.style = {\comnpatname empty photodiode}} +\compattikzset{leDo/.style = {\comnpatname empty led}} +\compattikzset{VCo/.style = {\comnpatname empty varcap}} +\compattikzset{D*/.style = {\comnpatname full diode}} +\compattikzset{tD*/.style = {\comnpatname full tunnel diode}} +\compattikzset{zD*/.style = {\comnpatname full Zener diode}} +\compattikzset{sD*/.style = {\comnpatname full Schottky diode}} +\compattikzset{pD*/.style = {\comnpatname full photodiode}} +\compattikzset{leD*/.style = {\comnpatname full led}} +\compattikzset{VC*/.style = {\comnpatname full varcap}} +\compattikzset{D/.style = {\comnpatname diode}} +\compattikzset{tD/.style = {\comnpatname tunnel diode}} +\compattikzset{zD/.style = {\comnpatname Zener diode}} +\compattikzset{sD/.style = {\comnpatname Schottky diode}} +\compattikzset{pD/.style = {\comnpatname photodiode}} +\compattikzset{leD/.style = {\comnpatname led}} +\compattikzset{VC/.style = {\comnpatname varcap}} + +\compattikzset{Tr/.style = {\comnpatname triac}} +\compattikzset{Mr/.style = {\comnpatname memristor}} +\compattikzset{Ty/.style = {\comnpatname thyristor}} + +\compattikzset{cspst/.style = {\comnpatname closing switch = #1}} +\compattikzset{ospst/.style = {\comnpatname opening switch = #1}} +\compattikzset{spst/.style = {switch = #1}} + +\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}} + + +\def\inheritlogicport#1#2{ + \pgfdeclareshape{#2 port}{ + \inheritsavedanchors[from=#1 #2 port] + \inheritbackgroundpath[from=#1 #2 port] + \inheritanchor[from=#1 #2 port]{in} + \inheritanchor[from=#1 #2 port]{in 1} + \inheritanchor[from=#1 #2 port]{in 2} + \inheritanchor[from=#1 #2 port]{out} + \inheritanchor[from=#1 #2 port]{center} + \inheritanchor[from=#1 #2 port]{left} + } +} + +\ifpgf@circuit@europeanlogicport + \inheritlogicport{european}{and} + \inheritlogicport{european}{or} + \inheritlogicport{european}{xor} + \inheritlogicport{european}{not} + \inheritlogicport{european}{nand} + \inheritlogicport{european}{nor} + \inheritlogicport{european}{xnor} +\else + \inheritlogicport{american}{and} + \inheritlogicport{american}{or} + \inheritlogicport{american}{xor} + \inheritlogicport{american}{not} + \inheritlogicport{american}{nand} + \inheritlogicport{american}{nor} + \inheritlogicport{american}{xnor} +\fi + +% Transistor like bipoles + +\def\pgf@circ@trans@path#1#2{ + \pgfextra{ + \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} + \def\pgf@circ@temp{#2} + \ifx\pgf@temp\pgf@circ@temp % if it has not a name + \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} + \ctikzset{bipole/name = trans\pgf@circ@rand} % create it + \fi + } + \ifpgf@circuit@bipole@reversed + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} + \else + (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} + (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} + \fi + \pgfextra{ + \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} + {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} + \pgfmathadd{\pgfmathresult}{-90} + \edef\pgf@circ@direction{\pgfmathresult} + } + ($(\tikztostart) ! .5 ! (\tikztotarget)$) + node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}] + (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}} + (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) + (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) + \pgfextra{ + \pgfcircresetpath + } + (\tikztotarget) \tikztonodes % e si continua +} + + +\def\pgf@circ@definetranspath#1{ + \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}} +} + +\pgf@circ@definetranspath{nmos} +\pgf@circ@definetranspath{pmos} +\pgf@circ@definetranspath{npn} +\pgf@circ@definetranspath{pnp} +\pgf@circ@definetranspath{nfet} +\pgf@circ@definetranspath{nigfete} +\pgf@circ@definetranspath{nigfetd} +\pgf@circ@definetranspath{nigfetebulk} +\pgf@circ@definetranspath{pfet} +\pgf@circ@definetranspath{pigfete} +\pgf@circ@definetranspath{pigfetd} +\pgf@circ@definetranspath{pigfetebulk} +\pgf@circ@definetranspath{njfet} +\pgf@circ@definetranspath{pjfet} +\pgf@circ@definetranspath{pigbt} +\pgf@circ@definetranspath{nigbt} diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index 34c11a86c20..8a1e62e29fc 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircbipoles.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -328,45 +328,51 @@ \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{ \pgf@circ@res@step=\ctikzvalof{bipoles/cuteinductor/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by \ctikzvalof{bipoles/cuteinductor/coils} + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/cuteinductor/coils} %divide by number of coils + \divide \pgf@circ@res@step by 2 %div by two for arcs - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/cuteinductor/height}\pgf@circ@Rlen - \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude - \pgfdecorationsegmentlength = \pgf@circ@res@step - \pgfdecorationsegmentaspect=.6 + \def\pgf@circ@coilsmall@width{\ctikzvalof{bipoles/cuteinductor/coil aspect}\pgf@circ@res@step} - \pgfdecoration{{coil}{\pgfdecoratedremainingdistance}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \endpgfdecoration - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \advance \pgf@circ@res@step by \pgf@circ@coilsmall@width %adjust for overlapping lower arc + + \def\pgf@circ@coilwide@width{\pgf@circ@res@step} + + \pgf@circ@res@other = \ctikzvalof{bipoles/cuteinductor/coil height}\pgf@circ@Rlen + \pgf@circ@res@temp =\ctikzvalof{bipoles/cuteinductor/lower coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+0.5\pgfstartlinewidth}{-0.5\pgfstartlinewidth}} + \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}} + { + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfpatharc{0}{-180}{\pgf@circ@coilsmall@width and \pgf@circ@res@temp} + } + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfusepath{stroke} } - %% american inductor \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils} - - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/americaninductor/height}\pgf@circ@Rlen - \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude - \pgfdecorationsegmentlength = 1.9\pgf@circ@res@step - - \pgfdecoration{{bumps}{\pgfdecoratedremainingdistance}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \endpgfdecoration - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \divide \pgf@circ@res@step by 2 + \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-0.5\pgfstartlinewidth}} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-0.5\pgfstartlinewidth}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfusepath{stroke} } - %% Independent voltage source \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{ @@ -398,7 +404,7 @@ %% Independent sinusoidal voltage source - + \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesin/height}}{vsourcesin}{\ctikzvalof{bipoles/vsourcesin/height}}{\ctikzvalof{bipoles/vsourcesin/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -417,7 +423,23 @@ \endpgfscope } +% Triangle Voltage source – contributed by Ralf Farkas +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{ + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} % contributed by Alistair Kwan @@ -440,6 +462,66 @@ \endpgfscope } +% Triangle Voltage source – contributed by Ralf Farkas +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgf@circ@res@up = .5\pgf@circ@res@up + \pgfscope + \pgftransformrotate{90} + \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} + + +%% Empty Source +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{ + \pgfpointorigin + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% DC Current Source with open shape +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcisource/height}}{dcisource}{\ctikzvalof{bipoles/dcisource/height}}{\ctikzvalof{bipoles/dcisource/width}}{ + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{-90}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{270}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \pgfscope + \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope +} + +%% DC-Voltage source +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcvsource/height}}{dcvsource}{\ctikzvalof{bipoles/dcvsource/height}}{\ctikzvalof{bipoles/dcvsource/width}}{ + \pgfpointorigin + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}} + \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}} + \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}} + \pgfusepath{draw} +} + %% Independent current source @@ -737,11 +819,11 @@ \pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} \pgfusepath{draw} } @@ -765,11 +847,11 @@ \pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsstart{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} \pgfusepath{draw} } @@ -899,16 +981,14 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - \pgfscope \pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} \pgfusepath{draw} - \endpgfscope } %% Empty photodiode @@ -930,11 +1010,11 @@ \pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsstart{latex'} - \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@up}{.6\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@up}{.4\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@up}{.8\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} \pgfusepath{draw} } @@ -960,9 +1040,9 @@ \endpgfscope } -%% Closing SPST +%% SPST -\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{spst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} @@ -980,6 +1060,21 @@ } +%% Closing SPST + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}} + \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen} + %\pgfsetarrowsend{latex'} + \pgfusepath{draw} + +} + %% Opening SPST \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{ @@ -1065,6 +1160,49 @@ \pgfnode{circle}{center}{\textbf{A}}{}{} } +%% Ohmmeter – contributed by Ralf Farkas + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ohmmeter/height}}{ohmmeter}{\ctikzvalof{bipoles/ohmmeter/height}}{\ctikzvalof{bipoles/ohmmeter/width}}{ + \def\pgf@circ@temp{right} + \ifx\tikz@res@label@pos\pgf@circ@temp + \pgf@circ@res@step=-1.2\pgf@circ@res@up + \else + \def\pgf@circ@temp{below} + \ifx\tikz@res@label@pos\pgf@circ@temp + \pgf@circ@res@step=-1.2\pgf@circ@res@up + \else + \pgf@circ@res@step=1.2\pgf@circ@res@up + \fi + \fi + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} + \pgfusepath{draw} + \endpgfscope + + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfsetarrowsend{} + + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfnode{circle}{center}{\boldmath$\Omega$}{}{} +} + %% Voltmeter \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/voltmeter/height}}{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{ @@ -1159,7 +1297,7 @@ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} - \pgfusepath{fill} + \pgfusepath{draw,fill} } @@ -1375,30 +1513,38 @@ } -%% Variable Cute Inductor +%% variable cute inductor \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcuteinductor/height}}{vcuteinductor}{\ctikzvalof{bipoles/vcuteinductor/height}}{\ctikzvalof{bipoles/vcuteinductor/width}}{ \pgf@circ@res@step=\ctikzvalof{bipoles/vcuteinductor/width}\pgf@circ@Rlen - \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vcuteinductor/coils} + \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vcuteinductor/coils} %divide by number of coils + \divide \pgf@circ@res@step by 2 %div by two for arcs - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/vcuteinductor/coil height}\pgf@circ@Rlen - \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude - \pgfdecorationsegmentlength = \pgf@circ@res@step - \pgfdecorationsegmentaspect=.6 + \def\pgf@circ@coilsmall@width{\ctikzvalof{bipoles/vcuteinductor/coil aspect}\pgf@circ@res@step} - \pgfdecoration{{coil}{\pgfdecoratedremainingdistance}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \endpgfdecoration - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \advance \pgf@circ@res@step by \pgf@circ@coilsmall@width %adjust for overlapping lower arc + + \def\pgf@circ@coilwide@width{\pgf@circ@res@step} + + \pgf@circ@res@other = \ctikzvalof{bipoles/vcuteinductor/coil height}\pgf@circ@Rlen + \pgf@circ@res@temp =\ctikzvalof{bipoles/vcuteinductor/lower coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+0.5\pgfstartlinewidth}{-0.5\pgfstartlinewidth}} + \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}} + { + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfpatharc{0}{-180}{\pgf@circ@coilsmall@width and \pgf@circ@res@temp} + } + \pgfpatharc{180}{0}{\pgf@circ@coilwide@width and \pgf@circ@res@other} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfusepath{stroke} - \pgfscope +\pgfscope \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{1.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{2.5\pgf@circ@res@up}} \pgfusepath{draw} - \endpgfscope + \endpgfscope } @@ -1407,25 +1553,24 @@ \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{ \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils} - - \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/vamericaninductor/height}\pgf@circ@Rlen - \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude - \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude % per freccia - \pgfdecorationsegmentlength = 1.9\pgf@circ@res@step - - \pgfdecoration{{bumps}{\pgfdecoratedremainingdistance}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \endpgfdecoration - \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \divide \pgf@circ@res@step by 2 + \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-0.5\pgfstartlinewidth}} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} \pgfusepath{stroke} - \pgfscope + \pgfscope \pgfsetarrowsend{latex'} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfusepath{draw} - \endpgfscope + \endpgfscope } @@ -1775,5 +1920,949 @@ } } + +%% Generic two port box +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/twoport/height}}{twoport}{\ctikzvalof{bipoles/twoport/height}}{\ctikzvalof{bipoles/twoport/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}} + +} + +%% voltage controled oscillator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vco/width}}{vco}{\ctikzvalof{bipoles/twoport/width}}{\ctikzvalof{bipoles/vco/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner sine waves + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + +} + +%% bandpass filter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandpass/width}}{bandpass}{\ctikzvalof{bipoles/bandpass/width}}{\ctikzvalof{bipoles/bandpass/width}}{ + + \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfusepath{draw} +} + +%% highpass filter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/highpass/width}}{highpass}{\ctikzvalof{bipoles/highpass/width}}{\ctikzvalof{bipoles/highpass/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfusepath{draw} +} + +%% lowpass filter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lowpass/width}}{lowpass}{\ctikzvalof{bipoles/lowpass/width}}{\ctikzvalof{bipoles/lowpass/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} +} + +%% ADC +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/adc/width}}{adc}{\ctikzvalof{bipoles/adc/width}}{\ctikzvalof{bipoles/adc/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\texti{A} + \def\textii{D} + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \def\texti{D} + \def\textii{A} + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \def\texti{D} + \def\textii{A} + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \def\texti{A} + \def\textii{D} + \fi\fi + + % draw inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}} +} + +%% DAC +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dac/width}}{dac}{\ctikzvalof{bipoles/dac/width}}{\ctikzvalof{bipoles/dac/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\texti{D} + \def\textii{A} + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \def\texti{A} + \def\textii{D} + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible + \def\texti{A} + \def\textii{D} + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \def\texti{D} + \def\textii{A} + \fi\fi + + % draw inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}} +} + +%% DSP +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dsp/width}}{dsp}{\ctikzvalof{bipoles/dsp/width}}{\ctikzvalof{bipoles/dsp/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgftext[center,x=0,y=0]{\textsf{DSP}} +} + +%% FFT +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fft/width}}{fft}{\ctikzvalof{bipoles/fft/width}}{\ctikzvalof{bipoles/fft/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgftext[center,x=0,y=0]{\textsf{FFT}} +} + +%% Amplifier +\pgfcircdeclarebipole{}{ + %\ifpgf@circuit@box + \ctikzvalof{bipoles/twoport/width} + %\else + % \ctikzvalof{bipoles/amp/width} + %\fi + }{amp}{ + %\ifpgf@circuit@box + \ctikzvalof{bipoles/twoport/width} + %\else + % \ctikzvalof{bipoles/amp/width} + % \fi + }{ + % \ifpgf@circuit@box + \ctikzvalof{bipoles/twoport/width} + % \else + % \ctikzvalof{bipoles/amp/width} + % \fi + }{ + \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen + + + % draw outer box + %\ifpgf@circuit@box + % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}} + %\fi + % draw outer box + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw input arrow + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}} + \pgfpathclose + \pgfusepath{draw} +} + + +%% variable amplifier +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamp/width}}{vamp}{\ctikzvalof{bipoles/vamp/width}}{\ctikzvalof{bipoles/vamp/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vamp/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}} + \pgfpathclose + \pgfusepath{draw} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.7\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% pi attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piattenuator/width}}{piattenuator}{\ctikzvalof{bipoles/piattenuator/width}}{\ctikzvalof{bipoles/piattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% variable pi attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vpiattenuator/width}}{vpiattenuator}{\ctikzvalof{bipoles/vpiattenuator/width}}{\ctikzvalof{bipoles/vpiattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% T attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tattenuator/width}}{tattenuator}{\ctikzvalof{bipoles/tattenuator/width}}{\ctikzvalof{bipoles/tattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% variable T attenuator +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vtattenuator/width}}{vtattenuator}{\ctikzvalof{bipoles/vtattenuator/width}}{\ctikzvalof{bipoles/vtattenuator/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % draw inner symbol + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfusepath{draw} + + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% phase shifter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{phaseshifter}{\ctikzvalof{bipoles/phaseshifter/width}}{\ctikzvalof{bipoles/phaseshifter/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % inner symbol + \pgftext[center,x=0,y=0]{\Large$\varphi$} +} + +%% variable phase shifter +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{vphaseshifter}{\ctikzvalof{bipoles/vphaseshifter/width}}{\ctikzvalof{bipoles/vphaseshifter/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % rotate inner symbol + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \pgftransformrotate{270} + \fi\fi + \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225 + \pgftransformrotate{180} + \fi\fi + \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 + \pgftransformrotate{90} + \fi\fi + + % inner symbol + \pgftext[center,x=0,y=0]{\Large$\varphi$} + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}} + \pgfusepath{draw} +} + +%% detector +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/detector/width}}{detector}{\ctikzvalof{bipoles/detector/width}}{\ctikzvalof{bipoles/detector/width}}{ + \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen + \divide \pgf@circ@res@step by 2 + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@step + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + \ifpgf@circuit@inputarrow + { + \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth + \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} + } + \fi + + % draw inner stuff + \pgfsetlinewidth{0.8\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}} + \pgfusepath{draw} + + \ifpgf@circuit@fulldiode + \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width}} + \pgftransformscale{\pgfmathresult} + \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}} + \else + \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}} + \pgftransformscale{\pgfmathresult} + \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}} + \fi + +} + + + + +%% european gas filled surge arrester + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{european gas filled surge arrester}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{\ctikzvalof{bipoles/european gas filled surge arrester/width}}{ + + %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen + %\divide \pgf@circ@res@step by 14 + + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfusepath{draw} + + \pgfscope + \pgfsetarrowsend{latex'} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}} + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfusepath{draw} + + \endpgfscope +} + + + + +%% american gas filled surge arrester + +\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{american gas filled surge arrester}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{ + %\def\pgf@circ@temp{right} + %\ifx\tikz@res@label@pos\pgf@circ@temp + % \pgf@circ@res@step=-1.2\pgf@circ@res@up + %\else +% \def\pgf@circ@temp{below} +% \ifx\tikz@res@label@pos\pgf@circ@temp +% \pgf@circ@res@step=-1.2\pgf@circ@res@up +% \else +% \pgf@circ@res@step=1.2\pgf@circ@res@up +% \fi +% \fi + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfscope + \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} + \pgfusepath{draw} + \endpgfscope + + \pgfsetlinewidth{\pgfstartlinewidth} + + + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfnode{circle}{center}{}{}{} + + \pgfscope + \pgfsetarrowsend{latex} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfusepath{draw} + \endpgfscope{} + + %\pgftransformshift{\pgfpoint{.25\pgf@circ@res@left}{.45\pgf@circ@res@down}} + %\pgfnode{circ}{center}{}{}{} + %\pgftransformshift{} + \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf@circ@res@down} + \pgfusepath{fill} +} + + + + + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex index 05926bbcbdb..e559b5e2c5a 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirccurrent.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex @@ -164,7 +164,7 @@ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north} \fi \fi\fi - \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <256 + \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266 \ifpgf@circuit@bipole@current@below \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west} \fi diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex new file mode 100644 index 00000000000..d710fb62d8a --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircinputarrows.tex @@ -0,0 +1,23 @@ +% Copyright 2013 by Stefan Erhardt +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Show input arrows for selected parts + + +\ctikzset{>/.style = { + \circuitikzbasekey/inputarrow = true + } +} + + +\endinput + + + diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex index 120fa7f8cb3..b487023ac91 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirclabel.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex @@ -104,7 +104,7 @@ \fi } coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.north)$) - (labelcoor) node [transform shape, rotate=\pgfcirclabrot] {\pgf@circ@finallabel{}} + (labelcoor) node [rotate=\pgfcirclabrot] {\pgf@circ@finallabel{}} % c'era un transform shape } \def\pgf@circ@drawreglabel{ @@ -128,4 +128,9 @@ } +\ctikzset{text/.style = { t=#1 } } +\ctikzset{t/.code = { + \ctikzsetvalof{bipoles/twoport/text}{#1} +}} + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmath.tex index bcde183dd9a..2cfac94739f 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmath.tex @@ -20,8 +20,8 @@ \pgf@process{#2}% \advance\pgf@x by-\pgf@xa% \advance\pgf@y by-\pgf@ya% - \ifdim\pgf@x<0.0001pt - \ifdim\pgf@x>-0.0001pt % vertical + \ifdim\pgf@x<0.1pt + \ifdim\pgf@x>-0.1pt % vertical \ifdim\pgf@y<0pt \def\pgfmathresult{-90.0} \else diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex index 80de0b7be64..6d5d09aeb50 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmonopoles.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex @@ -75,7 +75,32 @@ \endpgfscope } +} + +\pgfdeclareshape{tground}{ + \anchor{center}{ + \pgfpointorigin + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + %\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } } \pgfdeclareshape{sground}{ @@ -247,10 +272,15 @@ \pgfstartlinewidth=\pgflinewidth \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen - \pgfpathmoveto{\pgfpointorigin} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} - \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} - \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + % \pgfpathmoveto{\pgfpointorigin} + % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}} + % \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} + + \pgftransformxshift{ -4\pgf@circ@res@step } + + \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}} + \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}} \pgfusepath{draw} @@ -370,5 +400,166 @@ } } +% Vcc +\pgfdeclareshape{vcc}{ +\anchor{center}{\pgfpointorigin} +\anchor{text}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}} + \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}} + \pgf@x=0pt + \pgf@y=2\pgf@circ@res@step + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } +\behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope +} + +} + +% Vee +\pgfdeclareshape{vee}{ +\anchor{center}{\pgfpointorigin} +\anchor{text}{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}} + \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}} + \pgf@x=0pt + \pgf@y=-2\pgf@circ@res@step + \advance \pgf@y by -1.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + +\behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfstartlinewidth=\pgflinewidth + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope +} + +} + + +% match +\pgfdeclareshape{match}{ + \anchor{center}{ + \pgfpointorigin + } + \anchor{text}{ + \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen + \pgf@x=1.5\pgf@x + \advance \pgf@x by -.5\wd\pgfnodeparttextbox + \pgf@y=-1.5\ht\pgfnodeparttextbox + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}} + \pgfusepath{fill} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } + +} + +% oscillator +\pgfdeclareshape{oscillator}{ + \anchor{center}{ + \pgfpointorigin + } + \anchor{north}{ + \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@x=-0.5\pgf@x + \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@y=0.5\pgf@y + } + \anchor{south}{ + \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@x=-0.5\pgf@x + \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@y=-0.5\pgf@y + } + \anchor{east}{ + \pgfpointorigin + \pgf@x=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + } + \anchor{west}{ + \pgfpointorigin + } + \anchor{text}{ + \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@x=-2\pgf@x + \advance \pgf@x by -.5\wd\pgfnodeparttextbox + \pgf@y=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \advance \pgf@y by -1.5\ht\pgfnodeparttextbox + } + \behindforegroundpath{ + \pgf@circ@res@step=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen + \pgf@circ@res@step=.5\pgf@circ@res@step + + \pgfscope + \pgfpathmoveto{\pgfpointorigin} + \pgfstartlinewidth=\pgflinewidth + + % draw circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{-\pgf@circ@res@step}{0}} {\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner sine waves + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + + \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{0\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}} + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + + \endpgfscope + } +} \endinput diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex new file mode 100644 index 00000000000..790d997a040 --- /dev/null +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircnpoles.tex @@ -0,0 +1,599 @@ +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/LICENSE for more details. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% N-poles + +\pgfkeys{/tikz/circuitikz,lab/.code={ + + +}} + +\long\def\pgfcircdeclarenpole#1#2#3{ + \pgfdeclareshape{#1} + { + \anchor{center}{ + \northwest + \pgf@x=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x + } + \anchor{A2}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{B1}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{A1}{ + \northwest + } + \anchor{B2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{base}{ + \northwest + \pgf@x=0pt + } + #3 + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + %\pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + + #2 + + } + } +} + + + +\def\pgf@circ@drawtransformerbasicanchor{ + \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height} + \anchor{AA2}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB1}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{AA1}{ + \northwest + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } + \anchor{BB2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x + \pgf@x=.7\pgf@x + \pgf@y=-\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y + } +} + +\def\pgf@circ@drawtransformerbasicbody{ + \def\stretto{.4} + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgftransformlineattime{.5}{% + \pgfpoint% + {\stretto\pgf@circ@res@left}% + {\pgf@circ@res@up}% + }{% + \pgfpoint + {\stretto\pgf@circ@res@left}% + {\pgf@circ@res@down}% + } + + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \else% + \def\pgf@temp{cute} + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \else% + \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} + \fi% + \fi% + + + \endpgfscope + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgftransformlineattime{.5}{% + \pgfpoint% + {\stretto\pgf@circ@res@right}% + {\pgf@circ@res@down}% + }{% + \pgfpoint + {\stretto\pgf@circ@res@right}% + {\pgf@circ@res@up}% + } + + \edef\pgf@circ@temp{\ctikzvalof{inductor}}% + \def\pgf@temp{european}% + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \else% + \def\pgf@temp{cute} + \ifx\pgf@temp\pgf@circ@temp% + \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \else% + \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} + \fi% + \fi% + + \endpgfscope + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}} + + \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}} + + \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfusepath{draw} + +} + + + + % contrib Kristofer M. Monisit + + \pgfdeclareshape{fd op amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out +}{ + \northwest + \pgf@y=.5\pgf@y + \pgf@x=-.7\pgf@x + } + \anchor{out -}{ + \northwest + \pgf@y=-.5\pgf@y + \pgf@x=-.7\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + % Negative input terminal + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} + + + % Positive input terminal + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} + + + % Negative output terminal + \pgfpathmoveto{\pgfpoint + {0.7\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$} + + + % Positive output terminal + \pgfpathmoveto{\pgfpoint + {0.7\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$} + + + % Draw them all! + \pgfusepath{draw} + + % Triangle + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} + \pgfusepath{draw} + \endpgfscope + } + } + + + + +\pgfcircdeclarequadpole{transformer}{ + + \pgf@circ@drawtransformerbasicbody + +}{\pgf@circ@drawtransformerbasicanchor} + +\pgfcircdeclarequadpole{transformer core}{ + + \pgf@circ@drawtransformerbasicbody + + \pgfmoveto{\pgfpoint% + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% + } + \pgflineto{ + \pgfpoint + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% + } + + \pgfmoveto{\pgfpoint% + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}% + } + \pgflineto{ + \pgfpoint + {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}% + {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}% + } + + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth} + \pgfusepath{draw} +}{\pgf@circ@drawtransformerbasicanchor} + + +\pgfcircdeclarequadpole{gyrator}{ + + \def\stretto{.4} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + + \pgfusepath{draw} + + \pgfsetlinewidth{2\pgflinewidth} + \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}} + \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down} + + \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}} + \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down} + \pgfusepath{draw} + +}{} + +%% coupler +% defines a general outer box for couplers +% TikZ usage: +% \draw (0,0) node[coupler](coup){\SI{-3}{dB}} +% (coup.port1) to[short,-o] ++(-1,0) +% + +\long\def\pgfcircdeclarecoupler#1#2{ + \pgfdeclareshape{#1}{ + \anchor{center}{ + \northwest + \pgf@x=0pt + \pgf@y=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{port1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{port2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{port3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{port4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{text}{ + \northwest + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw inner stuff + #2 + + } + } +} + +% straight coupler +\pgfcircdeclarecoupler{coupler}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} +} + +% "bended" coupler +\pgfcircdeclarecoupler{coupler2}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{180}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + +} + diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index 723084851d1..bbe5ce53176 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircquadpoles.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -424,3 +424,172 @@ }{} +%% coupler +% defines a general outer box for couplers +% TikZ usage: +% \draw (0,0) node[coupler](coup){\SI{-3}{dB}} +% (coup.port1) to[short,-o] ++(-1,0) +% + +\long\def\pgfcircdeclarecoupler#1#2{ + \pgfdeclareshape{#1}{ + \anchor{center}{ + \northwest + \pgf@x=0pt + \pgf@y=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{port1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{port2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{port3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{port4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{1}{ + \northwest + \pgf@y=-0.5\pgf@y + } + \anchor{2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{3}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{4}{ + \northwest + \pgf@y=0.5\pgf@y + } + \anchor{text}{ + \northwest + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw inner stuff + #2 + + } + } +} + +% straight coupler +\pgfcircdeclarecoupler{coupler}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}} + \pgfsetarrows{latex-latex} + \pgfusepath{draw} +} + +% "bended" coupler +\pgfcircdeclarecoupler{coupler2}{ + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{180}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + + +} + diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex index 52ee97a00c8..08d90980197 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircshapes.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex @@ -117,4 +117,35 @@ } +%% Current arrow + +\pgfdeclareshape{inputarrow}{ + \savedanchor{\tip}{ + \pgfpointorigin + } + \anchor{center}{ + \tip + } + \anchor{tip}{ + \tip + } + \behindforegroundpath{ + + \pgfscope + \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \divide \pgf@circ@res@step by 16 + + \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}} + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgfusepath{fill} + + \endpgfscope + } + +} + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index f40391c3853..148a1564e49 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcirctripoles.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -11,115 +11,223 @@ %% Tripoles -%\long\def\pgfcircdeclaremixed{ - \pgfdeclareshape{mixer} - { - \savedanchor\northwest{% +\pgfdeclareshape{mixer} +{ + \savedanchor\northwest{ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@y \pgf@y=.5\pgf@y \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x \pgf@x=.5\pgf@x - } - \anchor{left}{% - \northwest - \pgf@y=0pt - } - \anchor{in 1}{ - \northwest - \pgf@y=0pt - } - \anchor{in}{ - \northwest - \pgf@y=0pt - } - \anchor{in 2}{ - \northwest + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in 1}{ + \northwest + \pgf@y=0pt + } + \anchor{in1}{ + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{in 2}{ + \northwest \pgf@y=-\pgf@y \pgf@x=0pt - } - \anchor{out}{ + } + \anchor{in2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{out}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x - } - \anchor{center}{ + } + \anchor{center}{ \pgf@y=0pt \pgf@x=0pt - } - \anchor{east}{ - \northwest + } + \anchor{east}{ + \northwest \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{west}{ - \northwest + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest \pgf@y=0pt - } - \anchor{south}{ + } + \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y - } - \anchor{north}{ + } + \anchor{north}{ \northwest \pgf@x=0pt - } - \anchor{south west}{ + } + \anchor{south west}{ \northwest \pgf@y=-\pgf@y - } - \anchor{north east}{ + } + \anchor{north east}{ \northwest \pgf@x=-\pgf@x - } - \anchor{north west}{ + } + \anchor{north west}{ \northwest - } - \anchor{south east}{ + } + \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y - } - \backgroundpath{ - \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen - \northwest - \pgf@circ@res@up = \pgf@y - \pgf@circ@res@down = -\pgf@y - \pgf@circ@res@right = -\pgf@x - \pgf@circ@res@left = \pgf@x - \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/margin}\pgf@circ@res@up + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + % draw outer circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpointorigin} + \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + } +} + +\pgfdeclareshape{adder} +{ + \savedanchor\northwest{ + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{in 1}{ + \northwest + \pgf@y=0pt + } + \anchor{in1}{ + \northwest + \pgf@y=0pt + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{in 2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{in2}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{center}{ + \pgf@y=0pt + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen \pgfscope - \pgfpathellipse - {\pgfpoint{0pt}{0pt}} - {\pgfpoint{\pgf@circ@res@other}{0pt}} - {\pgfpoint{0pt}{\pgf@circ@res@other}} + \pgfstartlinewidth=\pgflinewidth + + % draw outer circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@other}} - \pgfpathlineto{\pgfpointpolar{-45}{\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}} \pgfpathmoveto{\pgfpointorigin} - \pgfpathmoveto{\pgfpointpolar{45}{\pgf@circ@res@other}} - \pgfpathlineto{\pgfpointpolar{-135}{\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}} + \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}} \pgfsetlinewidth{2\pgflinewidth} \pgfusepath{draw} - \endpgfscope - - \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@other}} - \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{0pt}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@up}{0pt}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{0pt}} - - \pgfusepath{draw} - - } + \endpgfscope } -%} +} @@ -1854,6 +1962,13 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -1891,6 +2006,121 @@ \pgfusepath{draw} } +% N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector +\pgfcircdeclarefet{nigfetebulk}{ %nur ohne strich zwischen Bulk und Source + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@up}} + + % GATE, ENHANCEMENT TYPE (DASHED) + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base height}\pgf@circ@res@down}} + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + % SOURCE + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} %Geändert + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % ARROW + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \pgftransformlineattime{.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + % GATE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + + + % N-CHANNEL IGFET DEPLETION TYPE \pgfcircdeclarefet{nigfetd}{ \anchor{D}{ @@ -1909,13 +2139,13 @@ } \anchor{G}{ \northeast - \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@y \left \pgf@y=-\pgf@circ@res@step } \anchor{gate}{ \northeast - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@y } }{% @@ -1954,6 +2184,14 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -2010,13 +2248,13 @@ } \anchor{G}{ \northeast - \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@y \left \pgf@y=-\pgf@circ@res@step } \anchor{gate}{ \northeast - \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@y } }{% \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} @@ -2071,6 +2309,14 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope + % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -2111,6 +2357,128 @@ \pgfusepath{draw} } +% P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector +\pgfcircdeclarefet{pigfetebulk}{ + \anchor{D}{ + \northeast + } + \anchor{drain}{ + \northeast + } + \anchor{S}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{source}{ + \northeast + \pgf@y=-\pgf@y + } + \anchor{G}{ + \northeast + \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@y + \left + \pgf@y=-\pgf@circ@res@step + } + \anchor{gate}{ + \northeast + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@y + } +}{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + % DRAIN CONNECTION + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@up}} + % DRAIN + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@up}} + \pgfusepath{draw} + + % GATE, DASHED, BOLD + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@up*0.45}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@up*0.25}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@down*0.25}} + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@down*0.45}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base height}\pgf@circ@res@down}} + \pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % BULK + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgf@circ@res@up+\pgf@circ@res@down}} + + % SOURCE + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} + % SOURCE CONNECTION + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@right} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} %Geändert + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % GATE + \pgfscope + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} + %\pgfsetlinewidth{2\pgflinewidth} + \pgfusepath{draw} + \endpgfscope + + % ARROW + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + % Arrow has to be rotated, as this is a p-channel fet + \pgftransformrotate{180} + \pgftransformlineattime{-.6}{% + \pgfpoint + {\pgf@circ@res@right}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + }{% + \pgfpoint% + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/base width}\pgf@circ@res@left}% + {\pgf@circ@res@up+\pgf@circ@res@down}% + } + \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} + \endpgfscope + + % GATE CONNECTION (in line with source) + \pgfpathmoveto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} + %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetebulk/gate height}\pgf@circ@res@down}} + \pgfusepath{draw} +} + + % P-CHANNEL IGFET DEPLETION TYPE \pgfcircdeclarefet{pigfetd}{ \anchor{D}{ @@ -2182,6 +2550,14 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + % GATE \pgfscope \pgfpathmoveto{\pgfpoint @@ -2478,6 +2854,14 @@ %\pgfusepath{draw} %\endpgfscope + + % SOLDER DOT at source-bulk connection + \pgfscope + \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}} + \pgfnode{circ}{center}{}{}{} + \endpgfscope{} + % ARROW \pgfscope \pgfslopedattimetrue @@ -2797,7 +3181,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$} \pgfpathmoveto{\pgfpoint @@ -2806,7 +3190,7 @@ \pgfpathlineto{\pgfpoint {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}} - \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} @@ -2832,8 +3216,134 @@ } } + +%%Transkonduktanzverstärker +\pgfdeclareshape{gm amp} + { + \anchor{center}{\pgfpointorigin} + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{south}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + } + \savedanchor\left{% + \pgf@y=0pt + } + \savedanchor\inOne{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{-}{ + \inOne + } + \anchor{+}{ + \inOne + \pgf@y=-\pgf@y + } + \savedanchor\up{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x + \pgf@x=.5\pgf@x + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + \pgfpointlineattime{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{ + \pgfpoint{ + \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} + {\pgf@circ@res@up}} + {\pgfpoint{.7\pgf@circ@res@right}{0pt}} + } + \anchor{up}{ + \up + } + \anchor{down}{ + \up + \pgf@y=-\pgf@y + } + \anchor{out}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \left + } + \anchor{east}{ + \left + \pgf@x=-\pgf@x + } + + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\ $-$} + \pgfpathmoveto{\pgfpoint + {\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left} + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}} + \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\ $+$} + + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} % + + \pgfusepath{draw} + + \pgfscope + \pgfsetlinewidth{2\pgflinewidth} + \pgftransformxshift{.7\pgf@circ@res@left} + \pgf@circ@res@step=\pgf@circ@res@right + \advance\pgf@circ@res@step by -\pgf@circ@res@left + \pgf@circ@res@step=.7\pgf@circ@res@step + %Umrandung: + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}} %geändert startpunkt neu am ausgangsstrich + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{15pt}}%vom Ausgang nach oben + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-15pt}}%ecke links unten nach rechts unten + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} %rechts unten zum ausgang + \pgfusepath{draw} + \endpgfscope + + + + } + } + %% Potentiometer @@ -2910,5 +3420,220 @@ } +\pgfdeclareshape{circulator} +{ + \savedanchor\northwest{ + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@x + \pgf@x=.5\pgf@x + } + \anchor{center}{ + \pgfpointorigin + } + \anchor{left}{% + \northwest + \pgf@y=0pt + } + \anchor{1}{ + \northwest + \pgf@y=0pt + } + \anchor{2}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{3}{ + \northwest + \pgf@y=-\pgf@y + \pgf@x=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen + + \pgfscope + \pgfstartlinewidth=\pgflinewidth + + % draw outer circle + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} + \pgfusepath{draw} + + % inner arrow + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfsetarrowsend{latex} + \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}} + \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step} + \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}} + \pgfusepath{draw} + \endpgfscope + } +} + + +% Wilkinson divider +\pgfdeclareshape{wilkinson}{ + \anchor{center}{ + \northwest + \pgf@x=0pt + \pgf@y=0pt + } + \savedanchor\northwest{% + \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@y + \pgf@y=.5\pgf@y + \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} + \pgf@x=.5\pgf@x + \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x + } + \anchor{north}{ + \northwest + \pgf@x=0pt + } + \anchor{south}{ + \northwest + \pgf@x=0pt + \pgf@y=-\pgf@y + } + \anchor{west}{ + \northwest + \pgf@y=0pt + } + \anchor{east}{ + \northwest + \pgf@y=0pt + \pgf@x=-\pgf@x + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } + \anchor{north east}{ + \northwest + \pgf@x=-\pgf@x + } + \anchor{north west}{ + \northwest + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{in}{ + \northwest + \pgf@y=0pt + } + \anchor{out1}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-0.5\pgf@y + } + \anchor{out2}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=0.5\pgf@y + } + \anchor{text}{ + \northwest + \advance \pgf@y by 0.5\ht\pgfnodeparttextbox + \pgf@x=-.5\wd\pgfnodeparttextbox + } + \backgroundpath{ + \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} + + \northwest + \pgf@circ@res@up = \pgf@y + \pgf@circ@res@down = -\pgf@y + \pgf@circ@res@right = -\pgf@x + \pgf@circ@res@left = \pgf@x + + \pgfstartlinewidth=\pgflinewidth + + % draw outer box + \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth} + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + + % draw inner stuff + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + + \pgfusepath{draw} + + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + % draw inner resisitor - european or american style is recognised + { + \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}} + \pgftransformrotate{90} + + % calculate size of resistor + \ifpgf@circuit@europeanresistor + \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2} + \pgftransformscale{\pgfmathresult} + \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}} + \else + \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2} + \pgftransformscale{\pgfmathresult} + \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}} + \fi + } + + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}} + + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}} + \pgfusepath{draw} + + } +} + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex index 9ac9ade73d6..dc7e3f703f8 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircutils.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex @@ -25,7 +25,7 @@ \def\pgf@circ@handleSI#1{ \noexpandarg - \def\pgf@temp{} + \def\pgf@temp{} \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit] \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len] @@ -36,8 +36,10 @@ \pgf@circ@siunitx@restrue \noexpandarg \StrBefore{#1}{<}[\pgf@circ@handleSI@val] + %\typeout{si |#1|} }{ \pgf@circ@siunitx@resfalse + %\typeout{no si |#1|} } \fi } diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex index c453a5d6c3d..97e6259df39 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircvoltage.sty +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex @@ -208,7 +208,7 @@ \else\def\pgf@circ@bipole@voltage@label@anchor{north} \fi \fi\fi - \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <256 + \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266 \ifpgf@circuit@bipole@voltage@below \def\pgf@circ@bipole@voltage@label@anchor{south east} \else\def\pgf@circ@bipole@voltage@label@anchor{north west} @@ -269,17 +269,17 @@ \endinput - coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.-110) $) - coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.-70) $) - \else - coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.110) $) - coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! - \ctikzvalof{voltage/bump b} ! - (\ctikzvalof{bipole/name}.70) $) - \fi +% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.-110) $) +% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.-70) $) +% \else +% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.110) $) +% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! +% \ctikzvalof{voltage/bump b} ! +% (\ctikzvalof{bipole/name}.70) $) +% \fi diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty index 0a66adeb372..6565fb9668e 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty @@ -17,23 +17,23 @@ \NeedsTeXFormat{LaTeX2e} -\def\pgfcircversion{0.3.0} +\def\pgfcircversion{0.4} \ProvidesPackage{circuitikz}% - [2012/12/29 The CircuiTikz circuit drawing package version \pgfcircversion] + [2015/05/15 The CircuiTikz circuit drawing package version \pgfcircversion] %% Version 2.0 of pgf/TikZ is required \RequirePackage{tikz} \usetikzlibrary{calc} -\usepgflibrary{decorations.pathmorphing,arrows} +\usepgflibrary{arrows} \DeclareOption{european}{ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european} - \ctikzset{resistor=european} \ctikzset{logic ports=european} + \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester = european} } \DeclareOption{american}{ - \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} + \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester = american} \ctikzset{logic ports = american} } @@ -93,6 +93,14 @@ \ctikzset{logic ports = european} } +\DeclareOption{americangfsurgearrester}{ + \ctikzset{gas filled surge arrester = american} +} + +\DeclareOption{europeangfsurgearrester}{ + \ctikzset{gas filled surge arrester = european} +} + \DeclareOption{siunitx}{ \pgf@circ@siunitxtrue @@ -123,8 +131,6 @@ } -%%%%%%%%% Compatibility - \DeclareOption{fulldiode}{ \ctikzset{diode = full} @@ -186,6 +192,69 @@ \ctikzset{logic ports = european} } +\DeclareOption{compatibility}{ + \pgf@circuit@compattrue +} + +\DeclareOption{betterproportions}{ + \ctikzset{monopoles/ground/width/.initial=.15} + + \ctikzset{bipoles/resistor/height/.initial=.23} + \ctikzset{bipoles/resistor/width/.initial=.6} + \ctikzset{bipoles/capacitor/height/.initial=.4} + \ctikzset{bipoles/capacitor/width/.initial=.1} + \ctikzset{bipoles/potentiometer/height/.initial=.6} + \ctikzset{bipoles/potentiometer/height 2/.initial=.23} + \ctikzset{bipoles/potentiometer/width/.initial=.6} + \ctikzset{bipoles/photoresistor/height/.initial=.6} + \ctikzset{bipoles/photoresistor/height 2/.initial=.23} + \ctikzset{bipoles/photoresistor/width/.initial=.6} + \ctikzset{bipoles/thermistor/main/.initial=.7} + \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/thermistor/width/.initial=.6} + \ctikzset{bipoles/thermistorntc/width/.initial=.6} + \ctikzset{bipoles/thermistorntc/main/.initial=.7} + \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7 + \ctikzset{bipoles/thermistorptc/width/.initial=.6} + \ctikzset{bipoles/thermistorptc/main/.initial=.7} + \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/varistor/main/.initial=.7} + \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7 + \ctikzset{bipoles/varistor/width/.initial=.6} + \ctikzset{bipoles/vresistor/height/.initial=.45} + \ctikzset{bipoles/vresistor/width/.initial=.6} + \ctikzset{bipoles/generic/height/.initial=.23} + \ctikzset{bipoles/generic/width/.initial=.6} + \ctikzset{bipoles/generic potentiometer/height/.initial=.6} + \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23} + \ctikzset{bipoles/generic potentiometer/width/.initial=.6} + \ctikzset{bipoles/ageneric/height/.initial=.23} + \ctikzset{bipoles/ageneric/width/.initial=.6} + \ctikzset{bipoles/memristor/height/.initial=.23} + \ctikzset{bipoles/memristor/wave height/.initial=.375} + \ctikzset{bipoles/memristor/width/.initial=.60} + \ctikzset{bipoles/tgeneric/height/.initial=.525} + \ctikzset{bipoles/tgeneric/width/.initial=.6} + \ctikzset{bipoles/tfullgeneric/height/.initial=.525} + \ctikzset{bipoles/tfullgeneric/width/.initial=.60} + \ctikzset{bipoles/fullgeneric/height/.initial=.23} + \ctikzset{bipoles/fullgeneric/width/.initial=.6} + \ctikzset{bipoles/diode/height/.initial=.3} + \ctikzset{bipoles/diode/width/.initial=.25} + + \ctikzset{tripoles/thyristor/height/.initial=.66} + \ctikzset{tripoles/thyristor/height 2/.initial=.3} + \ctikzset{tripoles/thyristor/width/.initial=.6} + \ctikzset{tripoles/thyristor/diode height/.initial=.3} + \ctikzset{tripoles/thyristor/diode width left/.initial=.4} + \ctikzset{tripoles/thyristor/diode width right/.initial=.3} + + \ctikzset{tripoles/triac/height/.initial=.66} + \ctikzset{tripoles/triac/width/.initial=.6} + \ctikzset{tripoles/triac/diode width left/.initial=.3} + \ctikzset{tripoles/triac/diode width right/.initial=.3} +} %%%%%%%%% @@ -193,7 +262,10 @@ \input circuitikz.code.tex -\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,nosiunitx,noarrowmos,smartlabels} +% Latex specific +\ctikzset{tripoles/op amp/font/.initial=\scriptsize} + +\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility} \ProcessOptions\relax @@ -205,8 +277,11 @@ \input circuitikz1.code.tex -\newenvironment{circuitikz}{ -\begin{tikzpicture}}{\end{tikzpicture}} +\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}} +%override (unused) circuitikz environment for compability to externalization) +\let\circuitikz\tikzpicture +\let\endcircuitikz\endtikzpicture + \endinput diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex b/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex deleted file mode 100644 index 4118b2bd9de..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz1.code.tex +++ /dev/null @@ -1,479 +0,0 @@ -%%%%%%%%%%%% -%% Dimensions - -% coordinate bipoli -\newdimen\pgf@circ@res@up \newdimen\pgf@circ@res@down \newdimen\pgf@circ@res@zero -\newdimen\pgf@circ@res@left \newdimen\pgf@circ@res@right -\newdimen\pgf@circ@res@other -\newdimen\pgf@circ@res@step - -% thickness iniziale -\newdimen \pgfstartlinewidth - -\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} - - - -% Names -\ctikzset{name/.style = { n=#1 } } -\ctikzset{n/.code = { - \pgfkeys{/tikz/circuitikz/bipole/name=#1} -}} - -% Reflect the node along -\ctikzset{mirrored/.is choice} -\ctikzset{mirror value/.initial=1} -\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} } -\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} } -\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}} - -% Initialize paths -\def\pgfcircresetpath{ - \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, - bipole/reversed=false, bipole/kind=, - bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below, - bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false, - bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after, - bipole/current/y position=above, bipole/current/direction=forward, - mirrored=false - } -} - - -%% Generic bipole path -\def\pgf@circ@bipole@path#1#2{ - \pgfextra{ - \ctikzset{bipole/kind = #1} - - \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} - \def\pgf@circ@temp{} - \ifx\pgf@temp\pgf@circ@temp % if it has not a name - \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} - \ctikzset{bipole/name = #2\pgf@circ@rand} % create it - \fi - - \def\pgf@temp{open} - \def\pgf@circ@temp{#1} - } - \ifpgf@circuit@bipole@reversed - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} - \else - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} - \fi - \pgfextra{ - \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} - {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} - \edef\pgf@circ@direction{\pgfmathresult} - } - ($(\tikztostart) ! .5 ! (\tikztotarget)$) - node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}] - (\ctikzvalof{bipole/name}) {} - \ifx\pgf@temp\pgf@circ@temp % if it is an open - \else - (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) - (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) - \fi - \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabel\fi - \drawpoles - \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi - \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi - % reset - \pgfextra{ - \pgfcircresetpath - } - (\tikztotarget) \tikztonodes % e si continua -} - - -%% Path definitions - -\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi} -\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi} -\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi} -\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}} -\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}} -\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}} -\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}} -\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}} -\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}} -\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}} -\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}} -\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}} -\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} -\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}} -\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}} -\def\pgf@circ@inductor@path#1{% - \pgfextra{ - \edef\pgf@circ@temp{\ctikzvalof{inductor}}% - \def\pgf@temp{european}% - } - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@europeaninductor@path{#1}% - \else% - \pgfextra{ \def\pgf@temp{cute} }% - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@cuteinductor@path{#1}% - \else% - \pgf@circ@americaninductor@path{#1}% - \fi% - \fi% -} -\def\pgf@circ@vinductor@path#1{ - \pgfextra{ - \edef\pgf@circ@temp{\ctikzvalof{inductor}}% - \def\pgf@temp{european}% - } - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@veuropeaninductor@path{#1}% - \else% - \pgfextra{ \def\pgf@temp{cute} }% - \ifx\pgf@temp\pgf@circ@temp% - \pgf@circ@vcuteinductor@path{#1}% - \else% - \pgf@circ@vamericaninductor@path{#1}% - \fi% - \fi% -} -\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} -\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}} -\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}} -\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}} -\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}} -\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}} -\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}} -\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}} -\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}} -\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}} -\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}} -\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}} -\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}} -\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}} -\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}} -\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}} -\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}} -\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}} -\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}} -\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}} -\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}} -\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}} -\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}} -\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}} -\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}} -\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}} -\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}} -\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}} -\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}} -\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}} -\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}} -\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}} -\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}} -\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}} -\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}} -\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}} -\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}} -\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}} -\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}} -\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}} -\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}} -\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}} -\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}} -\def\pgf@circ@empty@path#1{} -\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}} -\def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}} -\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}} -\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}} -\def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}} -\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}} -\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}} -\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}} -\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}} -\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}} -\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}} -%% Styles - -%% Aggiungere per thyristor e tripoli semplici - -%\def\ctikzsetbipole#1#2{% -% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}% -%} -%\ctikzsetbipole{resistor}{\pgf@circ@resistor@path} - -\tikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}} -\tikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}} -\tikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}} -\tikzset{ammeter/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path, l=#1}} -\tikzset{voltmeter/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path, l=#1}} -\tikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}} -\tikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}} -\tikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}} -\tikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}} -\tikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}} -\tikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}} -\tikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}} -\tikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}} -\tikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}} -\tikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}} -\tikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}} -\tikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}} -\tikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}} -\tikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}} -\tikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}} -\tikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}} -\tikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}} -\tikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}} -\tikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}} -\tikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}} -\tikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}} -\tikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}} -\tikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}} -\tikzset{transmission line/.style = {tline = #1}} -\tikzset{TL/.style = {tline = #1}} -\tikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} -\tikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }} -\tikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}} - -\tikzset{voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}} -\tikzset{controlled voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}} -\tikzset{controlled current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}} - - -\tikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}} -\tikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}} -\tikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}} -\tikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}} -\tikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}} -\tikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}} -\tikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}} - -\tikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}} - -\tikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}} -\tikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}} -\tikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}} -\tikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}} -\tikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}} - - - -\tikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}} -\tikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}} -\tikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}} -\tikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}} -\tikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}} -\tikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}} -\tikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}} - -\tikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}} -\tikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}} -\tikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}} -\tikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}} -\tikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}} -\tikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}} -\tikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}} - - \tikzset{Schottky diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}} - \tikzset{Zener diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Zener diode}} - \tikzset{tunnel diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}} - \tikzset{photodiode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi photodiode}} - \tikzset{led/.style = {\ifpgf@circuit@fulldiode full \else empty \fi led}} - \tikzset{varcap/.style = {\ifpgf@circuit@fulldiode full \else empty \fi varcap}} - \tikzset{diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi diode}} - -\tikzset{thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thyristor@path}} -\tikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}} -\tikzset{triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@triac@path}} - -\tikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}} -\tikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}} -\tikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}} -\tikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}} - -\tikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}} -\tikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}} - -% short forms -\tikzset{vsource/.style = {voltage source = #1}} -\tikzset{isource/.style = {current source = #1}} -\tikzset{cisource/.style = {controlled current source = #1}} -\tikzset{cvsource/.style = {controlled voltage source = #1}} -\tikzset{vsourcesin/.style = {sinusoidal voltage source = #1}} -\tikzset{vsourcesquare/.style = {square voltage source = #1}} -\tikzset{isourcesin/.style = {sinusoidal current source = #1}} -\tikzset{cisourcesin/.style = {controlled sinusoidal current source = #1}} -\tikzset{cvsourcesin/.style = {controlled sinusoidal voltage source = #1}} - -\tikzset{controlled vsource/.style = {controlled voltage source = #1}} -\tikzset{controlled isource/.style = {controlled current source = #1}} -\tikzset{controlled vsourcesin/.style = {controlled sinusoidal voltage source = #1}} -\tikzset{controlled isourcesin/.style = {controlled sinusoidal current source = #1}} - -\tikzset{R/.style= {resistor = #1}} -\tikzset{vR/.style= {variable resistor = #1}} -\tikzset{phR/.style= {photoresistor = #1}} -\tikzset{thR/.style= {thermistor = #1}} -\tikzset{thRp/.style= {thermistor ptc= #1}} -\tikzset{thRn/.style= {thermistor ntc= #1}} -\tikzset{pR/.style= {potentiometer = #1}} -\tikzset{C/.style = {capacitor = #1}} -\tikzset{pC/.style = {polar capacitor = #1}} -\tikzset{vC/.style = {variable capacitor = #1}} -\tikzset{L/.style = {inductor = #1}} -\tikzset{vL/.style = {variable inductor = #1}} -\tikzset{V/.style = {voltage source = #1}} -\tikzset{cV/.style = {controlled voltage source = #1}} -\tikzset{sV/.style = {sinusoidal voltage source = #1}} -\tikzset{sqV/.style = {square voltage source = #1}} -\tikzset{csV/.style = {controlled sinusoidal voltage source = #1}} -\def\pgf@temp#1{ - \tikzset{V#1/.style = {voltage source, v#1=##1} } - \tikzset{cV#1/.style = {controlled voltage source, v#1=##1} } - \tikzset{sV#1/.style = {sinusoidal voltage source, v#1=##1} } - \tikzset{csV#1/.style = {controlled sinusoidal voltage source, v#1=##1} } -} -\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} -\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} -\tikzset{I/.style = {current source = #1}} -\tikzset{cI/.style = {controlled current source = #1}} -\tikzset{sI/.style = {sinusoidal current source = #1}} -\tikzset{csI/.style = {controlled sinusoidal current source = #1}} -\def\pgf@temp#1{ - \tikzset{I#1/.style = {current source, i#1=##1} } - \tikzset{cI#1/.style = {controlled current source, i#1=##1} } - \tikzset{sI#1/.style = {sinusoidal current source, i#1=##1} } - \tikzset{csI#1/.style = {controlled sinusoidal current source, i#1=##1} } -} -\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} -\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^} -\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} -\tikzset{Do/.style = {empty diode}} -\tikzset{tDo/.style = {empty tunnel diode}} -\tikzset{zDo/.style = {empty Zener diode}} -\tikzset{sDo/.style = {empty Schottky diode}} -\tikzset{pDo/.style = {empty photodiode}} -\tikzset{leDo/.style = {empty led}} -\tikzset{VCo/.style = {empty varcap}} -\tikzset{D*/.style = {full diode}} -\tikzset{tD*/.style = {full tunnel diode}} -\tikzset{zD*/.style = {full Zener diode}} -\tikzset{sD*/.style = {full Schottky diode}} -\tikzset{pD*/.style = {full photodiode}} -\tikzset{leD*/.style = {full led}} -\tikzset{VC*/.style = {full varcap}} -\tikzset{D/.style = {diode}} -\tikzset{tD/.style = {tunnel diode}} -\tikzset{zD/.style = {Zener diode}} -\tikzset{sD/.style = {Schottky diode}} -\tikzset{pD/.style = {photodiode}} -\tikzset{leD/.style = {led}} -\tikzset{VC/.style = {varcap}} - -\tikzset{Tr/.style = {triac}} -\tikzset{Mr/.style = {memristor}} -\tikzset{Ty/.style = {thyristor}} - -\tikzset{cspst/.style = {closing switch = #1}} -\tikzset{ospst/.style = {opening switch = #1}} - -\tikzset{afuse/.style = {asymmetric fuse=#1}} - - -\def\inheritlogicport#1#2{ - \pgfdeclareshape{#2 port}{ - \inheritsavedanchors[from=#1 #2 port] - \inheritbackgroundpath[from=#1 #2 port] - \inheritanchor[from=#1 #2 port]{in} - \inheritanchor[from=#1 #2 port]{in 1} - \inheritanchor[from=#1 #2 port]{in 2} - \inheritanchor[from=#1 #2 port]{out} - \inheritanchor[from=#1 #2 port]{center} - \inheritanchor[from=#1 #2 port]{left} - } -} - -\ifpgf@circuit@europeanlogicport - \inheritlogicport{european}{and} - \inheritlogicport{european}{or} - \inheritlogicport{european}{xor} - \inheritlogicport{european}{not} - \inheritlogicport{european}{nand} - \inheritlogicport{european}{nor} - \inheritlogicport{european}{xnor} -\else - \inheritlogicport{american}{and} - \inheritlogicport{american}{or} - \inheritlogicport{american}{xor} - \inheritlogicport{american}{not} - \inheritlogicport{american}{nand} - \inheritlogicport{american}{nor} - \inheritlogicport{american}{xnor} -\fi - -% Transistor like bipoles - -\def\pgf@circ@trans@path#1#2{ - \pgfextra{ - \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}} - \def\pgf@circ@temp{#2} - \ifx\pgf@temp\pgf@circ@temp % if it has not a name - \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999} - \ctikzset{bipole/name = trans\pgf@circ@rand} % create it - \fi - } - \ifpgf@circuit@bipole@reversed - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {} - \else - (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {} - (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {} - \fi - \pgfextra{ - \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}} - {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}} - \pgfmathadd{\pgfmathresult}{-90} - \edef\pgf@circ@direction{\pgfmathresult} - } - ($(\tikztostart) ! .5 ! (\tikztotarget)$) - node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}] - (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}} - (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left) - (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center) - \pgfextra{ - \pgfcircresetpath - } - (\tikztotarget) \tikztonodes % e si continua -} - - -\def\pgf@circ@definetranspath#1{ - \tikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}} -} - -\pgf@circ@definetranspath{nmos} -\pgf@circ@definetranspath{pmos} -\pgf@circ@definetranspath{npn} -\pgf@circ@definetranspath{pnp} -\pgf@circ@definetranspath{nfet} -\pgf@circ@definetranspath{nigfete} -\pgf@circ@definetranspath{nigfetd} -\pgf@circ@definetranspath{pfet} -\pgf@circ@definetranspath{pigfete} -\pgf@circ@definetranspath{pigfetd} -\pgf@circ@definetranspath{njfet} -\pgf@circ@definetranspath{pjfet} -\pgf@circ@definetranspath{pigbt} -\pgf@circ@definetranspath{nigbt} diff --git a/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex b/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex deleted file mode 100644 index 0af74491c15..00000000000 --- a/Master/texmf-dist/tex/latex/circuitikz/t-circuitikz.tex +++ /dev/null @@ -1,102 +0,0 @@ -\def\pgfcircversion{0.2.3} -\writestatus{loading}{2009/11/18 The CircuiTikz circuit drawing package version \pgfcircversion} -\startmodule[circuitikz] - -\usemodule[tikz] -\usepgflibrary[decorations.pathmorphing] -\usetikzlibrary[calc] - -\unprotect - -\input circuitikz.code.tex - -% defaults - -\setupmodule[current=european, voltage=european, resistor=american, inductor=cute, logic=american, siunitx=true, arrowmos=false] - -\processaction[\currentmoduleparameter{voltage}] - [ european=>\ctikzset{voltage=european}, - american=>\ctikzset{voltage=american} - ] - -\processaction[\currentmoduleparameter{current}] - [ european=>\ctikzset{ current=european}, - american=>\ctikzset{ current=american} - ] - -\processaction[\currentmoduleparameter{label}] - [ - straight=>\ctikzset{label/align = straight} - align=>\ctikzset{label/align = rotate} - smart=>\ctikzset{label/align = smart} - ] - -\processaction[\currentmoduleparameter{resistor}] - [ european=>\ctikzset{ resistor=european}, - american=>\ctikzset{ resistor=american} - ] - -\processaction[\currentmoduleparameter{inductor}] - [ european=>\ctikzset{ inductor=european}, - american=>\ctikzset{ inductor=american}, - cute=>\ctikzset{ inductor=cute} - ] - -\processaction[\currentmoduleparameter{diode}] - [ full=>\ctikzset{ diode=full}, - empty=>\ctikzset{ diode=empty} - ] - -\processaction[\currentmoduleparameter{logic}] - [ european=>\ctikzset{ logic ports=european}, - american=>\ctikzset{ logic ports=american} - ] - -\processaction[\currentmoduleparameter{siunitx}] - [ true=>\def\SI#1#2{#1\,#2} - \def\ampere{\rm{A}} - \def\volt{\rm{V}} - \def\ohm{\Omega} - \def\siemens{\rm{S}} - \def\farad{\rm{F}} - \def\henry{\rm{H}} - \def\second{\rm{s}} - \def\coulomb{\rm{C}} - \def\siemens{\rm{S}} - \def\radians{\rm{rad}} - \def\milli{\rm{m}} - \def\micro{\mu} - \def\nano{\rm{n}} - \def\pico{\rm{p}} - \def\kilo{\rm{k}} - \def\mega{\rm{M}} - \def\giga{\rm{G}} - \def\tera{\rm{T}}, - false=>%, -% \s!default=>\pgf@circ@siunitxtrue - ] - -\processaction[\currentmoduleparameter{arrowmos}] - [ true=>\pgf@circuit@mos@arrowstrue, - false=>\pgf@circuit@mos@arrowsfalse%, -% \s!default=>\pgf@circuit@mos@arrowstrue - ] - - -\ifpgf@circ@siunitx - % nothing! siunitx and xstrings don't work in context -\fi - - -\input circuitikz1.code.tex - - -% define the environment -\long\def\startcircuitikz#1\stopcircuitikz{\starttikzpicture#1\stoptikzpicture} - -\protect - -\stopmodule - - -\endinput |