summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-10 03:00:43 +0000
committerNorbert Preining <norbert@preining.info>2024-02-10 03:00:43 +0000
commit1d28728327083b2e09300af044d37336abafbe02 (patch)
tree587bf83e2f85c0a4ef67c12707de3395e6194e9c /graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
parentfa4b456400bb2b415dcbbfe785542c50e9dd61e3 (diff)
CTAN sync 202402100300
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex158
1 files changed, 142 insertions, 16 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
index 32a85cb0c9..2cc6e461aa 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
@@ -1,7 +1,7 @@
-% Copyright 2018-2023 by Romano Giannetti
-% Copyright 2015-2023 by Stefan Lindner
-% Copyright 2013-2023 by Stefan Erhardt
-% Copyright 2007-2023 by Massimo Redaelli
+% Copyright 2018-2024 by Romano Giannetti
+% Copyright 2015-2024 by Stefan Lindner
+% Copyright 2013-2024 by Stefan Erhardt
+% Copyright 2007-2024 by Massimo Redaelli
%
% This file may be distributed and/or modified
%
@@ -303,11 +303,11 @@
% compatible with the quadpoles "inner" style.
\pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@right}
- \pgfmoveto{\pgfpoint%
+ \pgfpathmoveto{\pgfpoint%
{\pgf@circ@res@other}%
{\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
}
- \pgflineto{
+ \pgfpathlineto{
\pgfpoint%
{\pgf@circ@res@other}%
{\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
@@ -315,11 +315,11 @@
%% this should be just -\pgf@circ@res@other, but in case someone define an asymmetric trafo someday...
\pgfmathsetlength{\pgf@circ@res@other}{2.5*\stretto*\ctikzvalof{quadpoles/transformer core/core width}*\pgf@circ@res@left}
- \pgfmoveto{\pgfpoint%
+ \pgfpathmoveto{\pgfpoint%
{\pgf@circ@res@other}%
{\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
}
- \pgflineto{
+ \pgfpathlineto{
\pgfpoint%
{\pgf@circ@res@other}%
{\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
@@ -549,6 +549,7 @@
\ctikzset{bipoles/dsp/width/.initial=.7}
\ctikzset{bipoles/fft/width/.initial=.7}
\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/iamp/width/.initial=.7}
\ctikzset{bipoles/vamp/width/.initial=.7}
\ctikzset{bipoles/piattenuator/width/.initial=.7}
\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
@@ -557,10 +558,14 @@
\ctikzset{bipoles/phaseshifter/width/.initial=.7}
\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
\ctikzset{bipoles/detector/width/.initial=.7}
+\ctikzset{bipoles/saturation/width/.initial=.7}
+\ctikzset{bipoles/sigmoid/width/.initial=.7}
+\ctikzset{bipoles/allornothing/width/.initial=.7}
\ctikzset{tripoles/mixer/width/.initial=0.7}
\ctikzset{tripoles/adder/width/.initial=0.7}
\ctikzset{tripoles/circulator/width/.initial=.7}
\ctikzset{tripoles/oscillator/width/.initial=.7}
+\ctikzset{bipoles/fiber/width/.initial=.7}
\ctikzset{tripoles/wilkinson/height/.initial=1.3}
\ctikzset{tripoles/wilkinson/width/.initial=1.3}
@@ -635,11 +640,19 @@
\fi
}
%%% blocks additional anchors
+\ctikzset{block left anchors pos/.initial=0.5}
+\ctikzset{block right anchors pos/.initial=0.5}
+\ctikzset{block lateral anchors pos/.code={
+ \ctikzset{block left anchors pos=#1}%
+ \ctikzset{block right anchors pos=#1}%
+}}
\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}
+ \savedmacro{\blockleftanchorpos}{\edef\blockleftanchorpos{\ctikzvalof{block left anchors pos}}}
+ \savedmacro{\blockrightanchorpos}{\edef\blockrightanchorpos{\ctikzvalof{block right anchors pos}}}
+ \anchor{right down}{\northeast\pgf@y=-\blockrightanchorpos\pgf@y}
+ \anchor{left down}{\northeast\pgf@x=-\pgf@x\pgf@y=-\blockleftanchorpos\pgf@y}
+ \anchor{left up}{\northeast\pgf@x=-\pgf@x\pgf@y=\blockleftanchorpos\pgf@y}
+ \anchor{right up}{\northeast\pgf@y=\blockrightanchorpos\pgf@y}
\anchor{up}{\northeast\pgf@x=0pt\relax}
\anchor{down}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt\relax}
}
@@ -1043,7 +1056,6 @@
\pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\Large$\varphi$}
}
-
%% detector
\pgfcirc@define@twoports@norotate{blocks}
{}
@@ -1067,7 +1079,57 @@
\pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
\fi
}
-
+%% saturation block, contributed by P.Sacco <paul.sacco@estaca,eu>
+\pgfcirc@define@twoports{blocks}
+{}
+{\ctikzvalof{bipoles/saturation/width}}
+{saturation}
+{\ctikzvalof{bipoles/saturation/width}}
+{\ctikzvalof{bipoles/saturation/width}}
+{
+ \pgfsetlinewidth{1.2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@step}{.4\pgf@circ@res@step}}
+ %
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.65\pgf@circ@res@step}{-.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+%% sigmoid
+\pgfcirc@define@twoports{blocks}
+{}
+{\ctikzvalof{bipoles/sigmoid/width}}
+{sigmoid}
+{\ctikzvalof{bipoles/sigmoid/width}}
+{\ctikzvalof{bipoles/sigmoid/width}}
+{
+ \pgfsetlinewidth{1.2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.65\pgf@circ@res@step}{-.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.45\pgf@circ@res@step}{-.4\pgf@circ@res@step}}
+ \pgfpathparabola{\pgfpointorigin}{\pgfpoint{.45\pgf@circ@res@step}{.4\pgf@circ@res@step}}
+ %
+ \pgfpathmoveto{\pgfpoint{.65\pgf@circ@res@step}{.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@step}{.4\pgf@circ@res@step}}
+ \pgfpathparabola{\pgfpointorigin}{\pgfpoint{-.45\pgf@circ@res@step}{-.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+%% all-or-nothing (comparator) block
+\pgfcirc@define@twoports{blocks}
+{}
+{\ctikzvalof{bipoles/allornothing/width}}
+{allornothing}
+{\ctikzvalof{bipoles/allornothing/width}}
+{\ctikzvalof{bipoles/allornothing/width}}
+{
+ \pgfsetlinewidth{1.2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.55\pgf@circ@res@step}{-.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{+0pt}{-.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{+0pt}{.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.55\pgf@circ@res@step}{.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
%% converters help function
%% definition for styling the DC symbols (GitHub issue #680)
\ctikzset{blocks dc in segments/.initial=1}
@@ -1357,7 +1419,7 @@
\pfgcirc@twoport@rotate@inner@symbol
\pgfcirc@twoport@draw@sine{0}{0}
}
-%% amplifier and vamplifier
+%% amplifier, iamplifier, and vamplifier
%% Amplifier %% Beware, not using the generic twoport(s) macros.
\pgfcirc@define@twoports@boxed{blocks}
{
@@ -1395,8 +1457,45 @@
\pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
\fi
}
+%% Instrumentation 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.75\pgf@y
+ \fi
+ }
+ \anchor{down}{%
+ \northeast\pgf@x=0pt\pgf@y=-\pgf@y\relax
+ \ifnum\componentisboxed=0
+ \pgf@y=0.75\pgf@y
+ \fi
+ }
+}
+{\ifpgf@circuit@boxed\ctikzvalof{bipoles/twoport/width}\else\ctikzvalof{bipoles/amp/width}\fi}
+{iamp}
+{\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 blunt triangle
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.55\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.2\pgf@circ@res@step}}
+ \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}
+ \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}{%
@@ -1439,6 +1538,28 @@
\pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
\fi
}
+
+%% optical fiber
+\pgfcirc@define@twoports@norotate{blocks}
+{}
+{\ctikzvalof{bipoles/fiber/width}}
+{fiber}
+{\ctikzvalof{bipoles/fiber/width}}
+{\ctikzvalof{bipoles/fiber/width}}
+{
+ \pgfpathcircle{\pgfpoint{0.2\pgf@circ@res@left}{0.4\pgf@circ@res@up}}{0.4\pgf@circ@res@up}
+ \pgfpathcircle{\pgfpoint{0\pgf@circ@res@left}{0.4\pgf@circ@res@up}}{0.4\pgf@circ@res@up}
+ \pgfpathcircle{\pgfpoint{-0.2\pgf@circ@res@left}{0.4\pgf@circ@res@up}}{0.4\pgf@circ@res@up}
+ \pgfusepath{draw}
+ % always use basic line width for this
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+\pgfcirc@activate@bipole@simple{l}{fiber}
+%
% %>>>
%% Path definitions for Blocks%<<<
@@ -1458,6 +1579,7 @@
\pgfcirc@activate@bipole@simple{l}{dsp}
\pgfcirc@activate@bipole@simple{l}{fft}
\pgfcirc@activate@bipole@simple{l}{amp}
+\pgfcirc@activate@bipole@simple{l}{iamp}
\pgfcirc@activate@bipole@simple{l}{vamp}
\pgfcirc@activate@bipole@simple{l}{piattenuator}
\pgfcirc@activate@bipole@simple{l}{vpiattenuator}
@@ -1466,6 +1588,10 @@
\pgfcirc@activate@bipole@simple{l}{phaseshifter}
\pgfcirc@activate@bipole@simple{l}{vphaseshifter}
\pgfcirc@activate@bipole@simple{l}{detector}
+\pgfcirc@activate@bipole@simple{l}{saturation}
+\pgfcirc@activate@bipole@simple{l}{sigmoid}
+\pgfcirc@activate@bipole@simple{l}{allornothing}
+\pgfcirc@activate@bipole@simple{l}{fiber}
\pgfcirc@activate@bipole@simple{l}{sacdc}
\pgfcirc@activate@bipole@simple{l}{sdcac}
\pgfcirc@activate@bipole@simple{l}{sdcdc}