summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdfbin17645 -> 17645 bytes
-rw-r--r--Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md17
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/changelog.tex49
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdfbin1599964 -> 1629420 bytes
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex205
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty2
-rw-r--r--Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex4
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex2
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex65
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex4
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex2460
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex74
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty4
13 files changed, 1054 insertions, 1832 deletions
diff --git a/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf b/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf
index d8982740f94..173bde40088 100644
--- a/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf
+++ b/Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md b/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
index 72a79c78a22..7eb44df6bec 100644
--- a/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
+++ b/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
@@ -1,6 +1,23 @@
<!--- CircuiTikz - Changelog --->
The major changes among the different CircuiTikZ versions are listed here. See <https://github.com/circuitikz/circuitikz/commits> for a full list of changes.
+* Version 1.6.0 (2022-12-10)
+
+ The big change is the refactoring (and enhancement) of the block's code. In addition, double gate MOSes, several fixes all over the map, and quite a lot of anchors were added into the mix.
+
+ - Big change (mostly backward compatible, minus a couple of bug fixes) to the block's code.
+ - Now `vco` can be `box`ed
+ - enabled more short-name geographical anchors
+ - generic blocks can be made rectangular
+ - mid-way lateral anchors for all blocks, as well as up/down
+ - renamed converters anchors (old ones retained for backward compatibility)
+ - new ac/ac blocks, both single- and three-phase
+ - Added double gate MOS transistors (by Romano Giannetti)
+ - Fix deformed shape for legacy `TL` component ([issue on GitHub](https://github.com/circuitikz/circuitikz/issues/664))
+ - Added several anchors on variable components, suggested by [Dr Matthias Jung](https://github.com/circuitikz/circuitikz/issues/663)
+ - Added `genericsplitter` component (by [frankplow](github.com/frankplow))
+ - Fix - reshape `splitter` using `/tripoles/splitter/width` and `/tripoles/splitter/height` rather than `/tripoles/wilkinson/width` and `/tripoles/wilkinson/height`.
+
* Version 1.5.5 (2022-11-12)
New features for optoelectronic devices: a new component, arrow styling,
diff --git a/Master/texmf-dist/doc/latex/circuitikz/changelog.tex b/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
index be5dc1e3998..a500949b976 100644
--- a/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
+++ b/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
@@ -5,6 +5,55 @@ full list of changes.
\begin{itemize}
\item
+ Version 1.6.0 (2022-12-10)
+
+ The big change is the refactoring (and enhancement) of the block's
+ code. In addition, double gate MOSes, several fixes all over the map,
+ and quite a lot of anchors were added into the mix.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Big change (mostly backward compatible, minus a couple of bug fixes)
+ to the block's code.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Now \texttt{vco} can be \texttt{box}ed
+ \item
+ enabled more short-name geographical anchors
+ \item
+ generic blocks can be made rectangular
+ \item
+ mid-way lateral anchors for all blocks, as well as up/down
+ \item
+ renamed converters anchors (old ones retained for backward
+ compatibility)
+ \item
+ new ac/ac blocks, both single- and three-phase
+ \end{itemize}
+ \item
+ Added double gate MOS transistors (by Romano Giannetti)
+ \item
+ Fix deformed shape for legacy \texttt{TL} component
+ (\href{https://github.com/circuitikz/circuitikz/issues/664}{issue on
+ GitHub})
+ \item
+ Added several anchors on variable components, suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/663}{Dr
+ Matthias Jung}
+ \item
+ Added \texttt{genericsplitter} component (by
+ \href{github.com/frankplow}{frankplow})
+ \item
+ Fix - reshape \texttt{splitter} using
+ \texttt{/tripoles/splitter/width} and
+ \texttt{/tripoles/splitter/height} rather than
+ \texttt{/tripoles/wilkinson/width} and
+ \texttt{/tripoles/wilkinson/height}.
+ \end{itemize}
+\item
Version 1.5.5 (2022-11-12)
New features for optoelectronic devices: a new component, arrow
diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
index 4198c5a2dce..59c070bba4a 100644
--- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
+++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
index 9302ccee3ba..9a375b69dc5 100644
--- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
+++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
@@ -213,6 +213,9 @@ Arrows with \texttt{to[]} components don't work, anyway, so basically avoid this
\end{circuitikz}
\end{LTXexample}
+Lastly, voltage styles interacts in strange ways with general (such as \texttt{american}, \texttt{european} style), in the sense that sometimes the order in which you enact them is important. That should be arguably fixed, but it will change (read break) a lot of existing code, so it'll stay; more information and workarounds in section~\ref{sec:mixing-voltage-styles}.
+
+As a final notice, if you want to use the \texttt{externalize} library, do not use the \texttt{circuitikz} environment: use \texttt{tikzpicture} (which is really the same thing, see the FAQ~\ref{faqs:externalize}).
\subsection{Scale factor inaccuracies}\label{sec:usefpu}
@@ -246,6 +249,7 @@ The \texttt{use fpu reciprocal} key seems to have no side effects, but given tha
Here, we will provide a list of incompabilities between different version of \Circuitikz. We will try to hold this list short, but sometimes it is easier to break with old syntax than include a lot of switches and compatibility layers. In general, changes that would invalidate a circuit (changes of polarity of components and so on) are almost always protected by a flag; the same is not true for purely aesthetic changes.
If unsure, you can check the version in your local installation by using the macro \verb!\pgfcircversion{}!.
\begin{itemize}
+ \item Version \texttt{1.6.0} has a big rewrite of the block's code. In principle the changes are backward-compatible, but there were several bugs (wrong anchors, errors with rotations, and so on) that have been fixed in the process.
\item Since \texttt{v1.5.1}\footnote{Do not use \texttt{v1.5.0}, it's buggy.} color management (see section~\ref{sec:colors}) and the details of how the shapes are drawn and protected by the external drawing options has changed. There should be no substantial changes to the circuits, though.
\item The \TikZ{} fix for \texttt{to[...] +(x,y)} behavior (see~\ref{sec:path-relative-coordinates}) uncovered a bug in the positioning of the labels in \Circuitikz{} that had been present since \texttt{v0.8}. So you \textbf{must} upgrade to \texttt{v1.4.1} or better if you have \TikZ{} newer than \texttt{3.1.8} (and you want/need to use the \texttt{+(x,y)} syntax).
\item There have been changes in (internal) parameters for capacitors in \texttt{v1.4.1}; now to change them you should use the style interface (see~\ref{sec:capacitors-styling}).
@@ -1705,7 +1709,7 @@ Basically, to write the style \texttt{example}, you edit a file named \texttt{ct
This kind of style will \emph{add} to the existing style. If you want to have a style that \emph{substitute} the current style, you should do like this:
\begin{lstlisting}[frame=single, framesep=10pt]
-\ctikzloadstyle{legacy}% start from a know state
+\ctikzloadstyle{legacy}% start from a known state
\tikzset{romano circuit style/.style={%
legacy circuit style, % load the legacy style
\circuitikzbasekey/.cd,%
@@ -2019,9 +2023,9 @@ If \texttt{americanresistors} option is active (or the style \texttt{[american r
\begin{groupdesc}
\ctikzset{resistor=american}
\circuitdescbip[resistor]{R}{Resistor}{american resistor}
- \circuitdescbip[vresistor]{vR}{Variable resistor}{variable american resistor}
- \circuitdescbip[potentiometer]{pR}{Potentiometer}{american potentiometer}( wiper/0/0.3 )
- \circuitdescbip[resistivesens]{sR}{Resistive sensor}{american resistive sensor}( label/0/0.3 )
+ \circuitdescbip[vresistor]{vR}{Variable resistor}{variable american resistor}(wiper/180/0.3, tip/0/0.3)
+ \circuitdescbip[potentiometer]{pR}{Potentiometer}{american potentiometer}(wiper/0/0.3, tip/135/0.2)
+ \circuitdescbip[resistivesens]{sR}{Resistive sensor}{american resistive sensor}(label/0/0.3, wiper/180/0.3, tip/0/0.3)
\circuitdescbip*[ldresistor]{ldR}{Ligth-Dependent resistor}{american light dependent resistor}(arrows/-45/0.3)
\end{groupdesc}
@@ -2029,9 +2033,9 @@ If instead \texttt{europeanresistors} option is active (or the style \texttt{[e
\begin{groupdesc}
\ctikzset{resistor=european}
\circuitdescbip*[generic]{R}{Resistor}{european resistor}
- \circuitdescbip*[tgeneric]{vR}{Variable resistor}{variable european resistor}
- \circuitdescbip*[genericpotentiometer]{pR}{Potentiometer}{european potentiometer}( wiper/0/0.3 )
- \circuitdescbip*[thermistor]{sR}{Resistive sensor}{european resistive sensor}( label/0/0.3 )
+ \circuitdescbip*[tgeneric]{vR}{Variable resistor}{variable european resistor}(wiper/180/0.3, tip/0/0.3)
+ \circuitdescbip*[genericpotentiometer]{pR}{Potentiometer}{european potentiometer}(wiper/0/0.3, tip/135/0.2)
+ \circuitdescbip*[thermistor]{sR}{Resistive sensor}{european resistive sensor}(label/0/0.3, wiper/180/0.3, tip/0/0.3)
\circuitdescbip*[ldgeneric]{ldR}{Ligth-Dependent resistor}{european light dependent resistor}(arrows/-45/0.3)
\ctikzset{resistor=american} % reset default
\end{groupdesc}
@@ -2063,6 +2067,23 @@ Since version \texttt{0.9.5}, you can control the position of the wiper in poten
\end{circuitikz}
\end{LTXexample}
+Since version \texttt{1.6.0}, potentiometers and variable resistors have extra anchors\footnote{Thanks to a suggestion by \href{https://github.com/circuitikz/circuitikz/issues/663}{Dr. Matthias Jung on GitHub}}, to allow this kind of circuits (that seems to be common in some region):
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[european]
+ \draw (0,0) to[battery2, l=E] ++(0,4.5)
+ -- ++(2,0) coordinate(tmp)
+ to[vR, l2_=$P_1$ and \SI{10}{\kohm}, mirror,
+ invert, name=P]
+ (0,0-|tmp) -- (0,0);
+ \draw (0,0-|tmp) -- ++(1.5,0)
+ to[R=$R_1$, -*] ++(0,2) coordinate(p)
+ |- (P.wiper);
+ \draw (p) to[rmeterwa, t=V] (tmp-|p) -- (tmp);
+\end{circuitikz}
+\end{LTXexample}
+
+
\subsubsection{Generic sensors anchors}\label{sec:sensors-anchors}
Generic sensors have an extra anchor named \texttt{label} to help position the type of dependence, if needed:
@@ -2141,8 +2162,8 @@ For the \texttt{photoresistor} and the two ``flavors'' of the light-dependent re
\circuitdescbip*{capacitor}{Capacitor}{C}
\circuitdescbip*[ccapacitor]{curved capacitor}{Curved (polarized) capacitor}{cC}
\circuitdescbip*{ecapacitor}{Electrolytic capacitor}{eC,elko}
- \circuitdescbip*[vcapacitor]{variable capacitor}{Variable capacitor}{vC}
- \circuitdescbip*[capacitivesens]{capacitive sensor}{Capacitive sensor}{sC}(label/0/0.3)
+ \circuitdescbip*[vcapacitor]{variable capacitor}{Variable capacitor}{vC}(wiper/180/0.3, tip/0/0.3)
+ \circuitdescbip*[capacitivesens]{capacitive sensor}{Capacitive sensor}{sC}(label/0/0.3, wiper/180/0.3, tip/0/0.3)
\circuitdescbip*{piezoelectric}{Piezoelectric Element}{PZ}
\circuitdescbip*{cpe}{Constant Phase Element}{cpe}
\circuitdescbip*[ferrocap]{feC}{Ferroelectric capacitor\footnotemark}{ferrocap}(kink left/180/0.2, kink right/0/0.2, curve left/160/0.3, curve right/-20/0.2, center/45/0.3)
@@ -2207,24 +2228,24 @@ If the \texttt{cuteinductors} option is active (default behaviour), or the style
\begin{groupdesc}
\ctikzset{inductor=cute}
\circuitdescbip[cuteinductor]{L}{Inductor}{cute inductor}(midtap/90/0.1)
- \circuitdescbip[vcuteinductor]{vL}{Variable inductor}{variable cute inductor}(core west/135/0.1, core east/45/0.1)
- \circuitdescbip[scuteinductor]{sL}{Inductive sensor}{cute inductive sensor}(label/0/0.3)
+ \circuitdescbip[vcuteinductor]{vL}{Variable inductor}{variable cute inductor}(wiper/180/0.3, tip/0/0.3)
+ \circuitdescbip[scuteinductor]{sL}{Inductive sensor}{cute inductive sensor}(label/0/0.3, wiper/180/0.3, tip/0/0.3)
\end{groupdesc}
If the \texttt{americaninductors} option is active (or the style \texttt{[american inductors]} is used), the inductors are displayed as follows:
\begin{groupdesc}
\ctikzset{inductor=american}
\circuitdescbip[americaninductor]{L}{Inductor}{american inductor}(midtap/90/0.3)
- \circuitdescbip[vamericaninductor]{vL}{Variable inductor}{variable american inductor}(core west/135/0.1, core east/45/0.1)
- \circuitdescbip[samericaninductor]{sL}{Inductive sensor}{american inductive sensor}( label/0/0.3 )
+ \circuitdescbip[vamericaninductor]{vL}{Variable inductor}{variable american inductor}(core west/135/0.1, core east/45/0.1, wiper/180/0.3, tip/90/0.1)
+ \circuitdescbip[samericaninductor]{sL}{Inductive sensor}{american inductive sensor}(label/0/0.3, wiper/180/0.3, tip/0/0.3)
\end{groupdesc}
Finally, if the \texttt{europeaninductors} option is active (or the style \texttt{[european inductors]} is used), the inductors are displayed as follows:
\begin{groupdesc}
\ctikzset{inductor=european}
\circuitdescbip[fullgeneric]{L}{Inductor}{european inductor}(midtap/90/0.1)
- \circuitdescbip[tfullgeneric]{vL}{Variable inductor}{variable european inductor}(core west/135/0.1, core east/45/0.1)
- \circuitdescbip[sfullgeneric]{sL}{Inductive sensor}{european inductive sensor}( label/0/0.3 )
+ \circuitdescbip[tfullgeneric]{vL}{Variable inductor}{variable european inductor}(wiper/180/0.3, tip/90/0.1,core west/135/0.1, core east/45/0.1)
+ \circuitdescbip[sfullgeneric]{sL}{Inductive sensor}{european inductive sensor}(label/0/0.3, wiper/180/0.3, tip/0/0.3)
\ctikzset{inductor=cute} % back to default
\end{groupdesc}
@@ -3406,12 +3427,15 @@ You can use the \texttt{plug center} anchor to add the IEC ``multiplier'':
\begin{groupdesc}
\circuitdesc*{mixer}{mixer}{}( w/180/0.1,s/-90/0.1,e/0/0.1,n/90/0.1, center/-120/0.3, geocenter/-60/.3 )
+ \circuitdesc*{mixer, boxed}{mixer, boxed}{}(right up/30/0.1, right down/-30/0.1, left up/150/0.1, left down/-150/0.1)
\circuitdesc*{adder}{adder}{}( west/180/0.1,south/-90/0.1,east/0/0.1,north/90/0.1 )
\circuitdesc*{oscillator}{oscillator}{}( w/180/0.1,s/-90/0.1,e/0/0.1,n/90/0.1, center/45/0.2, geocenter/-45/.3 )
\circuitdesc*{circulator}{circulator}{}( left/180/0.1,down/-90/0.1,right/0/0.1, up/90/0.1 )
\circuitdesc*{wilkinson}{wilkinson divider}{}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
\circuitdesc*{splitter}{resistive splitter\footnotemark}{}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
\footnotetext{added by \texttt{matthuszagh}}
+ \circuitdesc*{genericsplitter}{generic splitter\footnotemark}{$\SI{-3}{\deci\bel}$}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
+ \footnotetext{added by \texttt{frankplow}}
\circuitdesc*{gridnode}{gridnode\footnotemark}{}(left/135/0.2, right/45/0.2, center/-100/0.4, up/90/0.2, down/-45/.2)
\footnotetext{added by \texttt{olfline}}
\circuitdesc*{mzm}{Mach Zehnder Modulator\footnotemark}{}( in/180/0.1, mod/90/0.1, out/0/0.1)
@@ -3419,9 +3443,10 @@ You can use the \texttt{plug center} anchor to add the IEC ``multiplier'':
\end{groupdesc}
\begin{groupdesc}
- \circuitdescbip*{twoport}{generic two port (use \texttt{t=\dots} to specify text)}{}
- \circuitdescbip*{twoportsplit}{generic two port split (use \texttt{t1=\dots} and \texttt{t2=\dots} to specify text)}{}
+ \circuitdescbip*{twoport}{generic two port (use \texttt{t=\dots} to specify text)}{}(w/180/0.1,s/-90/0.1,e/0/0.1,n/90/0.1, center/-120/0.3)
+ \circuitdescbip*{twoportsplit}{generic two port split (use \texttt{t1=\dots} and \texttt{t2=\dots} to specify text)}{}(right up/30/0.1, right down/-30/0.1, left up/150/0.1, left down/-150/0.1)
\circuitdescbip*{vco}{vco}{}
+ \circuitdescbip*{vco,box}{vco,box}{}(right up/30/0.1, right down/-30/0.1, left up/150/0.1, left down/-150/0.1)
\circuitdescbip*{bandpass}{bandpass}{}
\circuitdescbip*{bandstop}{bandstop}{}
\circuitdescbip*{highpass}{highpass}{}
@@ -3442,12 +3467,14 @@ You can use the \texttt{plug center} anchor to add the IEC ``multiplier'':
\circuitdescbip*{phaseshifter}{phase shifter}{}
\circuitdescbip*{vphaseshifter}{var.\ phase shifter}{}
\circuitdescbip*{detector}{detector}{}
- \circuitdescbip*{sdcdc}{single wire DC/DC converter\footnotemark}{}
+ \circuitdescbip*{sdcdc}{single wire DC/DC converter\footnotemark}{}(dc up in/135/.3, dc down in/185/.3, dc up out/45/.3, dc down out/-35/.3)
\footnotetext{the converter blocks added by \texttt{olfline}}
- \circuitdescbip*{sacdc}{single phase AC/DC converter}{}
- \circuitdescbip*{sdcac}{single phase DC/AC converter}{}
- \circuitdescbip*{tacdc}{three phases AC/DC converter}{}
- \circuitdescbip*{tdcac}{three phases AC/DC converter}{}(left/170/0.5, right/5/0.5, center/-90/0.3, ac1/45/0.1, ac2/-5/.3, ac3/-45/.1, dc1/135/.3, dc2/185/.3)
+ \circuitdescbip*{sacdc}{single phase AC/DC converter}{}(ac up in/135/.3, ac down in/185/.3, dc up out/45/.3, dc down out/-35/.3)
+ \circuitdescbip*{sdcac}{single phase DC/AC converter}{}(dc up in/135/.3, dc down in/185/.3, ac up out/45/.3, ac down out/-35/.3)
+ \circuitdescbip*{sacac}{single phase AC/AC converter}{}(ac up in/135/.3, ac down in/185/.3, ac up out/45/.3, ac down out/-35/.3)
+ \circuitdescbip*{tacdc}{three phases AC/DC converter}{}(ac up in/135/.3, ac mid in/185/.3, ac down in/-135/.3, dc up out/45/.3, dc down out/-35/.3)
+ \circuitdescbip*{tdcac}{three phases AC/DC converter}{}(ac up out/45/0.1, ac mid out/-5/.3, ac down out/-45/.1, dc up in/135/.3, dc down in/185/.3)
+ \circuitdescbip*{tacac}{three phases AC/DC converter}{}(ac up in/135/.3, ac mid in/185/.3, ac down in/-135/.3, ac up out/45/.3, ac mid out/-5/.3, ac down out/-45/.3)
\end{groupdesc}
\begin{groupdesc}
@@ -3470,6 +3497,39 @@ The ports of the \texttt{mixer}, \texttt{adder}, \texttt{oscillator} and \texttt
;\end{circuitikz}
\end{LTXexample}
+In addition, since \texttt{v1.6.0}, most blocks have also the \texttt{left up}, \texttt{left down}, \texttt{right up} and \texttt{right down} anchors:
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+ (0,0) to[bandpass, name=bp] ++(2,0)
+ (bp.left up) node[circ, red]{}
+ (bp.left down) node[circ, blue]{}
+ (bp.right up) node[circ, green]{}
+ (bp.right down) node[circ, yellow]{}
+;\end{circuitikz}
+\end{LTXexample}
+
+You can use those anchors to build ``mixed-type'' circuits, positioning the node-shapes:
+\begin{LTXexample}[pos=t, varwidth=true]
+\begin{tikzpicture}[
+ big/.style={circuitikz/blocks/scale=1.5},
+ long/.style={circuitikz/bipoles/twoportsplit/width=1.5}]
+ \path (0,0) node[sacdcshape, big](A){}
+ (5,0) node[twoportsplitshape, big, long, t1=LNA, t2=Digital](B){};
+ \draw (A.right up) -- (B.left up) (A.right down) to[cute choke] (B.left down);
+\end{tikzpicture}
+\end{LTXexample}
+Notice also form the previous example that the generic blocks (\texttt{twoport} and \texttt{twoportsplit}) can be made ``longer'' by setting different \texttt{width} and \texttt{height} (the other blocks are square, and just use the \texttt{width} key for bth dimensions).
+O
+Also, for \texttt{amp} and \texttt{vamp}, the \texttt{up} and \texttt{down} anchors follow the shape when they are not boxed.
+\begin{LTXexample}[varwidth=true]
+\begin{tikzpicture}
+ \draw (0,0) to[vamp, name=a] ++(1.5,0)
+ to [vamp, boxed, name=ab] ++(1.5,0);
+ \path (a.up) node[circ, blue]{} (ab.up) node[circ, blue]{};
+ \path (a.down) node[circ, red]{} (ab.down) node[circ, red]{};
+\end{tikzpicture}
+\end{LTXexample}
+
The \texttt{oscillator} has a displaced \texttt{center} anchor, to simplify the task of putting it at the left side of a circuit; it also as a special position for the node text. The four round elements (mixer, circulator, adder, and the oscillator) have a \texttt{geocenter} anchor which corresponds always to the center of the circle.
\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
\begin{tikzpicture}[>=Stealth]
@@ -3635,14 +3695,21 @@ Several devices have the possibility to add a box around them with the \texttt{b
\paragraph{Dash optional parts}
-To show that a device is optional, you can dash it. The inner symbol will be kept with solid lines.
+To show that a device is optional, you can dash it. The inner symbol will be kept with solid lines, unless you set the key \texttt{inner blocks dashed} to true.
+Moreover, the key \texttt{dashed blocks pattern} (default \verb|{{1mm}{1mm}}|), be careful with the number of braces!.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
-\draw (0,2) to[amp,l=\SI{10}{dB}] ++(2.5,0);
-\draw[dashed] (2.5,2) to[lowpass,l=opt.] ++(2.5,0);
+\draw (0,1.5) to[amp,l=\SI{10}{dB}] ++(2.5,0);
+\draw[dashed] (2.5,1.5) to[lowpass,l=opt.] ++(2.5,0);
% or just the block
\draw (0,0) to[amp,l=\SI{10}{dB}] ++(2.5,0)
to[lowpass,l=opt., dashed] ++(2.5,0);
+% or everything
+\ctikzset{inner blocks dashed,
+ dashed blocks pattern={{1.5pt}{1pt}},
+}
+\draw (0,-1.5) to[amp,l=\SI{10}{dB}] ++(2.5,0)
+ to[lowpass,l=opt., dashed] ++(2.5,0);
\end{circuitikz}
\end{LTXexample}
@@ -3692,19 +3759,52 @@ Basically they are the same as the normal \texttt{npn} and \texttt{pnp}, and the
\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor Borsche. Use the package options \texttt{fetsolderdot}/\texttt{nofetsolderdot} to enable/disable solderdot at some fet-transistors. Additionally, the solderdot option can be enabled/disabled for single transistors with the option \texttt{solderdot} and \texttt{nosolderdot}, respectively.
\begin{groupdesc}
- \circuitdesc{nfet}{nfet}{Q}
- \circuitdesc{nfetd}{nfet depletion}{Q}
- \circuitdesc{nigfete}{nigfete}{Q}
+ \circuitdesc{nfet}{nfet}{Q}(G/180/0.1, D/0/0.1, S/0/0.1)
+ \circuitdesc{nfetd}{nfet depletion}{Q}(G/180/0.1, D/0/0.1, S/0/0.1)
+ \circuitdesc{nigfete}{nigfete}{Q}(G/180/0.1, D/0/0.1, S/0/0.1)
\circuitdesc{nigfete,solderdot}{nigfete}{}(centergap/0/0.5)
\circuitdesc{nigfetebulk}{nigfetebulk}{}
\circuitdesc{nigfetd}{nigfetd}{}(centergap/0/0.5)
- \circuitdesc{pfet}{pfet}{Q}
- \circuitdesc{pfetd}{pfet depletion}{Q}
- \circuitdesc{pigfete}{pigfete}{}(centergap/0/0.5)
+ \circuitdesc{pfet}{pfet}{Q}(G/180/0.1, D/0/0.1, S/0/0.1)
+ \circuitdesc{pfetd}{pfet depletion}{Q}(G/180/0.1, D/0/0.1, S/0/0.1)
+ \circuitdesc{pigfete}{pigfete}{}(centergap/0/0.5, G/180/0.1, D/0/0.1, S/0/0.1)
\circuitdesc{pigfetebulk}{pigfetebulk}{}
\circuitdesc{pigfetd}{pigfetd}{}
\end{groupdesc}
+Since version \texttt{1.6.0}, you can add the \texttt{doublegate} option to the \texttt{*igfet*} family of devices to have a double gate MOS --- the additional gate is called \texttt{G2} or \texttt{gate2} (the plain \texttt{G} is where it will be without the \texttt{doublegate} option).
+
+\begin{groupdesc}
+ \circuitdesc{nigfete, doublegate}{nigfete, doublegate}{Q}(G/180/0.1, G2/180/0.1, D/0/0.1, S/0/0.1)
+ \circuitdesc{nigfete,solderdot, doublegate}{nigfete, doublegate}{}(G1/180/0.1, centergap/0/0.5, G2/180/0.1)
+ \circuitdesc{nigfetebulk, doublegate}{nigfetebulk, doublegate}{}(G/180/0.1, G2/180/0.1)
+ \circuitdesc{nigfetd, doublegate}{nigfetd, doublegate}{}(G1/180/0.1, centergap/0/0.5, G2/180/0.1)
+ \circuitdesc{pigfete, doublegate}{pigfete, doublegate}{}(G/180/0.1, centergap/0/0.5, G2/180/0.1, D/0/0.1, S/0/0.1)
+ \circuitdesc{pigfetebulk, doublegate}{pigfetebulk, doublegate}{}(G/180/0.1, G2/180/0.1)
+ \circuitdesc{pigfetd, doublegate}{pigfetd, doublegate}{}(G1/180/0.1, G2/180/0.1)
+\end{groupdesc}
+
+You can use the double-gated transistor for example like this:%
+\footnote{Found at \href{https://www.electronics-notes.com/articles/electronic_components/fet-field-effect-transistor/dual-gate-mosfet.php}{this page on electronics notes}.}
+
+\begin{LTXexample}[varwidth=true, basicstyle=\scriptsize\ttfamily]
+\begin{circuitikz}[european, scale=0.7, transform shape,
+ circuitikz/resistors/scale=0.7]
+ \draw (0,0) to[C, o-*] ++(1,0) coordinate(in)
+ to[R, -*] ++(0,-3) coordinate(GND)
+ ++(1,0) to[C, *-] ++(0,4) -- ++(1,0) coordinate(div)
+ to[R, *-*] ++(0,2) coordinate(vdd)
+ (div) to[R, -*] (div|-GND)
+ (in) -- ++(2.5,0) node[nigfetd, doublegate, anchor=G1](Q){Q}
+ (Q.G2) to[short, -*] (Q.G2-|div)
+ (Q.D) to[R, -*] (Q.D|-vdd)
+ (Q.D) to[C, *-o] ++(2,0) coordinate(out)
+ (Q.S) to[R, *-*] (Q.S|-GND) (Q.S) -- ++(1,0) coordinate(Sd)
+ (Sd) to[C, -*] (Sd |- GND);
+ \draw (0,0|-GND) -- (out|-GND) (0,0|-vdd) -- (out|-vdd);
+\end{circuitikz}
+\end{LTXexample}
+
\textsc{JFET} are also available\footnote{based on code provided by Danilo Piazzalunga}, both n-type and p-type.
\begin{groupdesc}
@@ -8136,6 +8236,24 @@ This could be especially useful if you define a style, to use like this:
\end{circuitikz}
\end{LTXexample}
+\subsubsection{Combining different styles}\label{sec:mixing-voltage-styles}
+
+Due to an historical hiccup, you need to be careful if you want to mix styles, like for example having \texttt{american} styled components and straight voltages (which are basically \texttt{european} style, at least in \Circuitikz{}). The problem is that the order of style parameters can change the output\footnote{%
+thanks to Stack Exchange user \href{https://tex.stackexchange.com/q/665466/38080}{Mads P Olesen} for noticing.} as you can see in the following example, where in the red case the voltage generator shape reverted to the \texttt{european} one.
+
+\begin{LTXexample}
+\begin{circuitikz}[straight voltages, american]
+ \draw (0,0) to [V, v=$V_P$] ++(0,3);
+ \draw (1,0) to [R, v=$V_P$] ++(0,3);
+\end{circuitikz}\color{red}%
+\begin{circuitikz}[american, straight voltages]
+ \draw (0,0) to [V, v=$V_P$] ++(0,3);
+ \draw (1,0) to [R, v=$V_P$] ++(0,3);
+\end{circuitikz}
+\end{LTXexample}
+
+This is arguably a bug, but fixing it (separating the voltage generator shapes from the voltage style) would break havoc with older circuits, so this will not be fixed for now.
+
\subsection{Changing the style of labels, voltages, and other text ornaments}\label{sec:ornament-style}
@@ -8843,7 +8961,7 @@ To correct the line ending, there are support shapes to fill the missing rectang
\section{Colors}\label{sec:colors}
-Color support in \Circuitikz{} has been quite limited up to version 1.5.1; form that one onward there has been an effort to make component's behavior more intuitive.
+Color support in \Circuitikz{} has been quite limited up to version 1.5.1; from that one onward there has been an effort to make component's behavior more intuitive.
Part of the problem is how colors in paths are treated by \TikZ{} itself; you can see part of the discussion \href{https://github.com/circuitikz/circuitikz/issues/605}{this issue} and in \href{https://tex.stackexchange.com/questions/634987/pgf-basic-layer-struggling-again-with-colors}{this question on TeX.SX} --- many thanks to \texttt{@muzimuzhi} for helping there. Basically, nodes are drawn \emph{after} the path is completed, and color is applied to the path at the end. Look at this code (pure \TikZ, no \Circuitikz{} here):
@@ -9090,7 +9208,7 @@ Also, since \texttt{v1.2.3}, you can set the key \texttt{open poles fill} (defau
in your preamble.
-But really, your circuit definition is buggy, so the best thing to do is fix that; if you want to name a point in you circuit, you should use a \texttt{coordinate}, not a \texttt{node}.\footnote{Yes, I understand from where the confusion arise --- in circuit theory they are called nodes.} Here is a small tutorial on \emph{why} you should change your circuit.
+But really, your circuit definition is buggy, so the best thing to do is fix that; if you want to name a point in your circuit, you should use a \texttt{coordinate}, not a \texttt{node}.\footnote{Yes, I understand from where the confusion arise --- in circuit theory they are called nodes.} Here is a small tutorial on \emph{why} you should change your circuit.
Nodes, in \TikZ, have normally a non-zero size even when they are empty; moreover, connections are supposed to join the border of nodes. Please study the following (pure \TikZ, not \Circuitikz):
@@ -9582,7 +9700,7 @@ The best way of contributing is forking the project, adding your component in th
\section{Examples}
-Here a series of example, contributed by several people, is shown with their code.
+Here a series of examples, contributed by several people, is shown with their code.
\subsection{A red diode}
@@ -9851,20 +9969,23 @@ Here a series of example, contributed by several people, is shown with their cod
\begin{LTXexample}[varwidth=true,pos=t]
\begin{circuitikz}[smallR/.style={european resistor, resistors/scale=0.5}]
- \draw (0,0) node[tacdcshape, anchor=ac2](acdc){} to[smallR] ++(-2,0)
+ \draw (0,0) node[tacdcshape, anchor=ac mid in](acdc){} to[smallR] ++(-2,0)
-- coordinate(point) node[circ](){} ++(-.5,0);
- \draw (acdc.ac1) to[nos, invert, mirror, name=switch,color=red] ++(-2,0) -- (point);
- \draw (acdc.ac3) to[smallR] ++(-2,0)
+ \draw (acdc.ac up in)
+ to[nos, invert, mirror, name=switch,color=red] ++(-2,0)
+ -- (point);
+ \draw (acdc.ac down in) to[smallR] ++(-2,0)
-- (point)
to[oosourcetrans,prim=wye,sec=delta,l=transformer] ++(-1.5,0)
to[tmultiwire] ++(-.5,0)
node[gridnode, anchor=right]{};
\node[above=.3cm,color=red] at (switch) {fault};
- \draw (acdc.dc1) to[smallR,l=HVDC line] ++(2,0 )
- node[tdcacshape, anchor=dc1](dcac){};
- \draw (acdc.dc2) -- (dcac.dc2);
- \draw (dcac.right) to[ooosource,prim=delta,sec=delta,tert=wye,invert] ++(1.5,0)
- to[tmultiwire] ++(.5,0) node[gridnode,anchor=left]{};
+ \draw (acdc.dc up out) to[smallR,l=HVDC line] ++(2,0 )
+ node[tdcacshape, anchor=dc up in](dcac){};
+ \draw (acdc.dc down out) -- (dcac.dc down in);
+ \draw (dcac.right)
+ to[ooosource,prim=delta,sec=delta,tert=wye,invert] ++(1.5,0)
+ to[tmultiwire] ++(.5,0) node[gridnode,anchor=left]{};
\end{circuitikz}
\end{LTXexample}
diff --git a/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty b/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
index 8ed0088ca20..3ab0187228b 100644
--- a/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
+++ b/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
@@ -106,7 +106,7 @@
}
%% New circuit description macros
\newcommand{\twopartbox}[2]{%
- \leavevmode\null\par\noindent\fbox{\parbox[c]{0.3\linewidth}{#1} \parbox[c]{0.6\linewidth}{\RaggedRight #2}\par\noindent}%
+ \leavevmode\null\par\noindent\fbox{\parbox[c]{0.3\linewidth}{#1} \parbox[c]{0.6\linewidth}{\RaggedRight\hbadness=9500 #2}\par\noindent}%
}
% filling color for filled-enabled component
\colorlet{fillcol}{cyan!30!white}
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}