diff options
author | Karl Berry <karl@freefriends.org> | 2022-12-11 21:34:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-12-11 21:34:32 +0000 |
commit | 2c7b0bb96d88d7d2b6676c8a3b760d3165c6cc6c (patch) | |
tree | cdb12d025bf5ce0da99448112c35d13391cfca0b /Master/texmf-dist/tex | |
parent | 7cd2f8ab760d1e3271c094ac5b725796dac52267 (diff) |
circuitikz (11dec22)
git-svn-id: svn://tug.org/texlive/trunk@65240 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
7 files changed, 824 insertions, 1789 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 index 5743b9cfe3c..fa84215e52a 100644 --- a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex +++ b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex @@ -10,8 +10,8 @@ % % See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details. -\def\pgfcircversion{1.5.5} -\def\pgfcircversiondate{2022/11/12} +\def\pgfcircversion{1.6.0} +\def\pgfcircversiondate{2022/12/10} \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion} \usemodule[tikz] diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index 5575b33a96f..c80c4ba02eb 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -801,6 +801,8 @@ % % Option "t=*" for nodes \pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}} +\pgfkeys{/tikz/t1/.add code={}{\ctikzset{text in=#1}}} +\pgfkeys{/tikz/t2/.add code={}{\ctikzset{text out=#1}}} % \ctikzset{bipole/.is family} \ctikzset{bipole/kind/.initial=} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index 7cf950c887c..c6677c331f5 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -284,7 +284,11 @@ } %% Generic empty tunable \pgfcircdeclarebipolescaled{resistors} -{} +{ + \anchor{wiper}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} + \anchor{W}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} + \anchor{tip}{\northeast\pgf@x=0.5\pgf@x} +} {\ctikzvalof{bipoles/tgeneric/height}} {tgeneric} {\ctikzvalof{bipoles/tgeneric/height}} @@ -396,6 +400,9 @@ \pgf@y=1.2\pgf@y }% \pgfcirc@border@extend@updown{1}{1.2} + \anchor{wiper}{\northeast\pgf@x=-\pgf@x\pgf@y=-1.2\pgf@y} + \anchor{W}{\northeast\pgf@x=-\pgf@x\pgf@y=-1.2\pgf@y} + \anchor{tip}{\northeast} } {\ctikzvalof{bipoles/thermistor/height}} {thermistor} @@ -510,6 +517,7 @@ } \anchor{wiper}{\wiper} \anchor{W}{\wiper} + \anchor{tip}{\wiper\pgf@xa=\pgf@x\southwest\pgf@x=\pgf@xa\pgf@y=-\pgf@y} } {\ctikzvalof{bipoles/generic potentiometer/height 2}} {genericpotentiometer} @@ -632,6 +640,9 @@ \pgfcircdeclarebipolescaled{resistors} { \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} +\anchor{wiper}{\northeast\pgf@x=-0.4\pgf@x\pgf@y=-\pgf@y} +\anchor{W}{\northeast\pgf@x=-0.4\pgf@x\pgf@y=-\pgf@y} +\anchor{tip}{\northeast\pgf@x=0.4\pgf@x} } {\ctikzvalof{bipoles/vresistor/height}} {vresistor} @@ -647,11 +658,11 @@ \pgf@circ@set@relative@thickness{modifier thickness} \pgfcirc@set@arrows{tunable}{}{latexslim} \ifpgf@circ@fixtunable@dir - \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} \else - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@right}{\pgf@circ@res@down}} \fi \pgfusepath{draw} \endpgfscope @@ -670,6 +681,7 @@ \anchor{wiper}{\wiper} \anchor{W}{\wiper} \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} + \anchor{tip}{\wiper\pgf@xa=\pgf@x\southwest\pgf@x=\pgf@xa\pgf@y=-\pgf@y} } {\ctikzvalof{bipoles/potentiometer/height 2}} {potentiometer} @@ -697,6 +709,9 @@ {% anchor for labelling the type of dependency \anchor{label}{\southwest\pgf@x=0.4\pgf@x}% \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} + \anchor{wiper}{\northeast\pgf@x=-0.9\pgf@x\pgf@y=-\pgf@y} + \anchor{W}{\northeast\pgf@x=-0.9\pgf@x\pgf@y=-\pgf@y} + \anchor{tip}{\northeast\pgf@x=0.4\pgf@x} } {\ctikzvalof{bipoles/resistivesens/height}} {resistivesens} @@ -710,9 +725,9 @@ \pgfscope \pgf@circ@set@relative@thickness{modifier thickness} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} \endpgfscope }% @@ -909,6 +924,9 @@ { \anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}% \pgfcirc@border@extend@full{2.6}{1}{4.4}{1.2} + \anchor{wiper}{\northeast\pgf@x=-4.4\pgf@x\pgf@y=-1.2\pgf@y} + \anchor{W}{\northeast\pgf@x=-4.4\pgf@x\pgf@y=-1.2\pgf@y} + \anchor{tip}{\northeast\pgf@x=2.6\pgf@x} } {\ctikzvalof{bipoles/capacitor/height}} {capacitivesens} @@ -1037,7 +1055,16 @@ %% Variable Capacitor \pgfcircdeclarebipolescaled{capacitors} -{} +{ + \saveddimen{\tunablewidth}{% + \pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/vcapacitor/tunable width}* + \ctikzvalof{bipoles/vcapacitor/width}*0.5* + \ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} + } + \anchor{wiper}{\northeast\pgf@x=-\tunablewidth\pgf@y=-\pgf@y} + \anchor{W}{\northeast\pgf@x=-\tunablewidth\pgf@y=-\pgf@y} + \anchor{tip}{\northeast\pgf@x=\tunablewidth} +} {\ctikzvalof{bipoles/vcapacitor/height}} {vcapacitor} {\ctikzvalof{bipoles/vcapacitor/height}} @@ -1366,6 +1393,9 @@ \anchor{midtap}{\midtap} \pgfcirc@border@extend@full{1}{2}{1.6}{2.6} \pgfcir@basic@core@anchors + \anchor{wiper}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} + \anchor{W}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} + \anchor{tip}{\northeast\pgf@x=0.8\pgf@x\pgf@y=2\pgf@y} } {\ctikzvalof{bipoles/cuteinductor/lower coil height}} {scuteinductor} @@ -1476,6 +1506,9 @@ \anchor{core west}{% \northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance\pgf@x=-\pgf@x } + \anchor{wiper}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} + \anchor{W}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} + \anchor{tip}{\northeast\pgf@x=0.4\pgf@x} } {\ctikzvalof{bipoles/vcuteinductor/lower coil height}} {vcuteinductor} @@ -1567,6 +1600,9 @@ \anchor{midtap}{\midtap} \pgfcirc@border@extend@full{1}{2}{1.6}{2.6} \pgfcir@basic@core@anchors + \anchor{wiper}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} + \anchor{W}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} + \anchor{tip}{\northeast\pgf@x=0.8\pgf@x\pgf@y=2\pgf@y} } {\ctikzvalof{bipoles/americaninductor/height 2}} {samericaninductor} @@ -1618,6 +1654,9 @@ \anchor{core west}{% \northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance\pgf@x=-\pgf@x } + \anchor{wiper}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} + \anchor{W}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} + \anchor{tip}{\northeast\pgf@x=0.4\pgf@x} } {\ctikzvalof{bipoles/vamericaninductor/height 2}} {vamericaninductor} @@ -1675,6 +1714,9 @@ \anchor{midtap}{\northeast\pgf@x=0pt\relax} \pgfcirc@border@extend@full{1}{2}{1}{2} \pgfcir@basic@core@anchors + \anchor{wiper}{\northeast\pgf@x=-\pgf@x\pgf@y=-2\pgf@y} + \anchor{W}{\northeast\pgf@x=-\pgf@x\pgf@y=-2\pgf@y} + \anchor{tip}{\northeast\pgf@y=2\pgf@y} } {\ctikzvalof{bipoles/fullgeneric/height}} {sfullgeneric} @@ -1706,6 +1748,9 @@ \anchor{core west}{% \northeast\pgf@y=0.4\pgf@y\advance\pgf@y by \coredistance\pgf@x=-\pgf@x } + \anchor{wiper}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} + \anchor{W}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} + \anchor{tip}{\northeast\pgf@x=0.5\pgf@x} } {\ctikzvalof{bipoles/tfullgeneric/height}} {tfullgeneric} @@ -6509,8 +6554,6 @@ \ctikzset{bipoles/lamp/width/.initial=.60} \ctikzset{bipoles/bulb/height/.initial=.8} \ctikzset{bipoles/bulb/width/.initial=.8} -\ctikzset{bipoles/tline/height/.initial=.3} -\ctikzset{bipoles/tline/width/.initial=.6} \ctikzset{bipoles/squid/height/.initial=.60} \ctikzset{bipoles/squid/width/.initial=.60} \ctikzset{bipoles/barrier/height/.initial=.60} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex index 4c267929b5f..96ecfd5adcd 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex @@ -410,6 +410,8 @@ %>>> %% Node shapes for RF bipoles%<<< +\ctikzset{bipoles/tline/height/.initial=.3} +\ctikzset{bipoles/tline/width/.initial=.6} \pgfcircdeclarebipolescaled{RF} {} @@ -418,7 +420,7 @@ {\ctikzvalof{bipoles/tline/height}} {\ctikzvalof{bipoles/tline/width}} { - \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis + \pgf@circ@res@step=.4\pgf@circ@res@up % the size of the ellipsis is proportional to the height \pgfscope \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}} diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index b34df68a014..568caa1f64a 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -517,6 +517,7 @@ \ctikzset{bipoles/twoport/height/.initial=.7} \ctikzset{bipoles/twoport/text/.initial=} \ctikzset{bipoles/twoportsplit/width/.initial=.7} +\ctikzset{bipoles/twoportsplit/height/.initial=.7} \ctikzset{bipoles/twoport/text in/.initial=} \ctikzset{bipoles/twoport/text out/.initial=} \ctikzset{text/.style={t=#1}} @@ -563,6 +564,9 @@ \ctikzset{tripoles/splitter/height/.initial=1.3} \ctikzset{tripoles/splitter/width/.initial=1.3} +\ctikzset{tripoles/genericsplitter/height/.initial=1.3} +\ctikzset{tripoles/genericsplitter/width/.initial=1.3} + \ctikzset{tripoles/mzm/height/.initial=1.3} \ctikzset{tripoles/mzm/width/.initial=1.3} @@ -590,7 +594,12 @@ \newif\ifpgf@circuit@dashed \pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}} \ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}% - +% Also draw internal things dashed +\newif\ifpgf@circuit@full@dashed +\ctikzset{inner blocks dashed/.is if=pgf@circuit@full@dashed}% +% Default block dash +\ctikzset{dashed blocks pattern/.initial={{0.1cm}{0.1cm}}} +% % powerelectronic blocks \ctikzset{bipoles/sacdc/width/.initial=.7} \ctikzset{bipoles/sdcac/width/.initial=.7} @@ -621,1231 +630,429 @@ }% \fi } +%%% blocks additional anchors +\def\pgcirc@twoport@additional@anchors{% + \anchor{right down}{\northeast\pgf@y=-0.5\pgf@y} + \anchor{left down}{\northeast\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y} + \anchor{left up}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y} + \anchor{right up}{\northeast\pgf@y=0.5\pgf@y} + \anchor{up}{\northeast\pgf@x=0pt\relax} + \anchor{down}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt\relax} +} + +%%% definition to help define the blocks. Notice that the height, width, etc are different, so we can't +%%% simplify more... +\def\pfgcirc@twoport@get@symbol@rotation{ + %%% put the needed rotation in \@@rotation + \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} + \def\@@rotation{0} + \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 + \def\@@rotation{270} + \fi\fi + \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 + \def\@@rotation{180} + \fi\fi + \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315 + \def\@@rotation{90} + \fi\fi +} +% +\def\pfgcirc@twoport@rotate@inner@symbol{% + % rotate inner symbol + \pfgcirc@twoport@get@symbol@rotation + \pgftransformrotate{\@@rotation} +} +% enact dashing if needed +\def\pgfcirc@twoport@maybedash{% + \ifpgf@circuit@dashed + \edef\@@tmp{\ctikzvalof{dashed blocks pattern}} + \expandafter\pgfsetdash\expandafter{\@@tmp}{0cm} + \fi +} +% debug +\def\@@printrot{% + \pgfsetcolor{red} + \pgftext[center,x=0,y=0,]{\tiny\ttfamily\pgf@circ@direction > \@@rotation} +} +% +\def\pgfcirc@twoport@setup#1{% + \pgf@circ@res@step = #1\pgf@circ@scaled@Rlen%6 is the real width parameter + \divide \pgf@circ@res@step by 2 + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} + % let set the dash for the next operations + \pgfcirc@twoport@maybedash +} +% +\def\pgfcirc@twoport@draw@sine#1#2{% #1 -> y shift; #2 -> crossed out if != 0 + % draw inner sine waves; ...res@step must be defined + \pgfscope + \pgfsetlinewidth{\pgfstartlinewidth} + \pgftransformyshift{#1\pgf@circ@res@step} + \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}} + \ifnum #2=0\else + \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}} + \fi + \pgfusepath{draw} + \endpgfscope +} +% +\def\pgfcirc@twoport@draw@splitline{% + \pgfscope + \pgfcirc@twoport@maybedash + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} + \endpgfscope +} +% +\long\def\pgfcirc@define@twoports#1#2#3#4#5#6#7{ +\pgfcircdeclarebipolescaled{#1} + { + \pgcirc@twoport@additional@anchors + #2 + } + {#3} + {#4} + {#5} + {#6} + { + \pgfcirc@twoport@setup{#6} + % draw outer box + \pgf@circ@twoportbox + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi + \pgf@circ@inputarrow + \pfgcirc@twoport@rotate@inner@symbol + #7 + } +} +% +\long\def\pgfcirc@define@twoports@norotate#1#2#3#4#5#6#7{ +\pgfcircdeclarebipolescaled{#1} + { + \pgcirc@twoport@additional@anchors + #2 + } + {#3} + {#4} + {#5} + {#6} + { + \pgfcirc@twoport@setup{#6} + % draw outer box + \pgf@circ@twoportbox + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi + \pgf@circ@inputarrow + #7 + } +} %% Generic two port box -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/twoport/height}} {twoport} {\ctikzvalof{bipoles/twoport/height}} {\ctikzvalof{bipoles/twoport/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@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 - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 \pgf@circ@text@strokecolor \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}} } - %% twoport split -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} -{\ctikzvalof{bipoles/twoportsplit/width}} +{\ctikzvalof{bipoles/twoportsplit/height}} {twoportsplit} -{\ctikzvalof{bipoles/twoportsplit/width}} +{\ctikzvalof{bipoles/twoportsplit/height}} {\ctikzvalof{bipoles/twoportsplit/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/twoportsplit/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow %get texts \def\pgfcirc@tin{\ctikzvalof{bipoles/twoport/text in}} \def\pgfcirc@tout{\ctikzvalof{bipoles/twoport/text out}} - - % rotate inner symbol - \def\texti{\pgfcirc@tin} - \def\textii{\pgfcirc@tout} - \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} - \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135 - \def\texti{\pgfcirc@tout} - \def\textii{\pgfcirc@tin} - \pgftransformrotate{270} - \fi\fi - \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible - \def\texti{\pgfcirc@tout} - \def\textii{\pgfcirc@tin} - \pgftransformrotate{180} - \fi\fi - \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 - \pgftransformrotate{90} - \def\texti{\pgfcirc@tin} - \def\textii{\pgfcirc@tout} - \fi\fi - - % draw inner symbol - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - + % shuffle text depending on rotation + \pgfcirc@twoport@draw@splitline + % \pgf@circ@text@strokecolor - \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\texti} - \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textii} -} - -%% voltage controled oscillator -\pgfcircdeclarebipolescaled{blocks} -{} -{\ctikzvalof{bipoles/vco/width}} -{vco} -{\ctikzvalof{bipoles/twoport/width}} -{\ctikzvalof{bipoles/vco/width}} -{ - \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - % draw circle - \pgfscope - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step} - \pgf@circ@draworfill - \endpgfscope - \ifpgf@circuit@inputarrow - { - \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth - \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} - } + \ifnum\@@rotation<145 + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\pgfcirc@tin} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\pgfcirc@tout} + \else + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\pgfcirc@tout} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\pgfcirc@tin} \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 -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/bandpass/width}} {bandpass} {\ctikzvalof{bipoles/bandpass/width}} {\ctikzvalof{bipoles/bandpass/width}} { - - \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows - \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} + \pgfcirc@twoport@draw@sine{0.5}{1} + \pgfcirc@twoport@draw@sine{0.0}{0} + \pgfcirc@twoport@draw@sine{-0.5}{1} } - %% bandstop filter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/bandstop/width}} {bandstop} {\ctikzvalof{bipoles/bandstop/width}} {\ctikzvalof{bipoles/bandstop/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-}%never draw arrows - \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} + \pgfcirc@twoport@draw@sine{0.5}{0} + \pgfcirc@twoport@draw@sine{0.0}{1} + \pgfcirc@twoport@draw@sine{-0.5}{0} } - %% highpass filter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/highpass/width}} {highpass} {\ctikzvalof{bipoles/highpass/width}} {\ctikzvalof{bipoles/highpass/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows - \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} + \pgfcirc@twoport@draw@sine{0.5}{0} + \pgfcirc@twoport@draw@sine{0.0}{1} + \pgfcirc@twoport@draw@sine{-0.5}{1} } - %% highpass2 filter ---simplyfied with just two waves -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/highpass2/width}} {highpass2} {\ctikzvalof{bipoles/highpass2/width}} {\ctikzvalof{bipoles/highpass2/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/highpass2/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.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}} - \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.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}} - \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.3\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@step}{-0.1\pgf@circ@res@step}} - \pgfusepath{draw} + \pgfcirc@twoport@draw@sine{0.25}{0} + \pgfcirc@twoport@draw@sine{-0.25}{1} } - %% lowpass filter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/lowpass/width}} {lowpass} {\ctikzvalof{bipoles/lowpass/width}} {\ctikzvalof{bipoles/lowpass/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows - \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} + \pgfcirc@twoport@draw@sine{0.5}{1} + \pgfcirc@twoport@draw@sine{0.0}{1} + \pgfcirc@twoport@draw@sine{-0.5}{0} } - %% lowpass2 filter: simplyfied with just two waves -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/lowpass2/width}} {lowpass2} {\ctikzvalof{bipoles/lowpass2/width}} {\ctikzvalof{bipoles/lowpass2/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass2/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.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}} - \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.3\pgf@circ@res@step}{0.1\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@step}{0.5\pgf@circ@res@step}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.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}} - \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} + \pgfcirc@twoport@draw@sine{0.25}{1} + \pgfcirc@twoport@draw@sine{-0.25}{0} } - %% allpass filter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/allpass/width}} {allpass} {\ctikzvalof{bipoles/allpass/width}} {\ctikzvalof{bipoles/allpass/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/allpass/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows - \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.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} + \pgfcirc@twoport@draw@sine{0.5}{0} + \pgfcirc@twoport@draw@sine{0.0}{0} + \pgfcirc@twoport@draw@sine{-0.5}{0} } - %% ADC -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/adc/width}} {adc} {\ctikzvalof{bipoles/adc/width}} {\ctikzvalof{bipoles/adc/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - + \pgfcirc@twoport@draw@splitline + % \pgf@circ@text@strokecolor - \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}} + \ifnum\@@rotation<145 + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{A} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{D} + \else + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{D} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{A} + \fi } %% DAC -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/dac/width}} {dac} {\ctikzvalof{bipoles/dac/width}} {\ctikzvalof{bipoles/dac/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - + \pgfcirc@twoport@draw@splitline + % \pgf@circ@text@strokecolor - \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}} + \ifnum\@@rotation<145 + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{D} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{A} + \else + \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{A} + \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{D} + \fi } %% DSP -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/dsp/width}} {dsp} {\ctikzvalof{bipoles/dsp/width}} {\ctikzvalof{bipoles/dsp/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 \pgf@circ@text@strokecolor \pgftext[center,x=0,y=0]{\textsf{DSP}} } - %% FFT -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/fft/width}} {fft} {\ctikzvalof{bipoles/fft/width}} {\ctikzvalof{bipoles/fft/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 \pgf@circ@text@strokecolor \pgftext[center,x=0,y=0]{\textsf{FFT}} } - -%% Amplifier -\pgfcircdeclarebipolescaled{blocks} -{} -{ - \ifpgf@circuit@boxed - \ctikzvalof{bipoles/twoport/width} - \else - \ctikzvalof{bipoles/amp/width} - \fi -} -{amp} -{ - \ifpgf@circuit@boxed - \ctikzvalof{bipoles/twoport/width} - \else - \ctikzvalof{bipoles/amp/width} - \fi -} -{ - \ifpgf@circuit@boxed - \ctikzvalof{bipoles/twoport/width} - \else - \ctikzvalof{bipoles/amp/width} - \fi -} -{ - \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \ifpgf@circuit@boxed - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}} - \pgf@circ@draworfill - \fi - - % draw input arrow - \ifpgf@circuit@inputarrow - { - \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth - \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} - } - \fi - - \ifpgf@circuit@boxed - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn - \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box - \else - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \fi - - \pgfsetarrows{-} %never draw arrows - - \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}} - \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}} - - \pgfpathclose - \pgf@circ@draworfill - - % draw inner text - \pgf@circ@text@strokecolor - \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} -} - - -%% variable amplifier -\pgfcircdeclarebipolescaled{blocks} -{} -{ - \ifpgf@circuit@boxed - \ctikzvalof{bipoles/twoport/width} - \else - \ctikzvalof{bipoles/amp/width} - \fi -} -{vamp} -{ - \ifpgf@circuit@boxed - \ctikzvalof{bipoles/twoport/width} - \else - \ctikzvalof{bipoles/amp/width} - \fi -} -{ - \ifpgf@circuit@boxed - \ctikzvalof{bipoles/twoport/width} - \else - \ctikzvalof{bipoles/amp/width} - \fi -} -{ - \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@scaled@Rlen - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \ifpgf@circuit@boxed - \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}} - \fi - - % draw input arrow - \ifpgf@circuit@inputarrow - { - \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth - \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} - \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}} - } - \fi - - \ifpgf@circuit@boxed - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn - \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box - \else - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \fi - - - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - - \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}} - \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}} - - \pgfpathclose - \pgf@circ@draworfill - - - % draw arrow - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsend{latex} - \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}} - \pgfusepath{draw} - % draw inner text - \pgf@circ@text@strokecolor - \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} -} - %% pi attenuator -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/piattenuator/width}} {piattenuator} {\ctikzvalof{bipoles/piattenuator/width}} {\ctikzvalof{bipoles/piattenuator/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows \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 -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/vpiattenuator/width}} {vpiattenuator} {\ctikzvalof{bipoles/vpiattenuator/width}} {\ctikzvalof{bipoles/vpiattenuator/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows \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} + \pgfcirc@set@arrows{tunable}{}{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 -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/tattenuator/width}} {tattenuator} {\ctikzvalof{bipoles/tattenuator/width}} {\ctikzvalof{bipoles/tattenuator/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows \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 -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/vtattenuator/width}} {vtattenuator} {\ctikzvalof{bipoles/vtattenuator/width}} {\ctikzvalof{bipoles/vtattenuator/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - \pgfsetarrows{-} %never draw arrows \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} + \pgfcirc@set@arrows{tunable}{}{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 -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/phaseshifter/width}} {phaseshifter} {\ctikzvalof{bipoles/phaseshifter/width}} {\ctikzvalof{bipoles/phaseshifter/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 \pgf@circ@text@strokecolor \pgftext[center,x=0,y=0]{\Large$\varphi$} } - %% variable phase shifter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} {} {\ctikzvalof{bipoles/phaseshifter/width}} {vphaseshifter} {\ctikzvalof{bipoles/vphaseshifter/width}} {\ctikzvalof{bipoles/vphaseshifter/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 - - \pgfsetdash{}{0pt} % always draw solid line for inner symbol \pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsend{latex} + \pgfcirc@set@arrows{tunable}{}{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} % inner symbol \pgf@circ@text@strokecolor \pgftext[center,x=0,y=0]{\Large$\varphi$} - } %% detector -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports@norotate{blocks} {} {\ctikzvalof{bipoles/detector/width}} {detector} {\ctikzvalof{bipoles/detector/width}} {\ctikzvalof{bipoles/detector/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow % draw inner stuff - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows \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@scaled@Rlen / \ctikzvalof{bipoles/generic/width}} \pgftransformscale{\pgfmathresult} @@ -1855,414 +1062,360 @@ \pgftransformscale{\pgfmathresult} \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}} \fi - } +%% converters help function +\def\pgf@circ@twoport@converter@dc#1#2{% + \pgfscope + \pgftransformshift{\pgfpoint{#1\pgf@circ@res@step}{#2\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0.125\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@step}{0.125\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{-0.125\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@step}{-0.125\pgf@circ@res@step}} + \pgfusepath{draw} + \endpgfscope +} +\def\pgf@circ@twoport@converter@dc@up{% + \pgf@circ@twoport@converter@dc{-0.5}{0.5} +} +\def\pgf@circ@twoport@converter@dc@down{% + \pgf@circ@twoport@converter@dc{0.5}{-0.5} +} +\def\pgf@circ@twoport@converter@ac#1#2{% + \pgfscope + \pgftransformshift{\pgfpoint{#1\pgf@circ@res@step}{#2\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-.31\pgf@circ@res@step}{0\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} + \pgfusepath{draw} + \endpgfscope +} +\def\pgf@circ@twoport@converter@ac@up{% + \pgf@circ@twoport@converter@ac{-0.45}{0.5} + } +\def\pgf@circ@twoport@converter@ac@down{% + \pgf@circ@twoport@converter@ac{0.45}{-0.5} +} +\def\pgf@circ@twoport@converter@tac@up{% + \pgf@circ@twoport@converter@ac{-0.45}{0.65} + \pgf@circ@twoport@converter@ac{-0.45}{0.5} + \pgf@circ@twoport@converter@ac{-0.45}{0.35} +} +\def\pgf@circ@twoport@converter@tac@down{% + \pgf@circ@twoport@converter@ac{0.45}{-0.65} + \pgf@circ@twoport@converter@ac{0.45}{-0.5} + \pgf@circ@twoport@converter@ac{0.45}{-0.35} +} %% single phase ac/dc converter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} { - \anchor{dc1}{ - \northeast - \pgf@y=.4\pgf@y - } - \anchor{dc2}{ - \northeast - \pgf@y=-.4\pgf@y - } + % these two are left for backward compatibiliyt + \anchor{dc1}{\northeast\pgf@y=.4\pgf@y} + \anchor{dc2}{\northeast\pgf@y=-.4\pgf@y} + % better + \anchor{ac up in}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{ac down in}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc up out}{\northeast\pgf@y=.4\pgf@y} + \anchor{dc down out}{\northeast\pgf@y=-.4\pgf@y} } {\ctikzvalof{bipoles/sacdc/width}} {sacdc} {\ctikzvalof{bipoles/sacdc/width}} {\ctikzvalof{bipoles/sacdc/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/sacdc/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \pgfcirc@twoport@draw@splitline + \ifnum\@@rotation<145 % swap dc/ac for "backward" and "up" symbol + \pgf@circ@twoport@converter@ac@up + \pgf@circ@twoport@converter@dc@down + \else + \pgf@circ@twoport@converter@dc@up + \pgf@circ@twoport@converter@ac@down \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 > 225 \ifnum \pgfcircmathresult < 315 - \pgftransformrotate{90} - \fi\fi - - % draw inner symbol - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - % draw sin wave - \pgfpathmoveto{\pgfpoint{-.76\pgf@circ@res@step}{.5\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - - % draw equal sign - \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.375\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.375\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.625\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.625\pgf@circ@res@step}} - \pgfusepath{draw} } - - %% dc/dc converter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} { - \anchor{dc1}{ - \northeast - \pgf@y=.4\pgf@y - \pgf@x=-\pgf@x - } - \anchor{dc2}{ - \northeast - \pgf@y=-.4\pgf@y - \pgf@x=-\pgf@x - } + % these two are left for backward compatibiliyt + \anchor{dc1}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc2}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + % better + \anchor{dc up in}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc down in}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc up out}{\northeast\pgf@y=.4\pgf@y} + \anchor{dc down out}{\northeast\pgf@y=-.4\pgf@y} } {\ctikzvalof{bipoles/sdcdc/width}} {sdcdc} {\ctikzvalof{bipoles/sdcdc/width}} {\ctikzvalof{bipoles/sdcdc/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/sdcdc/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 > 225 \ifnum \pgfcircmathresult < 315 - \pgftransformrotate{90} - \fi\fi - - % draw inner symbol - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - % draw equal sign - \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.375\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.375\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.625\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.625\pgf@circ@res@step}} - \pgfusepath{draw} - - % draw equal sign - \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.375\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.375\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.625\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.625\pgf@circ@res@step}} - \pgfusepath{draw} + \pgfcirc@twoport@draw@splitline + % No need to switch here + \pgf@circ@twoport@converter@dc@up + \pgf@circ@twoport@converter@dc@down } - - %% single phase dc/ac converter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} { - \anchor{dc1}{ - \northeast - \pgf@y=.4\pgf@y - \pgf@x=-\pgf@x - } - \anchor{dc2}{ - \northeast - \pgf@y=-.4\pgf@y - \pgf@x=-\pgf@x - } + % these two are left for backward compatibiliyt + \anchor{dc1}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc2}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + % better + \anchor{dc up in}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc down in}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + \anchor{ac up out}{\northeast\pgf@y=.4\pgf@y} + \anchor{ac down out}{\northeast\pgf@y=-.4\pgf@y} } {\ctikzvalof{bipoles/sdcac/width}} {sdcac} {\ctikzvalof{bipoles/sdcac/width}} {\ctikzvalof{bipoles/sdcac/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/sdcac/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \pgfcirc@twoport@draw@splitline + \ifnum\@@rotation<145 % swap dc/ac for "backward" and "up" symbol + \pgf@circ@twoport@converter@dc@up + \pgf@circ@twoport@converter@ac@down + \else + \pgf@circ@twoport@converter@ac@up + \pgf@circ@twoport@converter@dc@down \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 > 225 \ifnum \pgfcircmathresult < 315 - \pgftransformrotate{90} - \fi\fi - - % draw inner symbol - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - % draw sin wave - \pgfpathmoveto{\pgfpoint{.14\pgf@circ@res@step}{-.5\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - - % draw equal sign - \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.375\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.375\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.625\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.625\pgf@circ@res@step}} - \pgfusepath{draw} } - - +%% single phase ac/ac converter +\pgfcirc@define@twoports{blocks} +{ + \anchor{ac up in}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{ac down in}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + \anchor{ac up out}{\northeast\pgf@y=.4\pgf@y} + \anchor{ac down out}{\northeast\pgf@y=-.4\pgf@y} +} +{\ctikzvalof{bipoles/sdcac/width}} +{sacac} +{\ctikzvalof{bipoles/sdcac/width}} +{\ctikzvalof{bipoles/sdcac/width}} +{ + \pgfcirc@twoport@draw@splitline + \pgf@circ@twoport@converter@ac@up + \pgf@circ@twoport@converter@ac@down +} %% threephase ac/dc converter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} { - \anchor{dc1}{ - \northeast - \pgf@y=.4\pgf@y - } - \anchor{dc2}{ - \northeast - \pgf@y=-.4\pgf@y - } - \anchor{ac1}{ - \northeast - \pgf@y=.6\pgf@y - \pgf@x=-\pgf@x - } - \anchor{ac2}{ - \northeast - \pgf@y=0\pgf@y - \pgf@x=-\pgf@x - } - \anchor{ac3}{ - \northeast - \pgf@y=-.6\pgf@y - \pgf@x=-\pgf@x - } + % legacy, let for compatibility + \anchor{dc1}{\northeast\pgf@y=.4\pgf@y} + \anchor{dc2}{\northeast\pgf@y=-.4\pgf@y} + \anchor{ac1}{\northeast\pgf@y=.6\pgf@y\pgf@x=-\pgf@x} + \anchor{ac2}{\northeast\pgf@y=0\pgf@y\pgf@x=-\pgf@x} + \anchor{ac3}{\northeast\pgf@y=-.6\pgf@y\pgf@x=-\pgf@x} + %better + \anchor{dc up out}{\northeast\pgf@y=.4\pgf@y} + \anchor{dc down out}{\northeast\pgf@y=-.4\pgf@y} + \anchor{ac up in}{\northeast\pgf@y=.6\pgf@y\pgf@x=-\pgf@x} + \anchor{ac mid in}{\northeast\pgf@y=0\pgf@y\pgf@x=-\pgf@x} + \anchor{ac down in}{\northeast\pgf@y=-.6\pgf@y\pgf@x=-\pgf@x} } {\ctikzvalof{bipoles/tacdc/width}} {tacdc} {\ctikzvalof{bipoles/tacdc/width}} {\ctikzvalof{bipoles/tacdc/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/tacdc/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \pgfcirc@twoport@draw@splitline + \ifnum\@@rotation<145 % swap dc/ac for "backward" and "up" symbol + \pgf@circ@twoport@converter@tac@up + \pgf@circ@twoport@converter@dc@down + \else + \pgf@circ@twoport@converter@dc@up + \pgf@circ@twoport@converter@tac@down \fi - - % draw outer box - \pgf@circ@twoportbox - \pgf@circ@inputarrow - % 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 > 225 \ifnum \pgfcircmathresult < 315 - \pgftransformrotate{90} - \fi\fi - - % draw inner symbol - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - % draw sin waves - \pgfpathmoveto{\pgfpoint{-.76\pgf@circ@res@step}{.65\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{-.76\pgf@circ@res@step}{.5\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{-.76\pgf@circ@res@step}{.35\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - - - - - % draw equal sign - \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.375\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.375\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.625\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.625\pgf@circ@res@step}} - \pgfusepath{draw} } - - %% threephase dc/ac converter -\pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports{blocks} { - \anchor{dc1}{ - \northeast - \pgf@y=.4\pgf@y - \pgf@x=-\pgf@x - } - \anchor{dc2}{ - \northeast - \pgf@y=-.4\pgf@y - \pgf@x=-\pgf@x - } - \anchor{ac1}{ - \northeast - \pgf@y=.6\pgf@y - } - \anchor{ac2}{ - \northeast - \pgf@y=0\pgf@y - } - \anchor{ac3}{ - \northeast - \pgf@y=-.6\pgf@y - } + % legacy, let for compatibility + \anchor{dc1}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc2}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + \anchor{ac1}{\northeast\pgf@y=.6\pgf@y} + \anchor{ac2}{\northeast\pgf@y=0\pgf@y} + \anchor{ac3}{\northeast\pgf@y=-.6\pgf@y} + %better + \anchor{dc up in}{\northeast\pgf@y=.4\pgf@y\pgf@x=-\pgf@x} + \anchor{dc down in}{\northeast\pgf@y=-.4\pgf@y\pgf@x=-\pgf@x} + \anchor{ac up out}{\northeast\pgf@y=.6\pgf@y} + \anchor{ac mid out}{\northeast\pgf@y=0\pgf@y} + \anchor{ac down out}{\northeast\pgf@y=-.6\pgf@y} } {\ctikzvalof{bipoles/tdcac/width}} {tdcac} {\ctikzvalof{bipoles/tdcac/width}} {\ctikzvalof{bipoles/tdcac/width}} { - \pgf@circ@res@step = \ctikzvalof{bipoles/tdcac/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} + \pgfcirc@twoport@draw@splitline + \ifnum\@@rotation<145 % swap dc/ac for "backward" and "up" symbol + \pgf@circ@twoport@converter@dc@up + \pgf@circ@twoport@converter@tac@down + \else + \pgf@circ@twoport@converter@tac@up + \pgf@circ@twoport@converter@dc@down \fi - +} +%% threephase ac/ac converter +\pgfcirc@define@twoports{blocks} +{ + \anchor{ac up in}{\northeast\pgf@y=.6\pgf@y\pgf@x=-\pgf@x} + \anchor{ac mid in}{\northeast\pgf@y=0\pgf@y\pgf@x=-\pgf@x} + \anchor{ac down in}{\northeast\pgf@y=-.6\pgf@y\pgf@x=-\pgf@x} + \anchor{ac up out}{\northeast\pgf@y=.6\pgf@y} + \anchor{ac mid out}{\northeast\pgf@y=0\pgf@y} + \anchor{ac down out}{\northeast\pgf@y=-.6\pgf@y} +} +{\ctikzvalof{bipoles/tdcac/width}} +{tacac} +{\ctikzvalof{bipoles/tdcac/width}} +{\ctikzvalof{bipoles/tdcac/width}} +{ + \pgfcirc@twoport@draw@splitline + \pgf@circ@twoport@converter@tac@down + \pgf@circ@twoport@converter@tac@up +} +%%%% Non-square blocks. We do not use the standard macros +%%%% this one is adapted to do the boxed thing +% +\long\def\pgfcirc@define@twoports@boxed#1#2#3#4#5#6#7{ +\pgfcircdeclarebipolescaled{#1} + { + \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}} + \pgcirc@twoport@additional@anchors + #2 + } + {#3} + {#4} + {#5} + {#6} + { + \pgf@circ@res@step=#6\pgf@circ@scaled@Rlen %6 is the real width parameter + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} + \pgfcirc@twoport@maybedash % draw outer box - \pgf@circ@twoportbox + \ifpgf@circuit@boxed + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}} + \pgf@circ@draworfill + \fi \pgf@circ@inputarrow - % 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 + \ifpgf@circuit@boxed + \pgfsetlinewidth{\pgfstartlinewidth} + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi + \pgf@circ@res@step=.7\pgf@circ@res@step % scale amp symbol when inside a box + \else + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \fi + #7 + } +} +%% voltage controled oscillator +\pgfcirc@define@twoports@boxed{blocks} +{} +{\ctikzvalof{bipoles/vco/width}} +{vco} +{\ctikzvalof{bipoles/twoport/width}} +{\ctikzvalof{bipoles/vco/width}} +{ + % ok, this is a bit of incoherence + \divide \pgf@circ@res@step by 2 + % draw circle + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step} + \pgf@circ@draworfill + \endpgfscope + \pfgcirc@twoport@rotate@inner@symbol + \pgfcirc@twoport@draw@sine{0}{0} +} +%% amplifier and vamplifier +%% Amplifier %% Beware, not using the generic twoport(s) macros. +\pgfcirc@define@twoports@boxed{blocks} +{ + \anchor{up}{% + \northeast\pgf@x=0pt\relax + \ifnum\componentisboxed=0 + \pgf@y=0.55\pgf@y + \fi + } + \anchor{down}{% + \northeast\pgf@x=0pt\pgf@y=-\pgf@y\relax + \ifnum\componentisboxed=0 + \pgf@y=0.55\pgf@y + \fi + } +} +{\ifpgf@circuit@boxed\ctikzvalof{bipoles/twoport/width}\else\ctikzvalof{bipoles/amp/width}\fi} +{amp} +{\ifpgf@circuit@boxed\ctikzvalof{bipoles/twoport/width}\else\ctikzvalof{bipoles/amp/width}\fi} +{\ifpgf@circuit@boxed\ctikzvalof{bipoles/twoport/width}\else\ctikzvalof{bipoles/amp/width}\fi} +{ + % draw triangle + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}} + \pgfpathclose + \pgf@circ@draworfill + \pfgcirc@twoport@get@symbol@rotation + % draw inner text + \pgf@circ@text@strokecolor + \ifnum\@@rotation=180 \pgftransformrotate{180} - \fi\fi - \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315 - \pgftransformrotate{90} - \fi\fi - - % draw inner symbol - \pgfsetdash{}{0pt} % always draw solid line for inner symbol - \pgfsetarrows{-} %never draw arrows + \pgftext[center,x=0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} + \else + \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} + \fi +} +%% variable amplifier %% Beware, not using the generic twoport(s) macros. +% \pgfcircdeclarebipolescaled{blocks} +\pgfcirc@define@twoports@boxed{blocks} +{ + \anchor{up}{% + \northeast\pgf@x=0pt\relax + \ifnum\componentisboxed=0 + \pgf@y=0.55\pgf@y + \fi + } + \anchor{down}{% + \northeast\pgf@x=0pt\pgf@y=-\pgf@y\relax + \ifnum\componentisboxed=0 + \pgf@y=0.55\pgf@y + \fi + } +} +{\ifpgf@circuit@boxed\ctikzvalof{bipoles/twoport/width}\else\ctikzvalof{bipoles/amp/width}\fi} +{vamp} +{\ifpgf@circuit@boxed\ctikzvalof{bipoles/twoport/width}\else\ctikzvalof{bipoles/amp/width}\fi} +{\ifpgf@circuit@boxed\ctikzvalof{bipoles/twoport/width}\else\ctikzvalof{bipoles/amp/width}\fi} +{ + % draw triangle + \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0}} + \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.55\pgf@circ@res@step}} + \pgfpathclose + \pgf@circ@draworfill + \pfgcirc@twoport@get@symbol@rotation + % draw arrow \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfusepath{draw} - - % draw sin waves - \pgfpathmoveto{\pgfpoint{.14\pgf@circ@res@step}{-.65\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.14\pgf@circ@res@step}{-.5\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{.14\pgf@circ@res@step}{-.35\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} - \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} - \pgfusepath{draw} - - - - - % draw equal sign - \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.375\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.375\pgf@circ@res@step}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.625\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.625\pgf@circ@res@step}} + \pgfcirc@set@arrows{tunable}{}{latex} + \pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}} \pgfusepath{draw} + % draw inner text + \pgf@circ@text@strokecolor + \ifnum\@@rotation=180 + \pgftransformrotate{180} + \pgftext[center,x=0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} + \else + \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}} + \fi } % %>>> @@ -2294,8 +1447,10 @@ \pgfcirc@activate@bipole@simple{l}{sacdc} \pgfcirc@activate@bipole@simple{l}{sdcac} \pgfcirc@activate@bipole@simple{l}{sdcdc} +\pgfcirc@activate@bipole@simple{l}{sacac} \pgfcirc@activate@bipole@simple{l}{tacdc} \pgfcirc@activate@bipole@simple{l}{tdcac} +\pgfcirc@activate@bipole@simple{l}{tacac} % %>>> %% Node shapes for Block elements %<<< @@ -2344,6 +1499,13 @@ \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{left down}{\northwest\pgf@y=-0.5\pgf@y} + \anchor{right down}{\northwest\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y} + \anchor{right up}{\northwest\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y} + \anchor{left up}{\northwest\pgf@y=0.5\pgf@y} + \anchor{text}{\northwest + \advance\pgf@y\dimexpr-.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox\relax + \pgf@x=-.5\wd\pgfnodeparttextbox\relax} } % draw the body rectangle and circle if and when needed \def\pgf@circ@circular@rf@box@circle{% @@ -2355,7 +1517,8 @@ % draw outer circle \ifpgf@circuit@boxed \pgf@circ@res@step=.7\pgf@circ@res@step - \pgfsetdash{}{0pt} % draw solid circle if boxed + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi \else \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \fi @@ -2380,7 +1543,8 @@ \pgfscope \pgf@circ@circular@rf@box@circle % draw inner stuff - \pgfsetdash{}{0pt} % always draw solid line for inner symbol + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpointorigin} \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}} @@ -2408,7 +1572,8 @@ \pgfscope \pgf@circ@circular@rf@box@circle % draw inner stuff - \pgfsetdash{}{0pt} % always draw solid line for inner symbol + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi \pgfsetlinewidth{\pgfstartlinewidth} \pgfpathmoveto{\pgfpointorigin} \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}} @@ -2443,7 +1608,8 @@ \pgfscope \pgf@circ@circular@rf@box@circle % draw inner sine waves - \pgfsetdash{}{0pt} % always draw solid line for inner symbol + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi \pgfsetlinewidth{\pgfstartlinewidth} \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners! \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}} @@ -2471,7 +1637,8 @@ \pgfscope \pgf@circ@circular@rf@box@circle % inner arrow - \pgfsetdash{}{0pt} % always draw solid line for inner symbol + % draw solid line for inner symbol if no box is drawn and not fully dashed + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi \pgfsetlinewidth{\pgfstartlinewidth} \pgfsetarrowsend{latex} \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}} @@ -2494,63 +1661,16 @@ \pgf@x=-\ctikzvalof{quadpoles/gridnode/width}\pgf@circ@scaled@Rlen \pgf@x=.5\pgf@x } - \anchor{center}{ - \pgfpointorigin - } - - \anchor{north}{ - \northwest - \pgf@x=0pt - } - \anchor{up}{ - \northwest - \pgf@x=0pt - } - \anchor{south}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{down}{ - \northwest - \pgf@x=0pt - \pgf@y=-\pgf@y - } - \anchor{east}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{right}{ - \northwest - \pgf@y=0pt - \pgf@x=-\pgf@x - } - \anchor{west}{ - \northwest - \pgf@y=0pt - } - \anchor{left}{ - \northwest - \pgf@y=0pt - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } - \anchor{north east}{ - \northwest - \pgf@x=-\pgf@x - \relax - } - \anchor{north west}{ - \northwest - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } + \pgfcirc@northwest@symmetric@geoanchors + \anchor{center}{\pgfpointorigin} + \anchor{up}{\northwest\pgf@x=0pt} + \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y} + \anchor{right}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} + \anchor{left}{\northwest\pgf@y=0pt} + \anchor{left down}{\northwest\pgf@y=-0.5\pgf@y} + \anchor{right down}{\northwest\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y} + \anchor{right up}{\northwest\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y} + \anchor{left up}{\northwest\pgf@y=0.5\pgf@y} \anchor{text}{ \pgf@x=-2\pgf@x \advance \pgf@x by -.5\wd\pgfnodeparttextbox @@ -2559,50 +1679,39 @@ \pgf@circ@draw@component{ \pgf@circ@setcolor \pgf@circ@scaled@Rlen=\scaledRlen - \pgf@circ@res@step=\ctikzvalof{quadpoles/gridnode/width}\pgf@circ@scaled@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@step = \ctikzvalof{quadpoles/gridnode/width}\pgf@circ@scaled@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 - - \ifpgf@circuit@dashed - \pgfsetdash{{0.1cm}{0.1cm}}{0cm} - \fi - + \pgfcirc@twoport@maybedash % draw outer box \pgf@circ@twoportbox \pgf@circ@inputarrow - \pgfsetdash{}{0pt} % always draw solid line for inner symbol \pgfsetarrows{-} %never draw arrows \pgfsetlinewidth{0.05mm} - % draw grid \foreach \line in {-1,-.5,...,1} { \pgfpathmoveto{\pgfpoint{\line\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\line\pgf@circ@res@up}} - + % \pgfpathmoveto{\pgfpoint{\line\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\line\pgf@circ@res@down}} } - %prevent from draw the inner cross twice \foreach \line in {-.5,0,...,.5} { \pgfpathmoveto{\pgfpoint{\line\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\line\pgf@circ@res@up}} - + % \pgfpathmoveto{\pgfpoint{\line\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\line\pgf@circ@res@down}} } @@ -2623,59 +1732,19 @@ \pgf@x=.5\pgf@x \pgf@x=-\ctikzvalof{tripoles/wilkinson/width}\pgf@x } - \anchor{center}{ - \northwest - \pgf@x=0pt - \pgf@y=0pt - } - \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 - } + \pgfcirc@northwest@symmetric@geoanchors + \anchor{up}{\northwest\pgf@x=0pt} + \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y} + \anchor{right}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} + \anchor{left}{\northwest\pgf@y=0pt} + \anchor{center}{\pgfpointorigin} + \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{left down}{\northwest\pgf@y=-0.5\pgf@y} + \anchor{right down}{\northwest\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y} + \anchor{right up}{\northwest\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y} + \anchor{left up}{\northwest\pgf@y=0.5\pgf@y} \anchor{text}{ \northwest \advance \pgf@y by 0.5\ht\pgfnodeparttextbox @@ -2684,20 +1753,17 @@ \pgf@circ@draw@component{ \pgf@circ@setcolor \pgf@circ@scaled@Rlen=\scaledRlen - + % \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 \pgf@circ@twoportbox \pgf@circ@inputarrow - - % draw inner stuff \pgfsetdash{}{0pt} % always draw solid line for inner symbol \pgfsetarrows{-} %never draw arrows @@ -2709,15 +1775,12 @@ \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@scaled@Rlen / \ctikzvalof{bipoles/generic/width} / 2} @@ -2729,14 +1792,11 @@ \pgfnode{resistorshape}{center}{}{wilk@int@R}{\pgfusepath{fill}} \fi } - \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}} \pgfpathlineto{\pgfpointanchor{wilk@int@R}{right}} - \pgfpathmoveto{\pgfpointanchor{wilk@int@R}{left}} \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}} \pgfusepath{draw} - } } @@ -2746,65 +1806,25 @@ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} \savedanchor\northwest{% \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} - \pgf@y=\ctikzvalof{tripoles/wilkinson/height}\pgf@circ@scaled@Rlen + \pgf@y=\ctikzvalof{tripoles/splitter/height}\pgf@circ@scaled@Rlen \pgf@y=.5\pgf@y \pgf@x= \pgf@circ@scaled@Rlen \pgf@x=.5\pgf@x - \pgf@x=-\ctikzvalof{tripoles/wilkinson/width}\pgf@x - } - \anchor{center}{ - \northwest - \pgf@x=0pt - \pgf@y=0pt - } - \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 + \pgf@x=-\ctikzvalof{tripoles/splitter/width}\pgf@x } + \pgfcirc@northwest@symmetric@geoanchors + \anchor{center}{\pgfpointorigin} + \anchor{up}{\northwest\pgf@x=0pt} + \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y} + \anchor{right}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} + \anchor{left}{\northwest\pgf@y=0pt} + \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{left down}{\northwest\pgf@y=-0.5\pgf@y} + \anchor{right down}{\northwest\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y} + \anchor{right up}{\northwest\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y} + \anchor{left up}{\northwest\pgf@y=0.5\pgf@y} \anchor{text}{ \northwest \advance \pgf@y by 0.5\ht\pgfnodeparttextbox @@ -2813,15 +1833,14 @@ \pgf@circ@draw@component{ \pgf@circ@setcolor \pgf@circ@scaled@Rlen=\scaledRlen - + % \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 \pgf@circ@twoportbox \pgf@circ@inputarrow @@ -2836,9 +1855,8 @@ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}} \pgfpathmoveto{\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 resisitors - european or american style is recognised \foreach \respt/\resang/\linepta/\lineptb in % @@ -2852,7 +1870,6 @@ { \pgftransformshift{\respt} \pgftransformrotate{\resang} - % calculate size of resistor \ifpgf@circuit@europeanresistor \pgfmathparse{\pgf@circ@res@up / \pgf@circ@scaled@Rlen / \ctikzvalof{bipoles/generic/width} / 2} @@ -2864,10 +1881,8 @@ \pgfnode{resistorshape}{center}{}{wilk@int@R}{\pgfusepath{fill}} \fi } - \pgfpathmoveto{\linepta} \pgfpathlineto{\pgfpointanchor{wilk@int@R}{right}} - \pgfpathmoveto{\pgfpointanchor{wilk@int@R}{left}} \pgfpathlineto{\lineptb} \pgfusepath{draw} @@ -2875,17 +1890,81 @@ } } +%% generic splitter +\pgfdeclareshape{genericsplitter}{ + \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}} + \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} + \savedanchor\northwest{% + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgf@y=\ctikzvalof{tripoles/genericsplitter/height}\pgf@circ@scaled@Rlen + \pgf@y=.5\pgf@y + \pgf@x= \pgf@circ@scaled@Rlen + \pgf@x=.5\pgf@x + \pgf@x=-\ctikzvalof{tripoles/genericsplitter/width}\pgf@x + } + \pgfcirc@northwest@symmetric@geoanchors + \anchor{center}{\pgfpointorigin} + \anchor{up}{\northwest\pgf@x=0pt} + \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y} + \anchor{right}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} + \anchor{left}{\northwest\pgf@y=0pt} + \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{left down}{\northwest\pgf@y=-0.5\pgf@y} + \anchor{right down}{\northwest\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y} + \anchor{right up}{\northwest\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y} + \anchor{left up}{\northwest\pgf@y=0.5\pgf@y} + \anchor{text}{ + \northwest + \pgf@y=-.5\ht\pgfnodeparttextbox + \pgf@x=-.2\wd\pgfnodeparttextbox + } + \pgf@circ@draw@component{ + \pgf@circ@setcolor + \pgf@circ@scaled@Rlen=\scaledRlen + % + \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 + \pgf@circ@twoportbox + \pgf@circ@inputarrow + % draw inner stuff + \pgfsetdash{}{0pt} % always draw solid line for inner symbol + \pgfsetarrows{-} %never draw arrows + \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}} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\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 resisitors - european or american style is recognised + \foreach \linepta/\lineptb in % + { \pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}/\pgfpoint{0.5\pgf@circ@res@left}{0},% + \pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}/\pgfpoint{0.5\pgf@circ@res@left}{0}} + { + \pgfpathmoveto{\linepta} + \pgfpathlineto{\lineptb} + \pgfusepath{draw} + } + } +} + %% couplers generics \long\def\pgfcircdeclarefourport#1#2{ - \pgfdeclareshape{#1}{ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}} \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} - \anchor{center}{ - \northwest - \pgf@x=0pt - \pgf@y=0pt - } \savedanchor\northwest{% \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} \pgf@y=\ctikzvalof{quadpoles/#1/height}\pgf@circ@scaled@Rlen @@ -2893,95 +1972,25 @@ \pgf@x=.5\pgf@circ@scaled@Rlen \pgf@x=-\ctikzvalof{quadpoles/#1/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{left down}{ - \northwest - \pgf@y=-0.5\pgf@y - } - \anchor{right down}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-0.5\pgf@y - } - \anchor{right up}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=0.5\pgf@y - } - \anchor{left up}{ - \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 - } - + \pgfcirc@northwest@symmetric@geoanchors + \anchor{center}{\pgfpointorigin} + \anchor{up}{\northwest\pgf@x=0pt} + \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y} + \anchor{right}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x} + \anchor{left}{\northwest\pgf@y=0pt} + \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{left down}{\northwest\pgf@y=-0.5\pgf@y} + \anchor{right down}{\northwest\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y} + \anchor{right up}{\northwest\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y} + \anchor{left up}{\northwest\pgf@y=0.5\pgf@y} + %1,2,3,4 are deprecated + \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 @@ -2989,16 +1998,14 @@ } \pgf@circ@draw@component{ \pgf@circ@setcolor - \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@scaled@Rlen=\scaledRlen - + % \pgfstartlinewidth=\pgflinewidth - % draw outer box \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} @@ -3081,58 +2088,11 @@ \pgf@x=.5\pgf@x \pgf@x=-\ctikzvalof{tripoles/mzm/width}\pgf@x } - \anchor{center}{ - \northwest - \pgf@x=0pt - \pgf@y=0pt - } - \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{mod}{ - \northwest - \pgf@x=0pt - } - \anchor{out}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=0pt - } + \pgfcirc@northwest@symmetric@geoanchors + \anchor{center}{\pgfpointorigin} + \anchor{in}{ \northwest \pgf@y=0pt } + \anchor{mod}{ \northwest \pgf@x=0pt } + \anchor{out}{ \northwest \pgf@x=-\pgf@x \pgf@y=0pt } \anchor{text}{ \northwest \advance \pgf@y by 0.5\ht\pgfnodeparttextbox @@ -3141,74 +2101,50 @@ \pgf@circ@draw@component{ \pgf@circ@setcolor \pgf@circ@scaled@Rlen=\scaledRlen - \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 \pgf@circ@twoportbox \pgf@circ@inputarrow - % draw inner stuff - % 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 - \pgfsetarrows{-} %never draw arrows - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.25\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.25\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.25\pgf@circ@res@up}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.25\pgf@circ@res@down}} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{0.35\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@right}{0.1\pgf@circ@res@up}} - \pgfusepath{draw} - - } + \pfgcirc@twoport@rotate@inner@symbol + % draw inner symbol + \ifpgf@circuit@full@dashed\else\pgfsetdash{}{0pt}\fi + \pgfsetarrows{-} %never draw arrows + \pgfsetlinewidth{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@left}{\pgf@circ@res@zero}} + % + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.25\pgf@circ@res@up}} + % + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.25\pgf@circ@res@down}} + % + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{\pgf@circ@res@zero}} + % + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}} + % + \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}} + % + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{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@left}{0.25\pgf@circ@res@down}} + % + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{0.35\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@right}{0.1\pgf@circ@res@up}} + \pgfusepath{draw} + } } % %>>> diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index 7b03c9b2670..35f147bf49a 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -2859,6 +2859,13 @@ \pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}} \ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}} +%%%% activate doublegate +\newif\ifpgf@circuit@fet@doublegate +\pgfkeys{/tikz/doublegate/.add code={}{\pgf@circuit@fet@doublegatetrue}} +\ctikzset{doublegate/.add code={}{\pgf@circuit@fet@doublegatetrue}} +\pgfkeys{/tikz/nodoublegate/.add code={}{\pgf@circuit@fet@doublegatefalse}} +\ctikzset{nodoublegate/.add code={}{\pgf@circuit@fet@doublegatefalse}} + % Option bodydiode for fet \newif\ifpgf@circuit@fet@bodydiode \pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}} @@ -3787,12 +3794,38 @@ \left \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step } + \anchor{G1}{ + \northeast + \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y + \left + \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step + } + \anchor{G2}{ + \northeast + \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y + \pgf@circ@res@step=-0.3333333\pgf@circ@res@step + \left + \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step + } \anchor{gate}{ \northeast \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y \left \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step } + \anchor{gate1}{ + \northeast + \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y + \left + \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step + } + \anchor{gate2}{ + \northeast + \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn height}\pgf@y + \pgf@circ@res@step=-0.3333333\pgf@circ@res@step + \left + \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@circ@res@step + } \anchor{nobase}{ \left \pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x @@ -5359,10 +5392,19 @@ \pgfusepath{draw} %draw thick gate line - \pgfscope + \pgfscope%%% gate line \pgfpathmoveto{\pgfpoint {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} + \ifpgf@circuit@fet@doublegate + \edef\@@gateconnheight{(\ctikzvalof{tripoles/#1/conn height})} + \pgfpathlineto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\@@gateconnheight*\pgf@circ@res@up/3}} + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\@@gateconnheight*\pgf@circ@res@down/3}} + \fi \pgfpathlineto{\pgfpoint {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}} @@ -5404,18 +5446,28 @@ % GATE CONNECTION \ifpgf@circuit@bpt@drawgate - \ifpgf@circuit@trans@ntype - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} - \else + \pgfscope %% gate connection + \ifpgf@circuit@trans@ntype + \edef\@@gateconnheight{(\ctikzvalof{tripoles/#1/conn height})} + \else + \edef\@@gateconnheight{(-\ctikzvalof{tripoles/#1/conn height})} + \fi \pgfpathmoveto{\pgfpoint {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} - {-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\ctikzvalof{tripoles/#1/conn height}\pgf@circ@res@down}} - \fi - \pgfusepath{draw} + {\@@gateconnheight*\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint + {\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth} + {\@@gateconnheight*\pgf@circ@res@down}} + \ifpgf@circuit@fet@doublegate + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {-\@@gateconnheight*\pgf@circ@res@down/3}} + \pgfpathlineto{\pgfpoint + {\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth} + {-\@@gateconnheight*\pgf@circ@res@down/3}} + \fi + \pgfusepath{draw} + \endpgfscope \fi \pgfcirc@ferroelectric{#1}{0} diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty index 057df444f35..a245130c4a2 100644 --- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty +++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty @@ -16,8 +16,8 @@ \providecommand\DeclareRelease[3]{} \providecommand\DeclareCurrentRelease[2]{} -\def\pgfcircversion{1.5.5} -\def\pgfcircversiondate{2022/11/12} +\def\pgfcircversion{1.6.0} +\def\pgfcircversiondate{2022/12/10} \DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex} \DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex} |