summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-08-31 21:18:52 +0000
committerKarl Berry <karl@freefriends.org>2019-08-31 21:18:52 +0000
commitce57a48ad32828c6b55ab174a7ae857475dbdd22 (patch)
tree201dd15a66a2f8a0323070835f4ab46739decb2b /Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
parent4071c391a929d5e37fc50476a19c15f32eaaeb93 (diff)
circuitikz (31aug19)
git-svn-id: svn://tug.org/texlive/trunk@52002 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex')
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex502
1 files changed, 296 insertions, 206 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
index c6fe8bfdb29..88ca4711daf 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
@@ -9,6 +9,12 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Monopoles
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%
+%% Grounds
+%%%%%%%%%%%%%
+
%% Ground symbol
% #1 -> name
@@ -17,10 +23,13 @@
% #4 -> code
\long\def\pgf@circ@declareground#1#2#3#4{
\pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\savedanchor{\southeast}{
- \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
\pgf@x=#2\pgf@x
- \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+ \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
\pgf@y=-#3\pgf@y
}
\anchor{north}{\pgfpointorigin}
@@ -35,7 +44,8 @@
\anchor{right}{\pgfpointorigin}
\anchor{center}{\pgfpointorigin}
\behindforegroundpath{
- \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
\pgfscope
\pgfstartlinewidth=\pgflinewidth
#4
@@ -50,7 +60,7 @@
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
\pgfusepath{draw}
- \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
\pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
@@ -61,7 +71,7 @@
}
\pgf@circ@declareground{tlground}{0.6}{0.4}{
- \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
\pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
@@ -78,7 +88,7 @@
\pgfusepath{draw}
\pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\ctikzvalof{monopoles/rground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
@@ -90,7 +100,7 @@
\pgfusepath{draw}
\pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
@@ -103,7 +113,7 @@
\pgfusepath{draw}
\pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
@@ -118,7 +128,7 @@
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
\pgfusepath{draw}
- \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
\pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
@@ -133,11 +143,14 @@
% protective ground
\pgf@circ@declareground{pground}{0.9}{1.8}{
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
+ \pgf@circ@draworfill
\pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
\pgfusepath{draw}
- \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
\pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
@@ -145,8 +158,6 @@
\pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
\pgfusepath{draw}
- \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
- \pgfusepath{draw}
}
% chassis ground
@@ -155,7 +166,7 @@
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
\pgfusepath{draw}
- \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
@@ -166,14 +177,14 @@
}
% Contributed by @fotesan https://github.com/fotesan
-
+% european ground
\pgf@circ@declareground{eground}{1.1}{1.7}{
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
\pgfusepath{draw}
\pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
@@ -197,7 +208,7 @@
\pgfusepath{draw}
\pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
@@ -213,13 +224,148 @@
\pgfusepath{draw}
}
+%%%%%%%%%%%%%%%%%%
+%% Power supplies
+%%%%%%%%%%%%%%%%%%
+
+% Vcc
+\pgfdeclareshape{vcc}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=3\pgf@x%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=2\pgf@circ@res@step
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Vee
+\pgfdeclareshape{vee}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd-\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf@x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf@circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=-3\pgf@x%
+ }
+ \anchor{south}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{north}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast}
+ \anchor{south west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast\pgf@y=0pt\relax}
+ \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=-2\pgf@circ@res@step
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+
+ \behindforegroundpath{
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%
+%% RF elements
+%%%%%%%%%%%%%%%%
+
+% Legacy tlinestub
% Contributed by Leonardo Azzinnari
\pgfdeclareshape{tlinestub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\savedanchor{\northeast}{%
- \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
- \pgf@x=1.625\pgf@circ@res@step
- \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
- \pgf@y=.25\pgf@circ@res@step%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@x=1.2\pgf@circ@res@step
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@y=.2\pgf@circ@res@step%
}
% the center is on the left side of the shape for facility of usage
\anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
@@ -234,7 +380,9 @@
\behindforegroundpath{
\pgfstartlinewidth=\pgflinewidth
- \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
+ \pgf@circ@res@step=0.6\pgf@circ@scaled@Rlen
\pgfscope\begin{pgftransparencygroup}
\pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
@@ -243,7 +391,7 @@
\pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
\pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
\pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgf@circ@draworfill
\pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
\pgfusepath{draw}
@@ -256,13 +404,14 @@
%% New antennas without tails
-% main body
+% main body of antennas
\def\pgf@circ@antennabody{%
\pgfstartlinewidth=\pgflinewidth
- \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
- \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
\pgfscope
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
@@ -296,12 +445,14 @@
\endpgfscope
}
-
% additional shape with the waves
\pgfdeclareshape{waves}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\anchor{center}{\pgfpointorigin}
\savedanchor{\northeast}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
\pgf@x=\pgf@circ@res@step
\pgf@y=\pgf@circ@res@step
}
@@ -322,9 +473,10 @@
\anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
\anchor{north west}{\northeast\pgf@x=-\pgf@x}
\behindforegroundpath{
- \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
\pgf@circ@res@step=0.5\pgf@circ@res@step
- \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetcolor{\ctikzvalof{color}}
\pgfscope
% define a triangle for clipping the waves
\pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
@@ -347,9 +499,12 @@
% the three types of antennas: simple, TX, RX. Notice that you can flip them...
\pgfdeclareshape{bareantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\anchor{center}{\pgfpointorigin}
\savedanchor{\northeast}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
\pgf@x=\pgf@circ@res@step
\pgf@y=2\pgf@circ@res@step
}
@@ -377,12 +532,21 @@
}
\pgfdeclareshape{bareTXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\anchor{center}{\pgfpointorigin}
\savedanchor{\northeast}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
\pgf@x=\pgf@circ@res@step
\pgf@y=2\pgf@circ@res@step
}
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
\anchor{text}{
\northeast
\pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
@@ -390,12 +554,7 @@
\pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
\pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \anchor{waves}{
- \northeast
- \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
- \pgf@x=4.2\pgf@circ@res@step
- \pgf@y=\pgf@circ@res@step
- }
+ \anchor{waves}{\savedwaves}
\anchor{top}{\northeast\pgf@x=0pt}
\anchor{right}{\northeast\pgf@y=0.5\pgf@y}
\anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
@@ -415,24 +574,28 @@
}
\pgfdeclareshape{bareRXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\anchor{center}{\pgfpointorigin}
\savedanchor{\northeast}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
\pgf@x=\pgf@circ@res@step
\pgf@y=2\pgf@circ@res@step
}
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
\anchor{text}{
\northeast
\pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
\pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
\pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \anchor{waves}{
- \northeast
- \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
- \pgf@x=-4.2\pgf@circ@res@step
- \pgf@y=\pgf@circ@res@step
- }
+ \anchor{waves}{\savedwaves}
\anchor{top}{\northeast\pgf@x=0pt}
\anchor{right}{\northeast\pgf@y=0.5\pgf@y}
\anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
@@ -455,16 +618,20 @@
% Microstrip monopoles
\pgfdeclareshape{mslstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\savedanchor{\southeast}{
- \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
- \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
\pgf@y=-.5\pgf@y
}
\savedanchor{\northwest}{
- \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@scaled@Rlen
\pgf@x=-.5\pgf@x
- \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
\pgf@y=.5\pgf@y
}
\anchor{north}{\northwest\pgf@x=0pt\relax}
@@ -493,7 +660,7 @@
\pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
\pgfstartlinewidth=\pgflinewidth
\pgfscope
- \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@draworfill
\endpgfscope
@@ -501,15 +668,19 @@
}
\pgfdeclareshape{msrstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\savedanchor{\southeast}{
- \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
\pgf@y=0pt\relax
}
\savedanchor{\northwest}{
- \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@scaled@Rlen
\pgf@x=-.5\pgf@x
- \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@Rlen
+ \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@scaled@Rlen
\pgf@y=.5\pgf@y
}
\anchor{north}{\northwest\pgf@x=0pt\relax}
@@ -541,29 +712,32 @@
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
\pgfusepath{draw}
- \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
\pgfpatharc{135}{45}{\pgf@circ@res@step}
\pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
\pgfpatharc{45}{135}{\pgf@circ@res@up}
\pgfclosepath
- % \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@draworfill
\endpgfscope
}
}
\pgfdeclareshape{msport}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\savedanchor{\southeast}{
- \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
- \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
\pgf@y=-.5\pgf@y
}
\savedanchor{\northwest}{
- \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@scaled@Rlen
\pgf@x=-.5\pgf@x
- \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@scaled@Rlen
\pgf@y=.5\pgf@y
}
\anchor{north}{\northwest\pgf@x=0pt\relax}
@@ -592,7 +766,7 @@
\pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
\pgfstartlinewidth=\pgflinewidth
\pgfscope
- \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
@@ -603,29 +777,32 @@
\endpgfscope
}
}
-% Legacy antennas (with tails)
+% Legacy antennas (with tails)
\def\pgf@circ@shift@antenna@xy#1#2{%
- \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
\pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
\pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
\relax}
+% Legacy antenna
\pgfdeclareshape{antenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\anchor{center}{\pgfpointorigin}
\savedanchor{\northeast}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
\pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
\pgf@y=4\pgf@circ@res@step
}
- \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
- \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
- \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
- \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
- \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{0}{2}}
- \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
- \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
- \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
\anchor{text}{
\northeast
\pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
@@ -633,7 +810,8 @@
}
\behindforegroundpath{
\pgfstartlinewidth=\pgflinewidth
- \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
\pgftransformxshift{ -4\pgf@circ@res@step }
@@ -648,8 +826,8 @@
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
- \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfusepath{draw}
\endpgfscope
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -657,22 +835,25 @@
}
}
-
+% Legacy TX antenna
\pgfdeclareshape{txantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\anchor{center}{\pgfpointorigin}
\savedanchor{\northeast}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
\pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
\pgf@y=4\pgf@circ@res@step
}
- \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
- \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
- \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
- \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
- \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
- \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
- \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
- \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
\anchor{text}{
\northeast
\pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
@@ -680,7 +861,8 @@
}
\behindforegroundpath{
\pgfstartlinewidth=\pgflinewidth
- \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
@@ -695,8 +877,8 @@
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
- \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfusepath{draw}
\endpgfscope
\pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
@@ -715,22 +897,25 @@
}
}
-
+% Legacy RX antenna
\pgfdeclareshape{rxantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\anchor{center}{\pgfpointorigin}
\savedanchor{\northeast}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
\pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
\pgf@y=4\pgf@circ@res@step
}
- \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
- \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
- \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
- \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
- \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
- \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
- \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
- \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{north}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@circ@res@step=\pgf@x\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
\anchor{text}{
\northeast
\pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
@@ -738,7 +923,8 @@
}
\behindforegroundpath{
\pgfstartlinewidth=\pgflinewidth
- \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
@@ -753,8 +939,8 @@
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
- \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfusepath{draw}
\endpgfscope
@@ -770,115 +956,18 @@
\pgfpatharc{150}{210}{2\pgf@circ@res@step}
\pgfusepath{draw}
\pgfsetlinewidth{\pgfstartlinewidth}
-
}
}
-% Vcc
-\pgfdeclareshape{vcc}{
- \savedanchor{\northeast}{%
- \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
- \pgf@x=.5\pgf@circ@res@step
- \pgf@y=3\pgf@x%
- }
- \anchor{north}{\northeast\pgf@x=0cm\relax}
- \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
- \anchor{south}{\pgfpointorigin}
- \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
- \anchor{north east}{\northeast}
- \anchor{north west}{\northeast\pgf@x=-\pgf@x}
- \anchor{south east}{\northeast\pgf@y=0pt\relax}
- \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
- \anchor{center}{\pgfpointorigin}
- \anchor{text}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
- \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
- \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
- \pgf@x=0pt
- \pgf@y=2\pgf@circ@res@step
- \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
- \pgf@x=-.5\wd\pgfnodeparttextbox
- }
- \behindforegroundpath{
- \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
- \pgfscope
- \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
- \ifx\pgf@temp\pgf@circ@temp
- \pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-
- \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
- \pgfusepath{draw}
-
- \pgfsetlinewidth{\pgfstartlinewidth}
- \else
- \pgfsetarrowsend{\pgf@circ@temp}
- \fi
- \pgfpathmoveto{\pgfpointorigin}
- \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
- \pgfusepath{draw}
- \endpgfscope
- }
-}
-
-% Vee
-\pgfdeclareshape{vee}{
- \savedanchor{\northeast}{%
- \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
- \pgf@x=.5\pgf@circ@res@step
- \pgf@y=-3\pgf@x%
- }
- \anchor{south}{\northeast\pgf@x=0cm\relax}
- \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
- \anchor{north}{\pgfpointorigin}
- \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
- \anchor{south east}{\northeast}
- \anchor{south west}{\northeast\pgf@x=-\pgf@x}
- \anchor{north east}{\northeast\pgf@y=0pt\relax}
- \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
- \anchor{center}{\pgfpointorigin}
- \anchor{text}{
- \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
- \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
- \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
- \pgf@x=0pt
- \pgf@y=-2\pgf@circ@res@step
- \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
- \pgf@x=-.5\wd\pgfnodeparttextbox
- }
-
- \behindforegroundpath{
- \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
- \pgfscope
- \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
- \ifx\pgf@temp\pgf@circ@temp
-
- \pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-
- \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
- \pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
- \else
- \pgfsetarrowsend{\pgf@circ@temp}
- \fi
- \pgfpathmoveto{\pgfpointorigin}
- \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
- \pgfusepath{draw}
- \endpgfscope
- }
-}
-
-% match
+% Legacy match
\pgfdeclareshape{match}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\savedanchor{\northeast}{%
- \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
\pgf@x=2\pgf@circ@res@step
- \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@scaled@Rlen
\pgf@y=.5\pgf@circ@res@step%
}
% the center is on the left side of the shape for facility of usage
@@ -894,13 +983,15 @@
\pgfpointorigin
}
\anchor{text}{
- \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
\pgf@x=1.5\pgf@x
\advance \pgf@x by -.5\wd\pgfnodeparttextbox
\pgf@y=-1.5\ht\pgfnodeparttextbox
}
\behindforegroundpath{
- \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
\pgfscope
\pgfpathmoveto{\pgfpointorigin}
@@ -913,7 +1004,6 @@
\pgfusepath{fill}
\pgfsetlinewidth{\pgfstartlinewidth}
-
\endpgfscope
}
}