summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-06-16 22:04:20 +0000
committerKarl Berry <karl@freefriends.org>2019-06-16 22:04:20 +0000
commit588cee1666f2db2a58b592abbde6111eeab979a9 (patch)
tree3b6a3e79577707e820dea7ec7609a0bffa0555ed /Master
parent361113517781be1c859fe04b53b0886f8737ab42 (diff)
circuitikz (16jun19)
git-svn-id: svn://tug.org/texlive/trunk@51387 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/context/third/circuitikz/circuitikz-context.pdfbin12722 -> 12669 bytes
-rw-r--r--Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md38
-rw-r--r--Master/texmf-dist/doc/generic/circuitikz/README.md32
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/changelog.tex30
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdfbin536781 -> 646978 bytes
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex761
-rw-r--r--Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty26
-rw-r--r--Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex4
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex191
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex109
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex10
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex57
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex470
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex53
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex460
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex173
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex384
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.4.sty10127
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.6.sty10290
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.7.sty10682
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.8.3.sty11141
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty10
22 files changed, 44403 insertions, 645 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 af1d7cd4415..af66a5b1612 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 5160dc4bb6b..3b9596ae157 100644
--- a/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
+++ b/Master/texmf-dist/doc/generic/circuitikz/CHANGELOG.md
@@ -1,19 +1,33 @@
<!--- 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 0.9.1
+ - Added old LaTeX versions for 0.8.3, 0.7, 0.6 and 0.4
+ - Added the option to have inline transformers and gyrators
+ - Added rotary switches
+ - Added more configurable bipole nodes (connectors) and more shapes
+ - Added 7-segment displays
+ - Added vacuum tubes by J. op den Brouw
+ - Made the open shape of dcisources configurable
+ - Made the arrows on vcc and vee configurable
+ - Fixed anchors of diamondpole nodes
+ - Fixed a bug (#205) about unstable anchors in the chip components
+ - Fixed a regression in label placement for some values of scaling
+ - Fixed problems with cute switches anchors
+
* Version 0.9.0 (2019-05-10)
- Added Romano Giannetti as contributor
- Added a CONTRIBUTING file
- - Added options for solving the voltage direction problems.
+ - Added options for solving the voltage direction problems.
- Adjusted ground symbols to better match ISO standard, added new symbols
- - Added new sources (cute european versions, noise sources)
+ - Added new sources (cute european versions, noise sources)
- Added new types of amplifiers, and option to flip inputs and outputs
- - Added bidirectional diodes (diac) thanks to Andre Lucas Chinazzo
+ - Added bidirectional diodes (diac) thanks to Andre Lucas Chinazzo
- Added L,R,C sensors (with european, american and cute variants)
- Added stacked labels (thanks to the original work by Claudio Fiandrino)
- Make the position of voltage symbols adjustable
- Make the position of arrows in FETs and BJTs adjustable
- - Added chips (DIP, QFP) with a generic number of pins
+ - Added chips (DIP, QFP) with a generic number of pins
- Added special anchors for transformers (and fixed the wrong center anchor)
- Changed the logical port implementation to multiple inputs (thanks to John Kormylo) with border anchors.
- Added several symbols: bulb, new switches, new antennas, loudspeaker, microphone, coaxial connector, viscoelastic element
@@ -26,8 +40,8 @@ The major changes among the different circuitikz versions are listed here. See <
- Fixed a bug about straightlabels (thanks to @fotesan)
- Fixed labels spacing so that they are independent on scale factor
- Fixed the position of text labels in amplifiers
-
-* Version 0.8.3 (2017-05-28)
+
+* Version 0.8.3 (2017-05-28)
- Removed unwanted lines at to-paths if the starting point is a node without a explicit anchor.
- Fixed scaling option, now all parts are scaled by bipoles/length
- Surge arrester appears no more if a to path is used without []-options
@@ -37,7 +51,7 @@ The major changes among the different circuitikz versions are listed here. See <
- Adjustable default distance for straight-voltages: 'bipoles/voltage/straight label distance'
- Added Symbol for bandstop filter
- New annotation type to show flows using f=... like currents, can be used for thermal, power or current flows
-
+
* Version 0.8.2 (2017-05-01)
- Fixes pgfkeys error using alternatively specified mixed colors(see pgfplots manual section "4.7.5 Colors")
- Added new switches "ncs" and "nos"
@@ -47,13 +61,13 @@ The major changes among the different circuitikz versions are listed here. See <
- current label "i=" can now be used independent of the regular label "l=" at current sources
- rewrite of current arrow placement. Current arrows can now also be rotated on zero-length paths
- New DIN/EN compliant operational amplifier symbol "en amp"
-
+
* Version 0.8.1 (2017-03-25)
- Fixed unwanted line through components if target coordinate is a name of a node
- Fixed position of labels with subscript letters.
- Absolute distance calculation in terms of ex at rotated labels
- Fixed label for transistor paths (no label drawn)
-
+
* Version 0.8 (2017-03-08)
- Allow use of voltage label at a [short]
- Correct line joins between path components (to[...])
@@ -123,7 +137,7 @@ The major changes among the different circuitikz versions are listed here. See <
- added isfet
- added noiseless, protective, chassis, signal and reference grounds (Luigi «Liverpool»)
-* Version 0.2.4
+* Version 0.2.4
- added square voltage source (contributed by Alistair Kwan)
- added buffer and plain amplifier (contributed by Danilo Piazzalunga)
- added squid and barrier (contributed by Cor Molenaar)
@@ -142,7 +156,7 @@ The major changes among the different circuitikz versions are listed here. See <
- Variable capacitor
- polarized capacitor
- ConTeXt support (read the manual!)
- - nfet, nigfete, nigfetd, pfet, pigfete, pigfetd (contribution of Clemens Helfmeier and Theodor
+ - nfet, nigfete, nigfetd, pfet, pigfete, pigfetd (contribution of Clemens Helfmeier and Theodor
Borsche)
- njfet, pjfet (contribution of Danilo Piazzalunga)
- pigbt, nigbt
@@ -157,7 +171,7 @@ Borsche)
- new placing option for some tripoles (mostly transistors)
- mirror path style
-
+
* Version 0.2.2 - 20090520
- Added the shape for lamps.
- Added options \texttt{europeanresistor}, \texttt{europeaninductor}, \texttt{americanresistor} and \texttt{americaninductor}, with corresponding styles.
diff --git a/Master/texmf-dist/doc/generic/circuitikz/README.md b/Master/texmf-dist/doc/generic/circuitikz/README.md
index 6fcacd5369d..ee76ef64689 100644
--- a/Master/texmf-dist/doc/generic/circuitikz/README.md
+++ b/Master/texmf-dist/doc/generic/circuitikz/README.md
@@ -17,24 +17,38 @@ So I based everything with the very impressive (if somewhat verbose at times) Ti
The stable version is available on ctan and is included within the major latex distributions(Texlive, Miktex). If you want to test the latest version, have a look at http://circuitikz.github.io/circuitikz/. There you can find the latest git-version as a single file, just copy it to your project or to your local tex tree.
## Usage
+### Stable version
Just place
-````latex
+```latex
\usepackage{circuitikz}
-````
+```
or, for ConTeXt,
-````latex
+```latex
\usemodule[circuitikz]
-````
+```
in the preamble and compile away, both with PS and PDF target output.
-If you want to use or to try the git version, just append a git the package name:
-````latex
+### Development version
+
+If you want to use the git version, just append a git to the package name:
+```latex
\usepackage{circuitikzgit}
-````
+```
or, for ConTeXt,
-````latex
+```latex
\usemodule[circuitikzgit]
-````
+```
+
+### Older versions (v0.9.1 onwards)
+
+If you want to use older versions of `circuitikz`, just append the version number to the package name, as in `circuitikz-$version`:
+```latex
+ \usepackage{circuitikz-0.8.3}
+```
+or, for ConTeXt,
+```latex
+ \usemodule[circuitikz-0.8.3]
+```
## More Information
More Information can be found in the manual and at the wiki of the project located at https://github.com/circuitikz/circuitikz/wiki.
diff --git a/Master/texmf-dist/doc/latex/circuitikz/changelog.tex b/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
index 03932fa52a8..6dff87100c1 100644
--- a/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
+++ b/Master/texmf-dist/doc/latex/circuitikz/changelog.tex
@@ -6,6 +6,36 @@ full list of changes.
\begin{itemize}
\tightlist
\item
+ Version 0.9.1
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added old LaTeX versions for 0.8.3, 0.7, 0.6 and 0.4
+ \item
+ Added the option to have inline transformers and gyrators
+ \item
+ Added rotary switches
+ \item
+ Added more configurable bipole nodes (connectors) and more shapes
+ \item
+ Added 7-segment displays
+ \item
+ Added vacuum tubes by J. op den Brouw
+ \item
+ Made the open shape of dcisources configurable
+ \item
+ Made the arrows on vcc and vee configurable
+ \item
+ Fixed anchors of diamondpole nodes
+ \item
+ Fixed a bug (\#205) about unstable anchors in the chip components
+ \item
+ Fixed a regression in label placement for some values of scaling
+ \item
+ Fixed problems with cute switches anchors
+ \end{itemize}
+\item
Version 0.9.0 (2019-05-10)
\begin{itemize}
diff --git a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.pdf
index 9b9b163278d..46599c3840d 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 bbbfec74028..0b66a590029 100644
--- a/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
+++ b/Master/texmf-dist/doc/latex/circuitikz/circuitikzmanual.tex
@@ -6,18 +6,23 @@
% !TeX encoding = utf8
\documentclass[a4paper, titlepage]{article}
-\usepackage{a4wide} %smaller borders
+\usepackage{a4wide} % smaller borders
\usepackage{titling}
\def\modern{
\usepackage{fontspec}
- \defaultfontfeatures{Ligatures=TeX, Numbers=OldStyle,Mapping=tex-text ,SmallCapsFeatures={LetterSpace=8, Numbers=OldStyle}}
- %\setmainfont{Gentium Book Basic}
+ \defaultfontfeatures{
+ Ligatures=TeX,
+ Numbers=OldStyle,
+ Mapping=tex-text,
+ SmallCapsFeatures={LetterSpace=8, Numbers=OldStyle}
+ }
+ % \setmainfont{Gentium Book Basic}
}
-%do not split this line in more lines, otherwise "make git-manual" will show the wrong version
+% do not split this line in more lines, otherwise "make git-manual" will show the wrong version
\usepackage[siunitx, RPvoltages]{circuitikz}
-% Let this being the same as the chosen voltage direction for coherence
+% Let this be the same as the chosen voltage direction for coherence
\def\chosenvoltoption{RPvoltages}
\usepackage{ifxetex,ifluatex}
@@ -30,10 +35,10 @@
% pdflatex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
- %\usepackage{babel}
+ % \usepackage{babel}
\fi
\fi
-\def\tightlist{} %needed for latest pandoc-versions(pandoc used for including changelog)
+\def\tightlist{} % needed for latest pandoc-versions(pandoc used for including changelog)
\usepackage{microtype}
\sisetup{load=derived} % loading \siemens
@@ -46,10 +51,21 @@
\let\SX@Info=\relax % silence showexpl a bit...
\makeatother
%
-\lstset{pos=l,width=-99pt, overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,
- rframe=single,numbers=left,numberstyle=\tiny,numbersep=.3em, xleftmargin=1em,
- columns=flexible, language=[LaTeX]TEX,breaklines=true,
- basicstyle=\normalsize\ttfamily,tabsize=3}
+\lstset{
+ pos=l,
+ width=-99pt,
+ overhang=0pt,
+ hsep=\columnsep,
+ vsep=\bigskipamount,
+ rframe=single,
+ numbers=left,
+ numberstyle=\tiny,
+ numbersep=.3em,
+ xleftmargin=1em,
+ columns=flexible,
+ language=[LaTeX]TEX,breaklines=true,
+ basicstyle=\normalsize\ttfamily,tabsize=3
+}
\usepackage{booktabs}
\renewcommand{\arraystretch}{1.2}
@@ -58,15 +74,15 @@
\usepackage{hyperref}
\hypersetup{
bookmarks=false, % show bookmarks bar?
- pdftitle={CircuiTikZ \pgfcircversion\ - manual}, % title
- pdfauthor={Massimo Redaelli, Stefan Lindner, Stefan Erhardt, Romano Giannetti}, % author
+ pdftitle={CircuiTikZ \pgfcircversion\ - manual}, % title
+ pdfauthor={Massimo Redaelli, Stefan Lindner, Stefan Erhardt, Romano Giannetti}, % authors
pdfsubject={CircuiTikZ manual}, % subject of the document
- pdfkeywords={}, % list of keywords
- colorlinks=true, % false: boxed links; true: colored links
- linkcolor=black, % color of internal links
- citecolor=black, % color of links to bibliography
- filecolor=black, % color of file links
- urlcolor=black % color of external links
+ pdfkeywords={}, % list of keywords
+ colorlinks=true, % false: boxed links; true: colored links
+ linkcolor=blue, % color of internal links
+ citecolor=blue, % color of links to bibliography
+ filecolor=blue, % color of file links
+ urlcolor=blue % color of external links
}
\usepackage{imakeidx}
\usepackage{textcomp}
@@ -143,6 +159,8 @@ After he left University in 2010 the development of \Circuitikz\ slowed down, si
The use of \Circuitikz\ is, of course, not limited to academic teaching. The package gets widely used by engineers for typesetting electronic circuits for articles and publications all over the world.
+\subsection{License}
+Copyright \copyright\ 2007--2019 Massimo Redaelli. This package is author-maintained. Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX\ Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.
\subsection{Loading the package}
\begin{table}[h]
@@ -189,11 +207,14 @@ instead of \texttt{circuitikz}. This is also advantageous for ``future resilienc
So, if loaded with said option, one must write \verb!(0,0) to[*R] (2,0)! and, for transistors on a path, \verb!(0,0) to[*Tnmos] (2,0)!, and so on (but \verb!(0,0) node[nmos] {}!). See example at page~\pageref{ex:compatibility}.
-\subsection{License}
-Copyright \copyright\ 2007--2019 Massimo Redaelli. This package is author-maintained. Permission is granted to copy, distribute and/or modify this software under the terms of the \LaTeX\ Project Public License, version 1.3.1, or the GNU Public License. This software is provided ‘as is’, without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.
+\subsection{Known bugs and limitation}\label{sec:bugs}
-\subsection{Feedback}
-The easiest way to contact the authors is via the official Github repository: \url{https://github.com/circuitikz/circuitikz/issues}
+\Circuitikz{} will \textbf{not work} correctly with global (in the main \texttt{circuitikz} environment, or in \texttt{scope} environments) \emph{negative} scale parameters (\texttt{scale}, \texttt{xscale} or \texttt{yscale}), unless \texttt{transform shape} is also used, and even in this cases the behavior is not guaranteed.
+Neither it will work with angle-changing scaling (when \texttt{xscale} is different form \texttt{yscale}) and with the global \texttt{rotate} parameter.
+
+Correcting this will need a big rewrite of the path routines, and although the authors are thinking about solving it, don't hold your breath; it will need changing a lot of interwoven code (labels, voltages, currents and so on). Contributions and help would be highly appreciated.
+
+This same issue create a lot of problem of compatibility between \Circuitikz{} and the new \texttt{pic} Ti\emph{k}Z feature, so basically don't put components into \texttt{pic}s.
\subsection{Incompabilities between version}
@@ -207,7 +228,20 @@ You can check the used version at your local installation using the macro \verb!
\item Since v0.5.1: The parts pfet, pigfete, pigfetebulk and pigfetd are now mirrored by default. Please adjust your yscale-option to correct this.
\item Since v0.5: New voltage counting direction, here exists an option to use the old behaviour
\end{itemize}
-For older projects, you can use an older version locally using the git-version and picking the correct commit from the repository (branch gh-pages).
+
+If you have older projects that show compatibility problems, you have two options:
+\begin{itemize}
+ \item you can use an older version locally using the git-version and picking the correct commit from the repository (branch gh-pages) or the main GitHub site directly;
+ \item if you are using \LaTeX, the distribution has embedded several important old versions: \texttt{0.4}, \texttt{0.6}, \texttt{0.7} and \texttt{0.8.3}. To switch to use them, you simply change your \verb|\usepackage| invocation like
+ \begin{lstlisting}
+ \usepackage[]{circuitik-0.8.3} % or circuitikz-0.4, 0.6...
+ \end{lstlisting}
+ You have to take care of the options that may have changed between versions.
+\end{itemize}
+
+
+\subsection{Feedback}
+The easiest way to contact the authors is via the official Github repository: \url{https://github.com/circuitikz/circuitikz/issues}
\subsection{Package options}
\label{sec:package-options}
@@ -225,8 +259,8 @@ Feel free to load the package with your own cultural options:
\begin{center}
\begin{tabular}{ll}\toprule
- \LaTeX & \ConTeXt \\ \midrule
- \verb!\usepackage[american]{circuitikz}! & \verb!\usemodule[circuitikz][american]!\\
+ \LaTeX & \ConTeXt \\ \midrule
+ \verb!\usepackage[american]{circuitikz}! & \verb!\usemodule[circuitikz][american]!\\
\bottomrule
\end{tabular}
\end{center}
@@ -278,7 +312,7 @@ Feel free to load the package with your own cultural options:
\item \texttt{rotatelabels}: labels on bipoles are always printed aligned along the bipole;
\item \texttt{smartlabels}: labels on bipoles are rotated along the bipoles, unless the rotation is very close to multiples of 90°;
\item \texttt{compatibility}: makes it possibile to load \Circuitikz\ and \TikZ\ circuit library together.
- \item Voltage directions: until v0.8.3, there was an error in the coherence between american and european voltages styles (see section~\ref{curr-and-volt} for the batteries. This has been fixed, but to guarantee backward compatibility and nasty surprises, the fix is available with new options:
+ \item Voltage directions: until v0.8.3, there was an error in the coherence between american and european voltages styles (see section~\ref{curr-and-volt}) for the batteries. This has been fixed, but to guarantee backward compatibility and to avoid nasty surprises, the fix is available with new options:
\begin{itemize}
\item \texttt{oldvoltagedirection}: Use old way of voltage direction having a difference between european and american direction, with wrong default labelling for batteries;
\item \texttt{nooldvoltagedirection}: The standard from 0.5 onward, utilize the (German?) standard of voltage arrows in the direction of electric fields (without fixing batteries);
@@ -315,12 +349,12 @@ somewhere in your document preamble. It will load automatically the needed packa
\subsection{Getting started with \Circuitikz: a current shunt}
-Let's say we want to prepare a circuit to teach how a current shunt works; the idea is just draw a current generator, a couple of resistors in parallel, and the indication of currents and voltages for the discussion.
+Let's say we want to prepare a circuit to teach how a current shunt works; the idea is to draw a current generator, a couple of resistors in parallel, and the indication of currents and voltages for the discussion.
-A circuit in \Circuitikz is drawn into a \texttt{circuitikz} environment (which is really an alias for a \texttt{tikzpicture} one). In this first example we will use absolute coordinates.
-The electrical components can be divided in two big categories: the one that are bipoles and are placed along a path (also known as \texttt{to}-style component, for their usage) and components that are nodes and can have any number of poles, or connections.
+A circuit in \Circuitikz is drawn into a \texttt{circuitikz} environment (which is really an alias for \texttt{tikzpicture}). In this first example we will use absolute coordinates.
+The electrical components can be divided in two main categories: the one that are bipoles and are placed along a path (also known as \texttt{to}-style component, for their usage), and components that are nodes and can have any number of poles or connections.
-Let's start with the first type of components and build a basic mesh:
+Let's start with the first type of component, and build a basic mesh:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[]
@@ -329,7 +363,7 @@ Let's start with the first type of components and build a basic mesh:
\end{circuitikz}
\end{LTXexample}
-The symbol for the current source can surprise somebody; this is actually the european-style symbol, and the symbols chosen reflects the default options of loaded in the package (see section~\ref{sec:package-options}). Let's change the style for now (the author of the tutorial, Romano, is European but he has used since ever American style circuit, so\dots); and while at it, let add the other branch and some label.
+The symbol for the current source can surprise somebody; this is actually the european-style symbol, and the type of symbol chosen reflects the default options of the package (see section~\ref{sec:package-options}). Let's change the style for now (the author of the tutorial, Romano, is European - but he has always used American-style circuits, so \dots); and while we're at it, let's add the other branch and some labels.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ -407,10 +441,10 @@ And finally, this is still \TikZ, so that you can freely mix other graphics elem
\end{circuitikz}
\end{LTXexample}
-\subsection{A more complex tutorial: circuits Romano's style.}
+\subsection{A more complex tutorial: circuits, Romano style.}
\begingroup % do not propagate to the rest of the manual
-The idea is to draw a two-stage amplifier for a lesson, or exercise, on the different qualities of BJT an MOSFET transistors.
+The idea is to draw a two-stage amplifier for a lesson, or exercise, on the different qualities of BJT and MOSFET transistors.
Notice that this is a more ``personal'' tutorial, showing a way to draw circuits that is, in the author's opinion, highly reusable and easy to do.
The idea is using relative coordinates and named nodes as much as possible, so that changes in the circuit are easily done by changing keys numbers of position, and crucially, each block is reusable in other diagrams.
@@ -437,7 +471,7 @@ The idea is that you can use \verb|\coord()| instead of \verb|coordinate()| in p
After the circuit is drawn, simply commenting out the second definition of \verb|\coord| will hide all the markers.
-So let's start with the first stage transistor; given that my preferred way of drawing a MOSFET is with arrows, I'll start issuing the command \verb|\ctikzset{tripoles/mos style/arrows}|:
+So let's start with the first stage transistor; given that my preferred way of drawing a MOSFET is with arrows, I'll start with the command \verb|\ctikzset{tripoles/mos style/arrows}|:
\ctikzset{tripoles/mos style/arrows}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
@@ -450,7 +484,7 @@ So let's start with the first stage transistor; given that my preferred way of d
\end{circuitikz}
\end{LTXexample}
-Another thing I like to modify with respect to the standard is the position of the arrows in transistors, which are normally midway the symbol. Issuing the following settings will move the arrows to the end or start of the corresponding pin.
+Another thing I like to modify with respect to the standard is the position of the arrows in transistors, which are normally in the middle the symbol. Using the following settings will move the arrows to the start or end of the corresponding pin.
\ctikzset{tripoles/mos style/arrows,
tripoles/npn/arrow pos=0.8,
@@ -465,7 +499,7 @@ tripoles/nmos/arrow pos=0.8,
tripoles/pmos/arrow pos=0.6, }
\end{lstlisting}
-The tricky thing about \verb|\killdepth{}| macro is a finicky details; I do not like the standard position of labels on transistors (which is near the collector/drain) so I plot the label at the right of the \texttt{center} anchor. Without the \verb|\killdepth| macro, the labels of different transistor will be adjusted so that the center of the box is at the \texttt{center} anchor, and as an effect, labels with descenders (like Q) will have a different baseline than labels without. You can see this here (it's really subtle):
+The tricky thing about \verb|\killdepth{}| macro is finnicky details; I do not like the standard position of labels on transistors (which is near the collector/drain) so I plot the label at the right of the \texttt{center} anchor. Without the \verb|\killdepth| macro, the labels of different transistor will be adjusted so that the center of the box is at the \texttt{center} anchor, and as an effect, labels with descenders (like Q) will have a different baseline than labels without. You can see this here (it's really subtle):
\begin{LTXexample}[varwidth=true]
@@ -607,11 +641,11 @@ This is the final circuit, with the nodes still marked:
\section{The components}
-Components in \Circuitikz{} come in two forms: a path-style form, to be used in \texttt{to} path specifications, and node-style, which will be instantiated by a \texttt{node} specification.
+Components in \Circuitikz{} come in two forms: path-style, to be used in \texttt{to} path specifications, and node-style, which will be instantiated by a \texttt{node} specification.
\subsection{Path-style components}
-The path-style components are used as in the following way:
+The path-style components are used as shown below:
\begin{lstlisting}
\begin{circuitikz}
\draw (0,0) to[#1=#2, #options] (2,0);
@@ -625,7 +659,7 @@ Most path-style components can be used as a node-style components; to access the
\subsubsection{Anchors}
-Normally, path-style component do not need anchors, although they have them just in case you need them. You have the basic ``geographical'' anchors (bipoles are defined horizontally and then rotate as needed):
+Normally, path-style components do not need anchors, although they have them just in case you need them. You have the basic ``geographical'' anchors (bipoles are defined horizontally and then rotated as needed):
\begin{center}
\begin{circuitikz}[
]
@@ -797,6 +831,14 @@ If the component can be filled it will be specified in the description. In addit
\circuitdesc*{plain amp}{Plain amplifier}{}( out/45/0.3 )
\end{groupdesc}
+Sometime, components will expose internal (sub-)shapes that can be accessed with the syntax \texttt{\textsl{<node name>}-\textsl{<internal node name>}} (a dash is separating the node name and the internal node name); that will be shown in the description as a blue ``anchor'':
+
+\begin{groupdesc}
+\circuitdesc{rotaryswitch}{Rotary switch}{}(in/-180/0.2, cin/145/0.2, center/-90/0.2, mid/0/0.4, out 1/0/0.2,
+cout 1/180/0.2)[out 1.n/90/0.2, out 4.w/0/0.3]
+\end{groupdesc}
+
+
\subsection{Grounds and supply voltages}
For the grounds, the \texttt{center} anchor is put on the connecting point of the symbol, so that you can use them directly in a \texttt{path} specification.
@@ -809,14 +851,33 @@ For the grounds, the \texttt{center} anchor is put on the connecting point of th
\circuitdesc{nground}{Noiseless ground}{}
\circuitdesc{pground}{Protective ground}{}
\circuitdesc{cground}{Chassis ground\footnotemark}{}
- \footnotetext{These last three were contributed by Luigi «Liverpool»)}
+ \footnotetext{These last three were contributed by Luigi «Liverpool»}
\circuitdesc{eground}{European style ground}{}
\circuitdesc{eground2}{European style ground, version 2\footnotemark}{}
- \footnotetext{These last two were contributed by \texttt{@fotesan})}
+ \footnotetext{These last two were contributed by \texttt{@fotesan}}
\circuitdesc{vcc}{VCC/VDD}{}
\circuitdesc{vee}{VEE/VSS}{}
\end{groupdesc}
+\subsubsection{Power supplies}
+
+The power supplies are normally drawn with the arrows shown in the list above.
+You can change them using all the options of the \texttt{arrows.meta} package (see the Ti\emph{k}Z manual for details) by changing the key \texttt{monopoles/vcc/arrow} and \texttt{monopoles/vee/arrow} (the default for both is \texttt{legacy}, which will use the old code for drawing them). Notes that the anchors are at the start of the connecting lines!
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \def\coord(#1){\showcoord(#1)<0:0.3>}
+ \draw (0,0)
+ node[vcc](vcc){VCC} \coord(vcc) ++(2,0)
+ node[vee](vee){VEE} \coord(vee);
+ \ctikzset{monopoles/vcc/arrow={Stealth[red, width=6pt, length=9pt]}}
+ \ctikzset{monopoles/vee/arrow={Latex[blue]}}
+ \draw (0,-2)
+ node[vcc](vcc){VCC} \coord(vcc) ++(2,0)
+ node[vee](vee){VEE} \coord(vee);
+\end{circuitikz}
+\end{LTXexample}
+
\subsubsection{Grounds anchors}
Anchors for grounds are a bit strange, given that they have the \texttt{center} spot at the same location than \texttt{north} and all the ground will develop ``going down'':
@@ -915,7 +976,7 @@ Since version 0.9.0 you have more options for the measuring instruments. You can
\end{circuitikz}
\end{LTXexample}
-This kind of component will maintain the symbol horizontal whatever the orientation:
+This kind of component will keep the symbol horizontal, whatever the orientation:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ -939,7 +1000,7 @@ The plain \texttt{rmeter} is the same, without the measuring arrow:
\end{LTXexample}
-If you prefer, you have the option to use square meters, to have more visual difference from generators:
+If you prefer it, you have the option to use square meters, in order to have more visual difference from generators:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ -950,7 +1011,7 @@ If you prefer, you have the option to use square meters, to have more visual dif
\end{circuitikz}
\end{LTXexample}
-Another possibility is to use the QUCS\footnote{QUCS is an open source circuit simulator: \url{http://qucs.sourceforge.net/}}-styled probes, which have the nice property of explictly showing the type of connection (in series or parallel) of the meter:
+Another possibility is to use QUCS\footnote{QUCS is an open source circuit simulator: \url{http://qucs.sourceforge.net/}}-style probes, which have the nice property of explictly showing the type of connection (in series or parallel) of the meter:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ -974,7 +1035,7 @@ If you want to explicitly show a power measurement, you can use the power probe
\end{circuitikz}
\end{LTXexample}
-The final possibility is to use oscilloscopes, like for example:
+The final possibility is to use oscilloscopes. For example:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ -988,8 +1049,7 @@ The final possibility is to use oscilloscopes, like for example:
\end{circuitikz}
\end{LTXexample}
-Or, if you want a more physical structure for the measurement setup:
-
+Or, if you want a more physical structure for the measurement setup:
\begin{LTXexample}[varwidth=true, pos=b]
\begin{circuitikz}[american]
@@ -1127,7 +1187,7 @@ The package options \texttt{fulldiode}, \texttt{strokediode}, and \texttt{emptyd
\end{framed}
-\subsection{Basic dynamical bipoles}
+\subsection{Capacitors and inductors: dynamical bipoles}
\begin{groupdesc}
\circuitdescbip{capacitor}{Capacitor}{C}
\circuitdescbip[polarcapacitor]{polar capacitor}{Polar capacitor}{pC}
@@ -1215,7 +1275,7 @@ Similarly, if (default behaviour) \texttt{europeanvoltages} option is active (or
\subsection{Noise sources}
-In this case, the ``direction'' of the source has no sense. Noise sources are filled in gray by default, but if you choose the dashed style, they become fillable.
+In this case, the ``direction'' of the source is undefined. Noise sources are filled in gray by default, but if you choose the dashed style, they become fillable.
\begin{groupdesc}
\circuitdescbip[vsourceN]{noise voltage source}{Sinusoidal voltage source}{vsourceN, nV}
@@ -1275,6 +1335,18 @@ Notice that if you choose the dashed style, the noise sources are fillable:
\circuitdescbip*{dcisource}{DC current source}{}
\end{groupdesc}
+The size of the broken part of the DC current source is configurable by changing the value of \texttt{bipoles/dcisource/angle} (default \texttt{80}); values must be between 0 (no circle at all, probably not useful) and 90 (full circle, again not useful).
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \draw (0,0) to[dcvsource] ++(2,0)
+ to [dcisource, fill=yellow] ++(2,0) ;
+ \ctikzset{bipoles/dcisource/angle=45}
+ \draw (0,-2) to[dcvsource] ++(2,0)
+ to [dcisource, fill=yellow] ++(2,0) ;
+\end{circuitikz}
+\end{LTXexample}
+
+
\subsection{Mechanical Analogy}
\begin{groupdesc}
\circuitdescbip*{damper}{Mechanical Damping}{}
@@ -1339,11 +1411,11 @@ You can use microphones and loudspeakers with \texttt{waves} (see section~\ref{s
\noindent Contributed by Stefan Erhardt.
\begin{groupdesc}
- \circuitdesc*{mixer}{\scshape mixer}{}( 1/180/0.1,2/-90/0.1,3/0/0.1,4/90/0.1 )
- \circuitdesc*{adder}{\scshape adder}{}( west/180/0.1,south/-90/0.1,east/0/0.1,north/90/0.1 )
- \circuitdesc*{oscillator}{\scshape oscillator}{}
- \circuitdesc*{circulator}{\scshape circulator}{}
- \circuitdesc*{wilkinson}{\scshape wilkinson divider}{}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
+ \circuitdesc*{mixer}{mixer}{}( 1/180/0.1,2/-90/0.1,3/0/0.1,4/90/0.1 )
+ \circuitdesc*{adder}{adder}{}( west/180/0.1,south/-90/0.1,east/0/0.1,north/90/0.1 )
+ \circuitdesc*{oscillator}{oscillator}{}
+ \circuitdesc*{circulator}{circulator}{}
+ \circuitdesc*{wilkinson}{wilkinson divider}{}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
\end{groupdesc}
\begin{groupdesc}
@@ -1525,7 +1597,7 @@ For all transistors a body diode (or freewheeling diode) can automatically be dr
\end{circuitikz}
\end{LTXexample}
-The Base/Gate connection of all transistors can be disable by using the options \textit{nogate} or \textit{nobase}, respectively. The Base/Gate anchors are floating, but there an additional anchor "nogate"/"nobase", which can be used to point to the unconnected base:
+The Base/Gate connection of all transistors can be disabled by the options \textit{nogate} or \textit{nobase}, respectively. The Base/Gate anchors are floating, but there is an additional anchor "nogate"/"nobase", which can be used to point to the unconnected base:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
\draw (2,0) node[npn,nobase](npn){};
@@ -1550,7 +1622,7 @@ To draw the PMOS circle non-solid, use the option \texttt{emptycircle} or the co
\circuitdesc{pmos,emptycircle}{\scshape pmos}{}
\end{groupdesc}
-If you prefer different position of the arrows in transistors and FETs, you can adjust them like this (it works for the other BJT-based transistors, too):
+If you prefer a different position of the arrows in transistors and FETs, you can adjust them like this (it works for the other BJT-based transistors, too):
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
\ctikzset{tripoles/mos style/arrows,
@@ -1626,7 +1698,7 @@ Similarly \textsc{njfet} and \textsc{pjfet} have \texttt{gate}, \texttt{source}
;\end{circuitikz}
\end{LTXexample}
-For \textsc{npn}, \textsc{pnp}, \textsc{nigbt}, and \textsc{pigbt} transistors the anchors are \texttt{base}, \texttt{emitter} and \texttt{collector} anchors (which can be abbreviated with \texttt{B}, \texttt{E} and \texttt{C}):
+For \textsc{npn}, \textsc{pnp}, \textsc{nigbt} and \textsc{pigbt} transistors, the anchors are \texttt{base}, \texttt{emitter} and \texttt{collector} anchors (which can be abbreviated with \texttt{B}, \texttt{E} and \texttt{C}):
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
@@ -1702,21 +1774,131 @@ The \texttt{name} property is available also for bipoles, although this is usefu
\subsection{Electronic Tubes}
+
+Electronic tubes, also known as vacuum tubes, control current flow between electrodes. They come in many different flavours.
+\small{Contributed by J. op den Brouw (\texttt{J.E.J.opdenBrouw@hhs.nl}).}
+
+\begin{groupdesc}
+ \circuitdesc*{diodetube}{Tube Diode}{}(anode/90/0.2, cathode/-90/0.2 )
+ \circuitdesc*{triode}{Triode}{}(anode/90/0.2, cathode/-90/0.2, grid/180/0.2 )
+ \circuitdesc*{tetrode}{Tetrode}{}(anode/90/0.2, cathode/-90/0.2, grid/190/0.2,screen/170/0.2 )
+ \circuitdesc*{pentode}{Pentode}{}(anode/90/0.2, cathode/-90/0.2, grid/190/0.2,screen/180/0.2,suppressor/170/0.2 )
+\end{groupdesc}
+
+Note that the \verb|diodetube| is used as component name to avoid clashes with the semiconductor diode.
+Normally, the filament is not drawn. If you want a filament, put the \verb|filament| option in the node description:
+
+\begin{groupdesc}
+ \circuitdesc*{diodetube,filament}{Tube Diode}{}(anode/90/0.2, filament 1/-135/0.2, filament 2/-45/0.2 )
+\end{groupdesc}
+
+Sometimes, you don't want the cathode to be drawn (but you do want the filament). Use the \verb|nocathode| option in the node description:
+
+\begin{groupdesc}
+ \circuitdesc*{diodetube,filament,nocathode}{Tube Diode}{}(anode/90/0.2 )
+\end{groupdesc}
+
+If you want a full cathode to be drawn, use the \verb|fullcathode| option in the node description. You can then use the anchors \verb|cathode 1| and \verb|cathode 2|.
+
+\begin{groupdesc}
+ \circuitdesc*{diodetube,fullcathode}{Tube Diode}{}(anode/90/0.2, cathode 1/-135/0.2, cathode 2/-45/0.2 )
+\end{groupdesc}
+
+These circuit elements are fully configurable, and the attributes are described below:
+
+\begin{tabular}{l | l | l}
+
+ Key & Default value & Description\\
+ \hline
+ \verb|tubes/width| & \verb|1| & relative width \\
+ \verb|tubes/height| & \verb|1.4| & relative height \\
+ \verb|tubes/tube radius| & \verb|0.40| & radius of tube circle \\
+ \verb|tubes/anode distance| & \verb|0.40| & distance from center \\
+ \verb|tubes/anode width| & \verb|0.40| & width of an anode/plate \\
+ \verb|tubes/grid protrusion| & \verb|0.25| & distance from center \\
+ \verb|tubes/grid dashes| & \verb|5| & number of grid dashes \\
+ \verb|tubes/grid separation| & \verb|0.2| & separation between grids \\
+ \verb|tubes/grid shift| & \verb|0.0| & y shift of grids from center \\
+ \verb|tubes/cathode distance| & \verb|0.40| & distance from grid \\
+ \verb|tubes/cathode width| & \verb|0.40| & width of a cathode \\
+ \verb|tubes/cathode corners| & \verb|0.06| & corners of the cathode wire \\
+ \verb|tubes/cathode right extend| & \verb|0.075| & extension at the right side \\
+ \verb|tubes/filament distance| & \verb|0.1| & distance from cathode \\
+ \verb|tubes/filament angle| & \verb|15| & angle from the centerpoint \\
+\end{tabular}
+
+Conventionally, the model of the tube is indicated at the \verb|east| anchor:
+
+\begin{LTXexample}[varwidth]
+\ctikzset{tubes/width=1.4}
+\ctikzset{tubes/height=1}
+
+\begin{circuitikz}
+\draw (0,0) node[triode] (Tri) {};
+\draw (Tri.east) node[right] {12AX7};
+\end{circuitikz}
+\end{LTXexample}
+
+Example triode amplifier:
+
+\begin{lstlisting}
+\begin{circuitikz}
+\draw (0,0) node (start) {}
+ to[sV=$V_i$] ++(0,2+\ctikzvalof{tubes/height})
+ to[C=$C_i$] ++(2,0) node (Rg) {}
+ to[R=$R_g$] (Rg |- start)
+(Rg) to[short,*-] ++(1,0)
+ node[triode,anchor=grid] (Tri) {} ++(2,0)
+(Tri.cathode) to[R=$R_c$,-*] (Tri.cathode |- start)
+(Tri.anode) to [R=$R_a$] ++(0,2)
+ to [short] ++(3.5,0) node(Vatop) {}
+ to [V<=$V_a$] (Vatop |- start)
+ to [short] (start)
+(Tri.anode) ++(0,0.2) to[C=$C_o$,*-o] ++(2,0)
+(Tri.cathode) ++(0,-0.2) to[short,*-] ++(1.5,0) node(Cctop) {}
+ to[C=$C_c$,-*] (start -| Cctop)
+;
+\draw[red,thin,dashed] (Tri.north west) rectangle (Tri.south east);
+\draw (Tri.east) node[right] {12AX7};
+\end{circuitikz}
+\end{lstlisting}
+
+\begin{circuitikz}
+\draw (0,0) node (start) {}
+ to[sV=$V_i$] ++(0,2+\ctikzvalof{tubes/height})
+ to[C=$C_i$] ++(2,0) node (Rg) {}
+ to[R=$R_g$] (Rg |- start)
+(Rg) to[short,*-] ++(1,0)
+ node[triode,anchor=grid] (Tri) {} ++(2,0)
+(Tri.cathode) to[R=$R_c$,-*] (Tri.cathode |- start)
+(Tri.anode) to [R=$R_a$] ++(0,2)
+ to [short] ++(3.5,0) node(Vatop) {}
+ to [V<=$V_a$] (Vatop |- start)
+ to [short] (start)
+(Tri.anode) ++(0,0.2) to[C=$C_o$,*-o] ++(2,0)
+(Tri.cathode) ++(0,-0.2) to[short,*-] ++(1.5,0) node(Cctop) {}
+ to[C=$C_c$,-*] (start -| Cctop)
+;
+\draw[red,thin,dashed] (Tri.north west) rectangle (Tri.south east);
+\draw (Tri.east) node[right] {12AX7};
+\end{circuitikz}
+
\begin{groupdesc}
\circuitdesc*{magnetron}{Magnetron}{}( anode/-90/0.2, cathode1/135/0.2,
cathode2/45/0.2, left/180/0.2, right/0/0.2, top/90/0.4 )
\end{groupdesc}
+
\begin{LTXexample}[varwidth=true]
- \begin{circuitikz}
- \draw (0,-2)node[rground](gnd){} to[voltage source,v<={HV}]++(0,3)--++(1,0)to[V,n=DC]++(2,0);
- \draw (2,-1) node[magnetron,scale=1](magn){};
- \draw (DC.left)++(-0.2,0)to [short,*-] ++(0,-1) to [short] (magn.cathode1);
- \draw (DC.right)++(0.2,0)to [short,*-] ++(0,-1) to [short] (magn.cathode2);
- \draw (magn.anode) to [short] (magn.anode|-gnd) node[rground]{};
- \draw (magn.cathode1)node[above]{$1$};
- \draw (magn.cathode2)node[above]{$2$};
- \draw[->](magn.east) --++(1,0)node[right]{$RF_{out}$};
- \end{circuitikz}
+\begin{circuitikz}
+\draw (0,-2)node[rground](gnd){} to[voltage source,v<={HV}]++(0,3)--++(1,0)to[V,n=DC]++(2,0);
+\draw (2,-1) node[magnetron,scale=1](magn){};
+\draw (DC.left)++(-0.2,0)to [short,*-] ++(0,-1) to [short] (magn.cathode1);
+\draw (DC.right)++(0.2,0)to [short,*-] ++(0,-1) to [short] (magn.cathode2);
+\draw (magn.anode) to [short] (magn.anode|-gnd) node[rground]{};
+\draw (magn.cathode1)node[above]{$1$};
+\draw (magn.cathode2)node[above]{$2$};
+\draw[->](magn.east) --++(1,0)node[right]{$RF_{out}$};
+\end{circuitikz}
\end{LTXexample}
\subsection{RF components}
@@ -1795,7 +1977,7 @@ The symbols can also be used along a path, using the transistor-path-syntax(T in
-\subsection{Double bipoles}
+\subsection{Double bipoles (transformers)}
Transformers automatically use the inductor shape currently selected. These are the three possibilities:
\begin{groupdesc}
@@ -1825,8 +2007,6 @@ Transformers with core are also available:
\ctikzset{inductor=cute} % reset default
\end{groupdesc}
-
-
\subsubsection{Double dipoles anchors}
All the double bipoles/quadrupoles have the four anchors, two for each port.
@@ -1886,7 +2066,55 @@ A couple of examples follow:
;\end{circuitikz}
\end{LTXexample}
+\subsubsection{Double dipoles customization}
+
+You can change the aspect of a quadpole using the corresponding parameters \texttt{quadpoles/*/width} and \texttt{quadpoles/*/heigth} (substitute the star for \texttt{transformer}, \texttt{transformer core} or \texttt{gyrator}; default value is \texttt{1.5} for all). You have to be careful to not choose value that overlaps the components!
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+\ctikzset{quadpoles/transformer/width=1,
+ quadpoles/transformer/height=2}
+ \draw (0,0) node[transformer] (T) {}
+ (T.base) node{K}
+ (T.inner dot A1) node[circ]{}
+ (T.inner dot B2) node[circ]{};
+\end{circuitikz}
+\end{LTXexample}
+Another very useful parameter is \texttt{quadpoles/*/inner} (default \texttt{0.4}) that determine which part of the component is the ``vertical'' one. So, setting that parameter to 1 will eliminate the horizontal part of the component (obviously, to maintain the general aspect ratio you need to change the width also):
+
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+\draw (0,0) node[transformer] (T) {}
+ (T.A1) node[anchor=east] {A1}
+ (T.A2) node[anchor=east] {A2}
+ (T.B1) node[anchor=west] {B1}
+ (T.B2) node[anchor=west] {B2}
+ (T.base) node{K} ;
+\ctikzset{quadpoles/transformer/inner=1, quadpoles/transformer/width=0.6}
+\draw (0,-3) node[transformer] (P) {}
+ (P.base) node{T}
+ (P.inner dot A2) node[ocirc]{}
+ (P.inner dot B2) node[ocirc]{};
+\end{circuitikz}
+\end{LTXexample}
+
+This can be useful if you want to put seamlessly something in series with either side of the component; for simplicity, you have a style setting \texttt{quadpoles style} to toggle between the standard shape of double bipoles (called \texttt{inward}, default) and the one without horizontal leads (called \texttt{inline}):
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+\ctikzset{inductor=cute, quadpoles style=inline}
+\draw
+ (0,0) to[R] ++(0,-2)
+ node[transformer, anchor=A1](T){}
+ (T.A2) node[ground](GND){}
+ (T.inner dot A1) node[font=\small\boldmath]{$\oplus$}
+ (T.inner dot B2) node[]{$+$}
+ (T.B1) node[above, ocirc]{}
+ (T.B2) -- (GND);
+\end{circuitikz}
+\end{LTXexample}
\subsection{Amplifiers}
@@ -2052,7 +2280,7 @@ To flip the amplifier in the horizontal direction, you can use \texttt{xscale=-1
\end{circuitikz}
\end{LTXexample}
-Notice that the label is fully mirrored, so check below for the generic way of changing this.
+Notice that the label is fully mirrored, so check below for the generic way to change this.
You can use the new key \texttt{en amp text A} to change the infinity symbol with an A:
@@ -2120,9 +2348,6 @@ Path style:
\begin{groupdesc}
\circuitdesc{currarrow}{Arrows (current and voltage)}{}
\circuitdesc{inputarrow}{Arrow to draw at its tip, useful for block diagrams.}{}
- \circuitdesc{circ}{Connected terminal}{}
- \circuitdesc{ocirc}{Unconnected terminal}{}
- \circuitdesc{diamondpole}{Diamond-style terminal}{}
\circuitdesc{jump crossing}{Jumper-style crossing node}{}
\circuitdesc{plain crossing}{Plain style crossing node}{}
\circuitdesc{waves}{Waves}{}( north/90/0.4, north east/45/0.4, east/-45/0.4, south east/-45/0.4,
@@ -2131,6 +2356,18 @@ Path style:
\circuitdesc*{bnc}{BNC connector}{}(left/135/0.6, right/45/0.6, center/-90/0.6, hot/0/0.6, zero/-135/0.6)
\end{groupdesc}
+These are the so-called ``bipole nodes'' shapes, or poles (see section~\ref{sec:bipole-nodes}). These nodes are always filled; the ``open'' versions (starting with an \texttt{o}) are by default filled white, but you can override it with the \texttt{fill} parameter.
+
+\begin{groupdesc}
+ \circuitdesc{circ}{Connected terminal}{}
+ \circuitdesc{ocirc}{Unconnected terminal}{}
+ \circuitdesc{diamondpole}{Diamond-square terminal}{}
+ \circuitdesc{odiamondpole}{Open diamond-square terminal}{}
+ \circuitdesc{squarepole}{Square-shape terminal}{}
+ \circuitdesc{osquarepole}{Open square-shape terminal}{}
+\end{groupdesc}
+
+
Moreover, you have the arrow tip \texttt{latexslim} which is an arrow similar to the old (in deprecated \texttt{arrows} library) \texttt{latex'} element:
\begin{LTXexample}[varwidth=true]
@@ -2139,10 +2376,8 @@ Moreover, you have the arrow tip \texttt{latexslim} which is an arrow similar to
\end{circuitikz}
\end{LTXexample}
-
-
\subsubsection{Terminal shapes}
-Since version 0.9.0, \texttt{circ}, \texttt{ocirc} , and \texttt{diamondpole} have all the standard geographical anchors, so you can do things like these:
+Since version 0.9.0, ``bipole nodes'' shapes have all the standard geographical anchors, so you can do things like these:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american,]
@@ -2251,16 +2486,33 @@ These are all of the to-style type:
while this is a node-style component:
\begin{groupdesc}
- \circuitdesc{spdt}{spdt}{}( in/180/0.2, out 1/0/0.2, out 2/0/0.2 )
+ \circuitdesc{spdt}{spdt}{}( in/180/0.2, out 1/0/0.2, out 2/0/0.2 )
\end{groupdesc}
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+ (0,0) node[spdt] (Sw) {}
+ (Sw.in) node[left] {in}
+ (Sw.out 1) node[right] {out 1}
+ (Sw.out 2) node[right] {out 2}
+;\end{circuitikz}
+\end{LTXexample}
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+ (0,0) to[C] (1,0) to[toggle switch , n=Sw] (2.5,0)
+ -- (2.5,-1) to[battery1] (1.5,-1) to[R] (0,-1) -| (0,0)
+ (Sw.out 2) -| (2.5, 1) to[R] (0,1) -- (0,0)
+;\end{circuitikz}
+\end{LTXexample}
+
\subsubsection{Cute switches}
These switches have been introduced after version 0.9.0, and they come in also in to-style and in node-style, but they are size-matched so that they can be used together in a seamless way.
The path element (to-style) are:
\begin{groupdesc}
\circuitdescbip[cuteclosedswitch]{cute closed switch}{Cute closed switch}{ccsw}(mid/90/0.2, in/-135/0.2, out/-45/0.2)
- \circuitdescbip[cuteopenswitch]{cute open switch}{Cute open switch}{cosw}
+ \circuitdescbip[cuteopenswitch]{cute open switch}{Cute open switch}{cosw}(out/45/0.2)[out.s/-90/0.2]
\circuitdescbip[cuteclosingswitch]{cute closing switch}{Cute closing switch}{ccgsw}
\circuitdescbip[cuteopeningswitch]{cute opening switch}{Cute opening switch}{cogsw}
\end{groupdesc}
@@ -2274,7 +2526,7 @@ while the node-style components are the single-pole, double-throw (\texttt{spdt}
\circuitdesc{cute spdt down arrow}{Cute spdt down with arrow}{}
\end{groupdesc}
-\subsubsection{Switches anchors}
+\paragraph{Cute switches anchors}
The nodes-style switches have the following anchors:
@@ -2282,30 +2534,38 @@ The nodes-style switches have the following anchors:
\begin{circuitikz}
\def\coorda(#1)<#2>{node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\small, pin distance=0.1cm, pin edge={red, overlay,}]#2:#1}](#1){}}
\path (0,-1) -- (3,1); %bbox
- \draw (0, 0) node[cute spdt up arrow](CS){};
- \draw (2, 0) node[cute spdt up arrow](CS){};
+ \draw (0, 0) node[spdt](S){};
+ \foreach \a/\b in {center/0, in/-135, out 1/45, out 2/-45}
+ \path (S.\a) \coorda(\a)<\b>;
+ \draw (3, 0) node[cute spdt up arrow](CS){};
\foreach \a/\b in {center/0, in/-135, out 1/45, out 2/-45, mid/135}
- \path (CS.\a) \coorda(\a)<\b>;
+ \path (CS.\a) \coorda(\a)<\b>;
+ \draw (6, 0) node[cute spdt up arrow](CS2){};
+ \foreach \a/\b in {cin/-135, cout 1/45, cout 2/-45}
+ \path (CS2.\a) \coorda(\a)<\b>;
\end{circuitikz}
+Please notice the position of the normal anchors at the border of the \texttt{ocirc} shape for the cute switches; they are thought to be compatible with an horizontal wire going out.
+Additionaly, you have the \texttt{cin}, \texttt{cout 1} y \texttt{cout 2} which are anchors on the center of the contacts.
-\begin{LTXexample}[varwidth=true]
-\begin{circuitikz} \draw
- (0,0) node[spdt] (Sw) {}
- (Sw.in) node[left] {in}
- (Sw.out 1) node[right] {out 1}
- (Sw.out 2) node[right] {out 2}
-;\end{circuitikz}
-\end{LTXexample}
+For more complex situations, the contact nodes are available\footnote{Thanks to \texttt{@marmot} on \href{https://tex.stackexchange.com/a/492599/38080}{tex.stackexchange.com}.} using the syntax \emph{name of the node}\texttt{-in}, \dots\texttt{-out 1} and \dots\texttt{-out 2}, with all their anchors.
\begin{LTXexample}[varwidth=true]
-\begin{circuitikz} \draw
- (0,0) to[C] (1,0) to[toggle switch , n=Sw] (2.5,0)
- -- (2.5,-1) to[battery1] (1.5,-1) to[R] (0,-1) -| (0,0)
- (Sw.out 2) -| (2.5, 1) to[R] (0,1) -- (0,0)
-;\end{circuitikz}
+\begin{circuitikz}
+\draw (0,0) node[cute spdt up] (S1) {}
+ (S1.in) node[left] {in}
+ (S1.out 1) node[right] {out 1};
+ \draw (0,-2) node[cute spdt up,
+ /tikz/circuitikz/bipoles/cuteswitch/height=0.8] (S2) {}
+ (S2.in) node[left] {in}
+ (S2.out 2) node[right] {out 2};
+ \draw [red] (S1-in.s) -- (S2-in.n);
+ \draw [blue] (S1-out 2.s) -- (S2-out 1.n);
+\end{circuitikz}
\end{LTXexample}
+
+
The \texttt{mid} anchor in the cute switches (both path- and node-style) can be used to combine switches to get more complex configurations:
\begin{LTXexample}[varwidth=true]
@@ -2317,9 +2577,10 @@ The \texttt{mid} anchor in the cute switches (both path- and node-style) can be
\end{circuitikz}
\end{LTXexample}
-\subsubsection{Cute switches customization}
+\paragraph{Cute switches customization}
-You can use the key \texttt{bipoles/cuteswitch/thickness} to decide the thickness of the switch lever. The units are the diameter of the \texttt{ocirc} connector, and the default is \texttt{1}.
+You can use the key \texttt{bipoles/cuteswitch/thickness} to decide the thickness of the switch lever.
+The units are the diameter of the \texttt{ocirc} connector, and the default is \texttt{1}.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
@@ -2331,6 +2592,156 @@ You can use the key \texttt{bipoles/cuteswitch/thickness} to decide the thicknes
\end{circuitikz}
\end{LTXexample}
+Finally, the switches are normally drawn using the \texttt{ocirc} shape, but you can change it, as in the following example, with the key \texttt{bipoles/cuteswitch/shape}. Be careful that the shape is used with its defaults (which can lead to strange results), and that the standard anchors will be correct only for \texttt{circ} and \texttt{ocirc} shapes, so you have to use the internal node syntax to connect it.
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \begin{scope}
+ \ctikzset{bipoles/cuteswitch/thickness=0.5,
+ bipoles/cuteswitch/shape=circ}
+ \draw (0,2) node[cute spdt up](S1){};
+ \ctikzset{bipoles/cuteswitch/thickness=0.25,
+ bipoles/cuteswitch/shape=emptyshape}
+ \draw (0,0) node[cute spdt up](S2){};
+ \draw (S2.cin) node[draw, inner sep=2pt]{};
+ \draw (S2.cout 1) node[draw, inner sep=2pt]{};
+ \draw (S2.cout 2) node[draw=red, inner sep=2pt]{};
+ \end{scope}
+ \draw (0,-2) node[cuteclosedswitchshape, yscale=-1](S3){};
+ \draw [densely dashed] (S1.mid)--(S2.mid)--(S3.mid);
+\end{circuitikz}
+\end{LTXexample}
+
+
+\subsubsection{Rotary switches}
+
+Rotary switches are a kind of generic multipole switches; they are implemented as a strongly customizable element (and a couple of styles to simplify its usage). The basic element is the following one, and it has the same basic anchors of the cute switches, included the access to internal nodes (shown in blue here).
+
+\begin{groupdesc}
+\circuitdesc{rotaryswitch}{Rotary switch}{}(in/-180/0.2, cin/145/0.2, center/-90/0.2, mid/0/0.4, out 1/0/0.2,
+cout 1/180/0.2)[out 1.n/90/0.2, out 4.w/0/0.3]
+\end{groupdesc}
+
+Notice that the name of the shape is \texttt{rotaryswitch}, no spaces.
+The default rotary switch component has 5 channels (this is set in the parameter \texttt{multipoles/rotary/channels}), spanning form \SI{-60}{\degree} to \SI{60}{\degree} (parameter \texttt{multipoles/rotary/angle}) and with the wiper at \SI{20}{\degree} (parameter \texttt{multipoles/rotary/wiper}).
+
+Moreover, there are by default no arrows on the wiper; you can set this with the parameter \texttt{multipoles/rotary/arrow} which can assume the values \texttt{none}, \texttt{cw} (clockwise), \texttt{ccw} (counterclockwise) or \texttt{both}.
+
+To simplify the usage of the component, a series of styles are defined: \texttt{rotary switch=\textsl{<channels>} in \textsl{<angle>} wiper \textsl{<wiper angle>}} (notice the space in the name of the style!). Using \texttt{rotary switch} without parameters will generate a default switch.
+
+To add arrows, you can use the styles \texttt{rotary switch -} (no arrow, whatever the default), \texttt{rotary switch <-} (counterclockwise arrow), \texttt{rotary switch ->} (clockwise) and \texttt{rotary switch <->} (both).
+
+Notice that the defaults of the styles are the same as the default values of the parameters, but that if you change globally the defaults using the keys mentioned above, you only change the defaults for the ``bare'' component \texttt{rotaryswitch}, not for the styles.
+
+
+\begin{LTXexample}[varwidth=true, pos=t, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+\ctikzset{multipoles/rotary/arrow=both}
+\draw (0,0) -- ++(1,0) node[rotary switch <-=8 in 120 wiper 40, anchor=in](A){};
+\draw (3,0) -- ++(1,0) node[rotary switch, anchor=in](B){}; % default values
+\draw[red] (A.out 4) -| (3,0);
+\draw[blue] (A-out 2.n) -- ++(0,0.5) -| (B-out 1.n);
+\draw (B.out 3) -- ++(1,0) node[rotary switch -=5 in 90 wiper 15, anchor=in](C){};
+\draw (C.out 3) -- ++(1,0) node[rotary switch ->, xscale=-1, anchor=out 3](D){};
+\draw[green, dashed] (B.mid) -- ++(-.5,-1) -| (C.mid);
+\end{circuitikz}
+\end{LTXexample}
+
+\paragraph{Rotary switch anchors}
+
+Rotary switches anchors are basically the same as the cute switches, including access (with the \texttt{\textsl{<node name>}-<anchor name>} notation) to the internal connection nodes. The geographical anchors work as expected, marking the limits of the component.
+
+\showanchors{rotary switch}{}(north/90/0.4, north east/45/0.4, east/0/0.4, south east/-45/0.4,
+ south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4, center/-120/0.3)
+\qquad
+\showanchors{rotary switch=25 in 120 wiper 10}{}(north/90/0.4, north east/45/0.4, east/0/0.4, south east/-45/0.4,
+ south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4, center/-120/0.3)
+
+In addition to the anchors they have in common with the cute switches, the rotary switch has the so called ``angled'' anchors and the ``external square anchors''. \emph{Angled anchors}, called \texttt{aout 1}, \texttt{aout 2} and so forth, are anchors placed on the output poles at the same angle as the imaginary lines coming from the input pole; \emph{square anchors}, called \texttt{sqout 1}\dots, are located on an imaginary square surrounding the rotary switch on the same line.
+
+\bigskip
+
+\begin{circuitikz}
+ \begin{scope}[scale=2, transform shape]
+ \clip (-1,-.4) rectangle (1,.6);
+ \draw (0,0) node[rotary switch=9 in 90 wiper 10](Z){};
+ \draw [dashed, blue] (Z.cin) -- (Z.sqout 4);
+ \end{scope}
+ \path (Z.aout 4) \showcoord(aout 4)<-15:0.4>;
+ \path (Z.sqout 4) \showcoord(sqout 4)<0:0.4>;
+ \path (Z.out 3) \showcoord(out 3)<15:0.4>;
+ \path (Z.cout 3) \showcoord(cout 3)<180:0.4>;
+ \draw (8,0) node[rotary switch -=31 in 150 wiper 10](D){};
+ \foreach \i in {1,...,31} \draw (D.sqout \i) -- (D.aout \i);
+ \foreach \l/\a/\d in {north/90/0.2, north east/45/0.2, east/0/0.2,
+ south east/-45/0.2, south/-90/0.2, south west/-135/0.2, west/180/0.2, north west/135/0.2,
+ center/-145/0.7}
+ \path (D.ext \l) \showcoord(ext \l)<\a:\d>;
+ \path (D.aout 12) \showcoordb(aout 12)<-5:0.4>;
+ \path (D.sqout 12) \showcoordb(sqout 12)<0:0.4>;
+ \draw[blue, densely dotted] (D.ext north west) rectangle (D.ext south east);
+\end{circuitikz}
+
+The code for the diagram at the left, above, without the markings for the anchors, is:
+\begin{lstlisting}[basicstyle=\small\ttfamily]
+\begin{circuitikz}
+ \draw (8,0) node[rotary switch -=31 in 150 wiper 10](D){};
+ \foreach \i in {1,...,31} \draw (D.sqout \i) -- (D.aout \i);
+ \draw[blue, densely dotted] (D.ext north west) rectangle (D.ext south east);
+\end{circuitikz}
+\end{lstlisting}
+
+One possible application for the angled and the ``on square'' anchors is that you can use them to move radially from the output poles, for example for adding numbers:
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+\draw (0,0) node[rotary switch=13 in 120 wiper 0](S){};
+\foreach \i in {1,...,13} % requires "calc"
+ \path ($(S.aout \i)!1ex!(S.sqout \i)$)
+ node[font=\tiny\color{red}]{\i};
+\end{circuitikz}
+\end{LTXexample}
+
+Finally, notice that the value of width for the rotary switches is taken from the one for the ``cute switches'' which in turn is taken from the width of traditional \texttt{spdt} switch, so that they match (notice that the ``center'' anchor is better centered in the rotary switch, so you have to explicitly align them).
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+ \draw (0,0) node[color=blue, rotary switch=2 in 35 wiper 30,
+ anchor=in](R){};
+ \draw (0,-1) node[cute spdt up, anchor=in](C){};
+ \draw (0,-2) node[color=blue, rotary switch=3 in 35 wiper 30,
+ anchor=in](R){};
+\end{circuitikz}
+\end{LTXexample}
+
+\paragraph{Rotary switch customization}
+
+Apart from the basic customization seen above (number of channels, etc.) you can change, as in the cute switches, the shape used by the connection points with the parameter \texttt{multipoles/rotary/shape}, and the thickness of the wiper with \texttt{multipoles/rotary/thickness}. The optional arrow has thickness equal to the standard bipole thickness \texttt{bipoles/thickness} (default 2).
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \ctikzset{multipoles/rotary/thickness=0.5}
+ \draw (0,1.6) node[rotary switch ->, color=blue](S1){};
+ \ctikzset{multipoles/rotary/shape=circ}
+ \draw (0,0) node[rotary switch ->](S2){};
+ \ctikzset{bipoles/thickness=0.5}
+ \draw (0,-1.6) node[rotary switch ->, color=red](S3){};
+\end{circuitikz}
+\end{LTXexample}
+
+Finally, the size can be changed using the parameter \texttt{tripoles/spdt/width} (default 0.85).
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \draw (0,2) node[rotary switch ->, color=blue](S1){};
+ \ctikzset{tripoles/spdt/width=1.6, fill=cyan,
+ multipoles/rotary/shape=osquarepole}
+ \draw (0,0) node[rotary switch ->](S2){};
+\end{circuitikz}
+\end{LTXexample}
+
+
+
\subsection{Logic gates}
Logic gates, with two or more input, are supported. Albeit in principle these components are multipoles, the are considered tripoles here, for historical reasons (when they just had two inputs).
@@ -2511,10 +2922,7 @@ In the case of \textsc{not}, there are only \texttt{in} and \texttt{out} (althou
-\subsection{Chips}
-%%% This chapter is in the new format --- description and components.
-%%% The idea is to try to reorganize the manual before the next release.
-%%% See issue #24
+\subsection{Chips (integrated circuits)}
\texttt{CircuiTikZ} supports two types of variable-pin chips: DIP (Dual-in-Line Package) and QFP (Quad-Flat Package).
\begin{groupdesc}
@@ -2654,6 +3062,83 @@ Look at the following example, which is easily put into a macro.
\draw (C.s) -- ++(0,-1) node[ground]{};
\end{circuitikz}\end{LTXexample}
+\subsection{Seven segment displays}
+
+\begin{groupdesc}
+ \circuitdesc*{bare7seg}{Seven segment display}{}
+\end{groupdesc}
+
+The seven segment display lets you show values as if they were displayed in a classical seven segment display.\footnote{This component has been loosely inspired by the package \texttt{SevenSeg} by Germain Gondor, 2009, see \href{http://www.texample.net/tikz/examples/seven-segment-display/}{\TeX{}example.net}.}
+
+The main ``bare'' component is the one shown above, but for simplicity a couple of style interfaces are defined:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}
+ \draw (0,0) node[seven segment val=A dot off box on]{};
+ \draw (1,0) node[seven segment val=- dot none box on]{};
+ \draw (0,-2) node[seven segment bits=1001001 dot empty box on]{};
+ \draw (1,-2) node[seven segment bits=0011101 dot none box off]{};
+\end{circuitikz}
+\end{LTXexample}
+
+There are two main configuration methods. The first one is \texttt{seven segment val}, which will take an hexadecimal number or value and display it: the possible values are \texttt{0,...,15}, plus \texttt{A, B, C, D, E, F} (or lowercase) and the symbol \texttt{-} (minus).
+
+
+The other interface is \texttt{seven segment bits}, where you specify seven bits saying which segment must be on (please never specify a different number of bits, it will throw a very obscure error); you can see in the anchors the name of each segment.
+
+The option \texttt{dot} specifies if you want a decimal dot or not. The key \texttt{none} will remove the dot and the space it would take; \texttt{empty} will not show the dot at all but reserve the space, and \texttt{on} or \texttt{off} will show the dot in the corresponding state.
+
+The option \texttt{box} (can be \texttt{on} or \texttt{off}) simply toggles the drawing of the external box. You can separate it from the display with the key \texttt{seven seg/box sep} (default \texttt{1pt}), and it will use the thickness specified in \texttt{multipoles/thickness} (The same as the chips).
+
+You can use these option with the ``bare'' object \texttt{bare7seg} and the keys \texttt{seven seg/bits} (default \texttt{0000000}), \texttt{seven seg/dot} (default \texttt{none}) and \texttt{seven seg/box} (default \texttt{off}); there is no option equivalent to the \texttt{val} interface.
+
+\subsubsection{Seven segments anchors}
+
+These are the anchors for the seven segment displays; notice that when the \texttt{dot} parameter is not \texttt{none}, the cell is a bit wider at the right side.
+
+\begingroup
+\ctikzset{seven seg/color off=gray, multipoles/thickness=1}
+\showanchors{bare7seg}{}(north/90/0.4, north east/45/0.4, east/0/0.4,
+south east/-45/0.4, south/-90/0.4, south west/-135/0.4, west/180/0.4,
+north west/135/0.4, center/-140/0.5)
+\ctikzset{seven seg/dot=off}
+\ctikzset{seven seg/box=on}
+\showanchors{bare7seg}{}(north/90/0.4, north east/45/0.4, east/0/0.4,
+south east/-45/0.4, south/-90/0.4, center/-140/0.5)
+\ctikzset{seven seg/box=off}
+\showanchors{bare7seg}{}(a/90/0.4, b/45/0.4, c/0/0.4, d/-90/0.4,
+e/-129/0.4, f/145/0.4, g/190/0.4, dot/-45/0.2)
+\endgroup
+
+\subsubsection{Seven segments customization}
+
+You can change several parameters to adjust the displays:
+\begin{lstlisting}[basicstyle=\small\ttfamily]
+\ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
+\ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
+\ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
+\ctikzset{seven seg/box sep/.initial=1pt}% external box gap
+\ctikzset{seven seg/color on/.initial=red}% color for segment "on"
+\ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
+\end{lstlisting}
+
+A couple of examples following:
+
+\begin{LTXexample}[varwidth=true, pos=b, basicstyle=\small\ttfamily]
+\begin{circuitikz}[scale=0.5]
+\ctikzset{seven seg/width=0.2, seven seg/thickness=2pt}
+\foreach \i in {0,...,15} \path (\i,0)
+ node[seven segment val=\i dot on box off]{};
+\ctikzset{seven seg/color on=black}
+\foreach \i in {0,...,15} \path (\i,-1.5)
+ node[seven segment val=\i dot off box off, fill=gray!30!white]{};
+\ctikzset{seven seg/color on=green, seven seg/color off=yellow!30}
+\foreach \i in {0,...,15} \path[color=red] (\i,-3)
+ node[seven segment val=\i dot none box on, xslant=0.2]{};
+\end{circuitikz}
+\end{LTXexample}
+
+
\section{Labels and similar annotations}
\begin{LTXexample}[varwidth=true]
@@ -2719,7 +3204,7 @@ The position of (a) and (l) labels can be adjusted with \_ and \^, respectively.
\end{circuitikz}
\end{LTXexample}
-\textbf{Caveat:} notice that the way in which \texttt{circuitikz} processes the options, there will be problems if the label (or annotation, or voltage, or current) contains one of the characters $=$ (equal) or $,$ (comma), giving unexpected errors and wrong output.
+\textbf{Caveat:} notice that the way in which \texttt{circuitikz} processes the options, there will be problems if the label (or annotation, voltage, or current) contains one of the characters $=$ (equal) or $,$ (comma), giving unexpected errors and wrong output.
These two characters must be protected to the option parser using an \verb|\mbox| command, or redefining the characters with a \TeX\ \verb|\def|:
\begin{LTXexample}[varwidth=true]
@@ -3239,9 +3724,49 @@ This could be especially useful if you define a style, to use like this:
\end{LTXexample}
+\subsection{Nodes (also called poles)}\label{sec:bipole-nodes}
+
+You can add nodes to the bipoles, positioned at the coordinates surrounding the component. The general style to use is \texttt{bipole nodes=\{start\}\{stop\}}, where \texttt{start} and \texttt{stop} are the nodes --- to be chosen between \texttt{none}, \texttt{circ}, \texttt{ocirc}, \texttt{squarepole}, \texttt{osquarepole}, \texttt{diamondpole}, \texttt{odiamondpole} and \texttt{rectfill}\footnote{You can use other shapes too, but at your own risk\dots Moreover, notice that \texttt{none} is not really a node, just a special word used to say ``do not put any node here''.} (see section~\ref{sec:support}).
-\subsection{Nodes}
+\begin{LTXexample}[varwidth=true,
+ basicstyle=\small\ttfamily
+ ]
+\begin{circuitikz}
+ \ctikzset{bipoles/length=.5cm, nodes width=0.1}%small components, big nodes
+ \foreach \a/\p [evaluate=\a as \b using (\a+180)] in
+ {-90/none, -60/circ, -30/ocirc, 0/diamondpole, 30/odiamondpole, 60/squarepole, 90/osquarepole}
+ \draw (0,0) to[R, bipole nodes={none}{\p}] ++(\a:1.5) node[font=\tiny, anchor=\b]{\p};
+\end{circuitikz}
+\end{LTXexample}
+
+
+
+These bipole nodes are added after the path is drawn, as every node in Ti\emph{k}Z --- this is the reason why they are always filled (with the main color the normal nodes, with white the open ones), in order to ``hide'' the wire below. You can override the fill color if you want; but notice that if you draw things in two different paths, you will have ``strange'' results; notice that in the second line of resistors the second wire is starting from the center of the white \texttt{ocirc} of the previous path.
+
+\begin{LTXexample}[varwidth=true,
+ pos=t, basicstyle=\small\ttfamily
+ ]
+\begin{circuitikz}
+ \draw (0,0) to[R, *-o] ++(2,0) to[R, -d] ++(2,0)
+ to[R, bipole nodes={diamondpole}{odiamondpole, fill=red}] ++(2,0);
+ \draw (0,-1) to[R, *-o] ++(2,0) ;
+ \draw (2,-1) to[R, -d] ++(2,0) to[R, bipole nodes={none}{squarepole}] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+You can define shortcuts for the \texttt{bipole bodes} you use most; for example if you want a shortcut for a bipole with open square node in red in the right side you can:
+
+\begin{LTXexample}[varwidth=true,
+ basicstyle=\small\ttfamily
+ ]
+\begin{circuitikz}
+ \ctikzset{-s/.style = {bipole nodes={none}{osquarepole, fill=red}}}
+ \draw (0,0) to[R, -s] ++(2,0);
+\end{circuitikz}
+\end{LTXexample}
+
+There are several predefined shorthand as the above; in the following pages you can see all of them.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
@@ -3577,7 +4102,7 @@ Placing labels, currents and voltages works also, please note, that mirroring an
\subsection{Line joins between Path Components}
\label{sec:line-joins}
-Line joins should be calculated correctly, if the are on the same path and if the path is not closed. For example, the following path is not closed correctly (\textit{--cycle} does not work here!):
+Line joins should be calculated correctly - if they are on the same path, and the path is not closed. For example, the following path is not closed correctly (\textit{--cycle} does not work here!):
\begin{LTXexample}[varwidth=true]
\begin{tikzpicture}[line width=3pt,european]
\draw (0,0) to[R]++(2,0)to[R]++(0,2)
@@ -3754,6 +4279,18 @@ Just substitute every occurrence of the environment \verb!circuitikz! with \verb
Use \verb|\def{\eq}{=}| \verb!to[R = $R_1\eq 12V$]! and \verb!to[ospst = open{,} 3s]! instead; see caveat in section~\ref{sec:labels-and-annotations}.
+\bigskip
+
+\noindent Q: I tried to change the direction of the $y$ axis with \texttt{yscale=-1}, but the circuit is completely messed up.
+
+\noindent A: Yes, it's a known bug (or misfeature, or limitation). See section~\ref{sec:bugs}. Don't do that.
+
+
+\bigskip
+
+\noindent Q: I tried to put a diode in a \texttt{pic}, but it's coming out badly rotated.
+
+\noindent A: Yes, it's a known bug (or misfeature, or limitation). See section~\ref{sec:bugs}. \Circuitikz{} is not compatible with \texttt{pic}s at this point.
\section{Defining new components}
@@ -3794,7 +4331,7 @@ The suggested way to start working on a new component is to use the utilities of
\begin{document}
-\circuitdescbip*{damper}{Mechanical damping\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+\circuitdescbip*{damper}{Mechanical damping}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
\geolrcoord{dampershape, fill=yellow}
@@ -3807,9 +4344,9 @@ The suggested way to start working on a new component is to use the utilities of
\end{document}
\end{lstlisting}
-This will compile in something like this (in this case, we are using a couple of existing components to check everything is ok):
+This will compile to something like this (in this case, we are using a couple of existing components to check everything is ok):
-\circuitdescbip*{damper}{Mechanical damping\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+\circuitdescbip*{damper}{Mechanical damping}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
\geolrcoord{dampershape, fill=yellow}
@@ -3930,7 +4467,7 @@ Looking at the implementation of the \texttt{spring} element, a possible impleme
which leads to:
-\circuitdescbip*{viscoe}{Mechanical viscoelastic element\footnotemark}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+\circuitdescbip*{viscoe}{Mechanical viscoelastic element}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
\geolrcoord{viscoeshape, fill=yellow}
@@ -3953,11 +4490,11 @@ Adding a node-style component is much more straightforward. Just define it by fo
Once you have a satisfactory element, you should
\begin{itemize}
\item Clean up your code;
- \item write a piece of documentation explaining its use with example;
+ \item write a piece of documentation explaining its use, with an example;
\item Propose the element for inclusion in the GitHub page of the project (you will have to license this as explained in that page, of course).
\end{itemize}
-The best way of contributing is forking the project, adding your component in the correct files, modify the manual and creating a pull request for the developers to merge. Anyway, if this is a problem, just open an issue and someone (when they have time\dots) will answer.
+The best way of contributing is forking the project, adding your component in the correct files, modifying the manual and creating a pull request for the developers to merge. Anyway, if this is a problem, just open an issue and someone (when they have time\dots) will answer.
diff --git a/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty b/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
index 6e773c3c570..d158bb21a52 100644
--- a/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
+++ b/Master/texmf-dist/doc/latex/circuitikz/ctikzmanutils.sty
@@ -32,7 +32,8 @@
% optional: scale of the component in the entry
% mandatory shape name, description, node text:
% optional between (): anchor specification list
-\NewDocumentCommand{\circuitdesc}{s O{1} m m m d()}
+% optional between []: internal nodes specification list
+\NewDocumentCommand{\circuitdesc}{s O{1} m m m d() d[]}
{
\twopartbox{%
\begin{circuitikz}[]
@@ -44,16 +45,20 @@
\IfValueT{#6}{%
\foreach \n/\a/\d in {#6} \path(N.\n) \showcoord(\n)<\a:\d>;
}
+ \IfValueT{#7}{%
+ \foreach \n/\a/\d in {#7} \path(N-\n) \showcoordb(N-\n)<\a:\d>;
+ }
\end{circuitikz}%
}{\sloppy%
{#4, type: node\IfBooleanT{#1}{, fillable}%
- } (\texttt{node[#3]\{#5\}}) \index{#3} }
+ } (\texttt{node[#3]\IfValueT{#7}{(N)}\{#5\}}) \index{#3} }
}
% description of a path-style component:
% optional: main name, if different from above
% mandatory component name, description, comma separated alias
% optional between (): anchor specification list
-\NewDocumentCommand{\circuitdescbip}{s o m m m d()}
+% optional between []: internal nodes specification list
+\NewDocumentCommand{\circuitdescbip}{s o m m m d() d[]}
{
\index{#3} \tikz\foreach \i in {#5} {\index{\i|see{#3}} };
\twopartbox{%
@@ -66,13 +71,15 @@
\IfValueT{#6}{%
\foreach \n/\a/\d in {#6} \path(B.\n) \showcoord(\n)<\a:\d>;
}
+ \IfValueT{#7}{%
+ \foreach \n/\a/\d in {#7} \path(B-\n) \showcoordb(B-\n)<\a:\d>;
+ }
\end{circuitikz}%
}{\sloppy%
\texttt{\textbf{#3}}: #4, \texttt{type: path-style\IfBooleanT{#1}{, fillable}%
- \IfValueTF{#2}{%
- , nodename: #2shape.%\drawphantomshape{#2shape}%
- }{
- , nodename: #3shape.%\drawphantomshape{#3shape}%
+ \IfValueT{#7}{, \texttt{name=B}}%
+ \IfValueTF{#2}{, nodename: #2shape.%\drawphantomshape{#2shape}%
+ }{, nodename: #3shape.%\drawphantomshape{#3shape}%
}
}%
\ifthenelse{\equal{#5}{}}{}{%
@@ -92,6 +99,11 @@
[red, inner sep=0.5pt, font=\small,
pin distance=#3\pgf@circ@Rlen, pin edge={red, }%
]#2:#1}](#1){}}
+\def\showcoordb(#1)<#2:#3>{%
+ node[circle, blue, draw, inner sep=1pt,pin={%
+ [blue, inner sep=0.5pt, font=\small,
+ pin distance=#3\pgf@circ@Rlen, pin edge={blue, }%
+ ]#2:#1}](#1){}}
\makeatother
% show anchors of a node component:
% optional: options of the circuitikz environment
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 04310f66fa6..1c490b152d2 100644
--- a/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
+++ b/Master/texmf-dist/tex/context/third/circuitikz/t-circuitikz.tex
@@ -1,5 +1,5 @@
-\def\pgfcircversion{0.9.0}
-\def\pgfcircversiondate{2019/05/10}
+\def\pgfcircversion{0.9.1}
+\def\pgfcircversiondate{2019/06/16}
\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 8814c336a4f..ca121a6e0c7 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
@@ -147,6 +147,8 @@
\ctikzset{monopoles/rground/thickness/.initial=2}
\ctikzset{monopoles/tground/thickness/.initial=3}
\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/vcc/arrow/.initial=legacy}
+\ctikzset{monopoles/vee/arrow/.initial=legacy}
\ctikzset{monopoles/match/width/.initial=.4}
\ctikzset{monopoles/chassis/width/.initial=.25}
\ctikzset{monopoles/alternative chassis/width/.initial=.25}
@@ -247,6 +249,7 @@
\ctikzset{bipoles/oosource/width/.initial=.60}
\ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
\ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/dcisource/angle/.initial=80}
\ctikzset{bipoles/dcisource/height/.initial=.60}
\ctikzset{bipoles/dcisource/width/.initial=.60}
\ctikzset{bipoles/dcvsource/height/.initial=.60}
@@ -995,6 +998,7 @@
\ctikzset{tripoles/triac/diode width right/.initial=.3}
%% Cute switches
+\ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
\ctikzset{bipoles/cuteswitch/height/.initial=.6}
\ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
\ctikzset{bipoles/cuteswitch/width/.initial=.50}
@@ -1017,14 +1021,17 @@
\ctikzset{tripoles/wilkinson/height/.initial=1.3}
\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+\ctikzset{quadpoles/transformer/inner/.initial=0.4}
\ctikzset{quadpoles/transformer/width/.initial=1.5}
\ctikzset{quadpoles/transformer/width1/.initial=.4}
\ctikzset{quadpoles/transformer/height/.initial=1.5}
\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/inner/.initial=0.4}
\ctikzset{quadpoles/transformer core/width/.initial=1.5}
\ctikzset{quadpoles/transformer core/height/.initial=1.5}
\ctikzset{quadpoles/transformer core/core height/.initial=.5}
\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/inner/.initial=0.4}
\ctikzset{quadpoles/gyrator/width/.initial=1.5}
\ctikzset{quadpoles/gyrator/height/.initial=1.5}
\ctikzset{quadpoles/fourport/width/.initial=1.3}
@@ -1036,6 +1043,27 @@
\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
+\ctikzset{quadpoles style/.is choice}
+\ctikzset{quadpoles style/inward/.code={ % default value
+ \ctikzset{quadpoles/transformer/inner=0.4}
+ \ctikzset{quadpoles/transformer/width=1.5}
+ \ctikzset{quadpoles/transformer core/inner=0.4}
+ \ctikzset{quadpoles/transformer core/width=1.5}
+ \ctikzset{quadpoles/gyrator/inner=0.4}
+ \ctikzset{quadpoles/gyrator/width=1.5}
+ }
+}
+\ctikzset{quadpoles style/inline/.code={ % now horizontal baffle
+ \ctikzset{quadpoles/transformer/inner=1}
+ \ctikzset{quadpoles/transformer/width=0.6}
+ \ctikzset{quadpoles/transformer core/inner=1}
+ \ctikzset{quadpoles/transformer core/width=0.6}
+ \ctikzset{quadpoles/gyrator/inner=1}
+ \ctikzset{quadpoles/gyrator/width=0.6}
+ }
+}
+
+
%
% multipoles
%
@@ -1074,7 +1102,51 @@
\pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
\ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
-
+% rotary switch by Romano
+\ctikzset{multipoles/rotary/thickness/.initial=1}
+\ctikzset{multipoles/rotary/shape/.initial=ocirc}
+\ctikzset{multipoles/rotary/channels/.initial=5}
+\ctikzset{multipoles/rotary/angle/.initial=60}
+\ctikzset{multipoles/rotary/wiper/.initial=20}
+\ctikzset{multipoles/rotary/arrow/.is choice}
+\newif\ifpgf@circ@rotaryarrow\pgf@circ@rotaryarrowfalse
+\newif\ifpgf@circ@rotaryarrow@cw\pgf@circ@rotaryarrow@cwfalse
+\newif\ifpgf@circ@rotaryarrow@ccw\pgf@circ@rotaryarrow@ccwfalse
+\ctikzset{multipoles/rotary/arrow/none/.code={\pgf@circ@rotaryarrowfalse\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/both/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwtrue}}
+\ctikzset{multipoles/rotary/arrow/cw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwtrue\pgf@circ@rotaryarrow@ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf@circ@rotaryarrowtrue\pgf@circ@rotaryarrow@cwfalse\pgf@circ@rotaryarrow@ccwtrue}}
+
+\tikzset{%
+ rotary switch/.style args={#1in#2wiper#3}{
+ shape=rotaryswitch,
+ /tikz/circuitikz/multipoles/rotary/channels=#1,
+ /tikz/circuitikz/multipoles/rotary/angle=#2,
+ /tikz/circuitikz/multipoles/rotary/wiper=#3,
+ },
+ rotary switch -/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=none,
+ },
+ rotary switch <-/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=ccw,
+ },
+ rotary switch ->/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=cw,
+ },
+ rotary switch <->/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=both,
+ },
+ % Notice that these should be the same as the initial values of the keys
+ rotary switch/.default={5 in 60 wiper 20 },
+ rotary switch -/.default={5 in 60 wiper 20 },
+ rotary switch <-/.default={5 in 60 wiper 20 },
+ rotary switch ->/.default={5 in 60 wiper 20 },
+ rotary switch <->/.default={5 in 60 wiper 20 },
+}
% %Mechanical section
\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
@@ -1149,7 +1221,6 @@
\ctikzset{flow/distance/.initial = .5}
\ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
-
\ctikzset{bipole/label/.is family}
\ctikzset{bipole/label/position/.initial=90}
\ctikzset{bipole/label/unit/.initial=}
@@ -1158,19 +1229,6 @@
\ctikzset{bipole/annotation/position/.initial=-90}
\ctikzset{bipole/annotation/unit/.initial=}
\ctikzset{bipole/annotation/name/.initial=}
-\ctikzset{bipole/nodes/.is family}
-\ctikzset{bipole/nodes/left/.is choice}
-\ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}}
-\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}}
-\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}}
-\ctikzset{bipole/nodes/left/diamond/.code={\ctikzsetvalof{bipole/nodes/left}{diamond}}}
-\ctikzset{bipole/nodes/left/rectjoinfill/.code={\ctikzsetvalof{bipole/nodes/left}{rectjoinfill}}}
-\ctikzset{bipole/nodes/right/.is choice}
-\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}}
-\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}}
-\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}}
-\ctikzset{bipole/nodes/right/diamond/.code={\ctikzsetvalof{bipole/nodes/right}{diamond}}}
-\ctikzset{bipole/nodes/right/rectjoinfill/.code={\ctikzsetvalof{bipole/nodes/right}{rectjoinfill}}}
\newif\ifpgf@circuit@europeanresistor
\ctikzset{resistor/.is choice}
@@ -1307,5 +1365,108 @@
\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+% seven segment displays by RGtti
+
+\newif\ifpgf@circ@sevenseg@dot
+\newif\ifpgf@circ@sevenseg@box
+\def\pgf@circ@sevenseg@dotstate{empty}
+\ctikzset{seven seg/.is family}
+\ctikzset{seven seg/dot/.is choice}
+% none means no dot, not space for it. Empty means no dot, but space
+\ctikzset{seven seg/dot/none/.code={\pgf@circ@sevenseg@dotfalse}}
+\ctikzset{seven seg/dot/empty/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{empty}}}
+\ctikzset{seven seg/dot/off/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{off}}}
+\ctikzset{seven seg/dot/on/.code={\pgf@circ@sevenseg@dottrue\def\pgf@circ@sevenseg@dotstate{on}}}
+%
+\ctikzset{seven seg/width/.initial=0.4}% relative to \pgf@circ@Rlen
+\ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
+\ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
+\ctikzset{seven seg/box sep/.initial=1pt}% external box gap
+\ctikzset{seven seg/color on/.initial=red}% color for segment "on"
+\ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
+\ctikzset{seven seg/box/.is choice}
+\ctikzset{seven seg/box/off/.code={\pgf@circ@sevenseg@boxfalse}}
+\ctikzset{seven seg/box/on/.code={\pgf@circ@sevenseg@boxtrue}}
+
+\ctikzset{seven seg/bits/.initial=0000000}
+
+\ctikzset{seven seg/value/.code={
+ \edef\@@tmp{#1}
+ \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
+ \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
+ \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
+ \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
+ \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
+ \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
+ \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
+ \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
+ \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
+ \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
+ \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{-} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
+}}
+
+\tikzset{%
+ seven segment val/.style args={#1dot#2box#3}{
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/value=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+ seven segment bits/.style args={#1dot#2box#3}{
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/bits=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+}
+
+
%%%%%%%%%% new
\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+
+% Electronic tubes: diodetube, triode, tetrode and pentode
+\ctikzset{tubes/width/.initial=1} % relative width
+\ctikzset{tubes/height/.initial=1.4} % relative height
+\ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
+\ctikzset{tubes/anode distance/.initial=0.40} % distance from center
+\ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
+\ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
+\ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
+\ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
+\ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
+\ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
+\ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
+\ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
+\ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
+\ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
+\ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
+
+\newif\ifpgf@circuit@tubes@filament\pgf@circuit@tubes@filamentfalse
+\pgfkeys{/tikz/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
+\ctikzset{tubes/filament/.add code={}{\pgf@circuit@tubes@filamenttrue}}
+\newif\ifpgf@circuit@tubes@nocathode\pgf@circuit@tubes@nocathodefalse
+\pgfkeys{/tikz/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
+\ctikzset{tubes/nocathode/.add code={}{\pgf@circuit@tubes@nocathodetrue}}
+\newif\ifpgf@circuit@tubes@fullcathode\pgf@circuit@tubes@fullcathodefalse
+\pgfkeys{/tikz/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
+\ctikzset{tubes/fullcathode/.add code={}{\pgf@circuit@tubes@fullcathodetrue}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
index b69e9c47708..bf024ec473f 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
@@ -936,10 +936,11 @@
\pgfpathmoveto{\pgfpointorigin}
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
\pgf@circ@maybefill
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{-90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{270}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
+ \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
+ \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}}
+ \pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up}
\pgfusepath{draw}
\pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
@@ -950,7 +951,6 @@
\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
\endpgfscope
}
-
%% DC-Voltage source
\pgfcircdeclarebipole
{}
@@ -2088,10 +2088,19 @@
\pgf@x=0pt
\pgf@y=.5\pgf@circ@res@other
}
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
% mid of the lever, to stack switches
\anchor{mid}{\midlever}
- \anchor{out}{\northeast \pgf@y=0cm}
- \anchor{in}{\southwest\pgf@y=0cm}
+ \anchor{cout}{\northeast \pgf@y=0cm}
+ \anchor{cin}{\southwest\pgf@y=0cm}
+ \anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius}
+ \anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius}
}
{\ctikzvalof{bipoles/cuteswitch/height 2}}
{#1}
@@ -2110,9 +2119,9 @@
#3
\endpgfscope
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
- \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}}
}
}
@@ -2743,87 +2752,6 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Handling of terminals
-
-
-%% Easily usable styles
-
-\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=empty}}
-\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=empty}}
-\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=none}}
-\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=empty}}
-\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=full}}
-\ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=empty}}
-\ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=diamond}}
-\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=none}}
-\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=full}}
-\ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=none}}
-\ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamond}}
-\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=full}}
-\ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=full}}
-\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=diamond}}
-\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=diamond}}
-
-\ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
-\ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=full}}
-\ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=empty}}
-\ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamond}}
-\ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
-\ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
-\ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
-\ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
-\ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
-
-\tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
-
-
-%% The output routine
-
-\def\drawpoles{
- \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{diamond} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztostart) node[diamondpole] {}
- \else
- \pgfextra{ \def\pgf@temp{empty} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztostart) node[ocirc] {}
- \else
- \pgfextra{ \def\pgf@temp{full} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztostart) node[circ] {}
- \else
- \pgfextra{ \def\pgf@temp{rectjoinfill} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztostart) node[rectjoinfill] {}
- \else
- \fi
- \fi
- \fi
- \fi
- \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{diamond} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztotarget) node[diamondpole] {}
- \else
- \pgfextra{ \def\pgf@temp{empty} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztotarget) node[ocirc] {}
- \else
- \pgfextra{ \def\pgf@temp{full} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztotarget) node[circ] {}
- \else
- \pgfextra{ \def\pgf@temp{rectjoinfill} }
- \ifx\pgf@temp\pgf@circ@temp
- (\tikztotarget) node[rectjoinfill] {}
- \else
- \fi
- \fi
- \fi
- \fi
-}
-
-
%% Lamp
@@ -4968,4 +4896,5 @@
\endpgfscope
}
+
% end of pgfcircbipoles.tex
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
index 1d386b5480b..4dc91d9eb66 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
@@ -102,15 +102,23 @@
\pgfmathadd{\pgf@circ@labanc}{180}
\edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
\fi
+ % \typeout{INI: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
+ %
+ % normalize the angle values
+ %
+ \pgfmathmod{\pgf@circ@labanc}{360}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ %
\ifpgf@circuit@bipole@inverted
\pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
\edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
\fi
-
+ %
\ifnum \ctikzvalof{mirror value} = -1
\pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
\edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
\fi
+ % \typeout{FIN: TEMP\space\pgf@circ@temp\space LABANC\space\pgf@circ@labanc}
}
%Firstly, place a coordinate directly at the edge of the shape
(\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
index 66f2d8dd511..8e26b7a668c 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
@@ -792,23 +792,25 @@
\behindforegroundpath{
\pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
\pgfscope
- \pgfpathmoveto{\pgfpointorigin}
- \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
- \pgfusepath{draw}
-
- \pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-
- \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
- \pgfusepath{draw}
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
- \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
- \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
}
-
}
% Vee
@@ -839,27 +841,28 @@
\behindforegroundpath{
\pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
-
\pgfscope
+ \edef\pgf@circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf@temp{legacy}
+ \ifx\pgf@temp\pgf@circ@temp
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf@circ@temp}
+ \fi
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
\pgfusepath{draw}
-
- \pgfstartlinewidth=\pgflinewidth
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
-
- \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
- \pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
-
\endpgfscope
}
-
}
-
% match
\pgfdeclareshape{match}{
\savedanchor{\northeast}{%
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
index 48c9c91a9d7..b2a626b63d9 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
@@ -27,6 +27,10 @@
% DIP (dual in line package) chips
\pgfdeclareshape{dipchip}{
+ \savedmacro\numpins{%
+ \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
+ \def\numpins{\the\c@pgf@counta}
+ }
\savedanchor\centerpoint{%
\pgf@x=-.5\wd\pgfnodeparttextbox%
\pgf@y=-.5\ht\pgfnodeparttextbox%
@@ -36,7 +40,7 @@
\anchor{center}{\origin}
\anchor{text}{\centerpoint}% to adjust text
\saveddimen\height{%
- \pgfmathsetlength\pgf@x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins})
+ \pgfmathsetlength\pgf@x{((\numpins)
*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf@circ@Rlen/2}%
}%
\saveddimen{\chipspacing}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}}}
@@ -44,7 +48,7 @@
\saveddimen{\extshift}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
% standard anchors
\savedanchor\northwest{%
- \pgfmathsetlength\pgf@y{0.5*((\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins})
+ \pgfmathsetlength\pgf@y{0.5*((\numpins)
*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing})*\pgf@circ@Rlen/2}%
\pgfmathsetlength\pgf@x{-0.5*\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}
}
@@ -90,7 +94,7 @@
\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
% Adding the pin number
\ifpgf@circuit@chip@shownumbers
- \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
+ \c@pgf@counta=\numpins\relax
\divide\c@pgf@counta by 2 \pgf@circ@count@b=\c@pgf@counta
% thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
\ifpgf@circuit@chip@straightnumbers
@@ -157,7 +161,7 @@
\ifdim\pgf@circ@res@other>0pt
\pgfscope
\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
- \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
+ \c@pgf@counta=\numpins\relax
\divide\c@pgf@counta by 2 \pgf@circ@count@b=\c@pgf@counta
\pgfmathloop%
\ifnum\c@pgf@counta>0
@@ -192,29 +196,18 @@
% and is executed just before a node is drawn.
\pgfutil@g@addto@macro\pgf@sh@s@dipchip{%
% Start with the maximum pin number and go backwards.
- % If the anchor is undefined, create it. Otherwise stop.
- \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
- \divide\c@pgf@counta by 2 \pgf@circ@count@b=\c@pgf@counta
+ \c@pgf@counta=\numpins\relax
\pgfmathloop%
\ifnum\c@pgf@counta>0
- % left side, pins 1..npins/2
% we will create two anchors per pin: the "normal one" like `pin 1` for the
% electrical contact, and the "border one" like `bpin 1` for labels.
% they will coincide if `external pins width` is set to 0.
- \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\c@pgf@counta\endcsname{%
- \noexpand\pgf@circ@chippinanchorLB{\the\c@pgf@counta}%
- }
\expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\c@pgf@counta\endcsname{%
- \noexpand\pgf@circ@chippinanchorL{\the\c@pgf@counta}%
+ \noexpand\pgf@circ@dippinanchor{\the\c@pgf@counta}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\c@pgf@counta\endcsname{%
+ \noexpand\pgf@circ@dippinanchor{\the\c@pgf@counta}{0}%
}
- % right side
- \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax
- \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorRB{\the\c@pgf@counta}%
- }%
- \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorR{\the\c@pgf@counta}%
- }%
\advance\c@pgf@counta by -1\relax%
\repeatpgfmathloop%
}%
@@ -223,6 +216,10 @@
% QFP (quad flat package) chips
\pgfdeclareshape{qfpchip}{
+ \savedmacro\numpins{%
+ \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
+ \def\numpins{\the\c@pgf@counta}
+ }
\savedanchor\centerpoint{%
\pgf@x=-.5\wd\pgfnodeparttextbox%
\pgf@y=-.5\ht\pgfnodeparttextbox%
@@ -232,18 +229,18 @@
\anchor{center}{\origin}
\anchor{text}{\centerpoint}% to adjust text
\saveddimen\height{%
- \pgfmathsetlength\pgf@x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}+2)
+ \pgfmathsetlength\pgf@x{((\numpins+2)
*\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
}%
\saveddimen\width{%
- \pgfmathsetlength\pgf@x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}+2)
+ \pgfmathsetlength\pgf@x{((\numpins+2)
*\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
}%
\saveddimen{\chipspacing}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}}}
\saveddimen{\extshift}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}}}
% standard anchors
\savedanchor\northwest{%
- \pgfmathsetlength\pgf@y{0.5*((\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}+2)
+ \pgfmathsetlength\pgf@y{0.5*((\numpins+2)
*\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
\pgf@x=-\pgf@y
}
@@ -294,7 +291,7 @@
% Adding the pin number
\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
\ifpgf@circuit@chip@shownumbers
- \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
+ \c@pgf@counta=\numpins%
\divide\c@pgf@counta by 4 \pgf@circ@count@b=\c@pgf@counta
% thanks to @marmot: https://tex.stackexchange.com/a/473571/38080
\ifpgf@circuit@chip@straightnumbers
@@ -401,7 +398,7 @@
\ifdim\pgf@circ@res@other>0pt
\pgfscope
\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth}
- \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
+ \c@pgf@counta=\numpins%
\divide\c@pgf@counta by 4 \pgf@circ@count@b=\c@pgf@counta
\pgfmathloop%
\ifnum\c@pgf@counta>0
@@ -452,41 +449,14 @@
% and is executed just before a node is drawn.
\pgfutil@g@addto@macro\pgf@sh@s@qfpchip{%
% Start with the maximum pin number and go backwards.
- % If the anchor is undefined, create it. Otherwise stop.
- \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
- \divide\c@pgf@counta by 4 \pgf@circ@count@b=\c@pgf@counta
+ \c@pgf@counta=\numpins%
\pgfmathloop%
\ifnum\c@pgf@counta>0
- % left side; 1..npins/4
\expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\c@pgf@counta\endcsname{%
- \noexpand\pgf@circ@chippinanchorQL{\the\c@pgf@counta}%
+ \noexpand\pgf@circ@qfppinanchor{\the\c@pgf@counta}{1}%
}
\expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\c@pgf@counta\endcsname{%
- \noexpand\pgf@circ@chippinanchorQLB{\the\c@pgf@counta}%
- }
- % bottom side;
- \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax
- \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorQB{\the\c@pgf@counta}%
- }
- \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorQBB{\the\c@pgf@counta}%
- }
- % right side; 2*npins/4+1, 3*npins/4
- \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax
- \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorQR{\the\c@pgf@counta}%
- }
- \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorQRB{\the\c@pgf@counta}%
- }
- % top side
- \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax
- \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorQT{\the\c@pgf@counta}%
- }
- \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@c\endcsname{%
- \noexpand\pgf@circ@chippinanchorQTB{\the\c@pgf@counta}%
+ \noexpand\pgf@circ@qfppinanchor{\the\c@pgf@counta}{0}%
}
\advance\c@pgf@counta-1\relax%
\repeatpgfmathloop%
@@ -494,66 +464,352 @@
}
%% anchors for DIP
-\def\pgf@circ@chippinanchorR#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2+\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}%
-}
-\def\pgf@circ@chippinanchorL#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{-\width/2-\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}%
-}
-\def\pgf@circ@chippinanchorRB#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}%
-}
-\def\pgf@circ@chippinanchorLB#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{-\width/2}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}%
+\def\pgf@circ@dippinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \c@pgf@countc=\numpins\relax
+ \divide\c@pgf@countc by 2
+ \ifnum #1 > \the\c@pgf@countc
+ % right side
+ \pgfpoint{\width/2+#2*\extshift}{-\height/2+(\pgf@circ@dip@pin@shift-\c@pgf@countc+#1-1)*\chipspacing}
+ \else
+ \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@dip@pin@shift-#1)*\chipspacing}
+\fi
}
%% anchors for QFP
-\def\pgf@circ@chippinanchorQR#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2+\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
+\def\pgf@circ@qfppinanchor#1#2{% #1: pin number #2: 0 for border pin, 1 for external pin
+ \c@pgf@countc=\numpins\relax
+ \divide\c@pgf@countc by 4
+ \ifnum #1 > \the\c@pgf@countc
+ \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 2
+ \ifnum #1 > \the\c@pgf@countb
+ \c@pgf@countb=\c@pgf@countc \multiply \c@pgf@countb by 3
+ \ifnum #1 > \the\c@pgf@countb
+ % 3*npins/4 < pin, top side
+ \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift+\c@pgf@countb-#1)*\chipspacing}{\height/2+#2*\extshift}%
+ \else
+ % 2*npins/4 < pin <= 3*npins/4, right side
+ \pgfpoint{\width/2+#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}%
+ \fi
+ \else
+ % npins/4 < pin <= 2*npins/4, bottom side
+ \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-\c@pgf@countb+#1-1)*\chipspacing}{-\height/2-#2*\extshift}%
+ \fi
+ \else
+ % <= npins/4, left side
+ \pgfpoint{-\width/2-#2*\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
+ \fi
+}
+
+
+%% Rotary Switch
+
+\pgfdeclareshape{rotaryswitch}
+{
+ \savedanchor\northeast{%
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{\r*\pgf@circ@Rlen + \pgf@circ@res@temp}
+ }
+ \savedanchor\northwest{%
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{-\r*\pgf@circ@Rlen - (\a<90 ? 1 : 1-2*cos(\a))*\pgf@circ@res@temp}
+ }
+ \savedanchor\central{%
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ % the magic number is 0.25/cos(35)
+ % try to recalculate it for the actual switch
+ \pgf@circ@res@temp=\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=.3052\pgf@circ@res@temp
+ \edef\a{\ctikzvalof{multipoles/rotary/angle}}
+ \edef\r{\ctikzvalof{nodes width}}
+ \pgfmathsetlength{\pgf@y}{\r*\pgf@circ@Rlen +(\a>90 ? 2 : 2*sin(\a))*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@x}{(\a<90 ? 0 : cos(\a))*\pgf@circ@res@temp}
+ }
+ % external square limits
+ \savedanchor\extnorthwest{%
+ \pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@Rlen
+ % this strange value makes the 2-pole rotary switch equal to the 2 poles cute spdt
+ \pgf@x=.3052\pgf@x % the magic number is 0.25/cos(35)
+ \pgf@x=2.5\pgf@x % external square size
+ \pgf@y=-\pgf@x %square thing when angle=180?
+ }
+ \saveddimen{\width}{\pgfmathsetlength\pgf@x{0.3052*\pgf@circ@Rlen*\ctikzvalof{tripoles/spdt/width}}}
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{multipoles/rotary/shape}}}
+ \savedmacro{\channels}{\def\channels{\ctikzvalof{multipoles/rotary/channels}}}
+ \savedmacro{\angle}{\def\angle{\ctikzvalof{multipoles/rotary/angle}}}
+ \savedmacro{\wiper}{\def\wiper{\ctikzvalof{multipoles/rotary/wiper}}}
+ \savedmacro{\stepa}{\pgfmathsetmacro{\stepa}{2*\ctikzvalof{multipoles/rotary/angle}/(\ctikzvalof{multipoles/rotary/channels}-1)}}
+ % mid of the lever, to stack switches
+ %\anchor{mid}{\midlever}
+ \anchor{mid}{\northwest
+ \pgf@circ@res@temp=-\pgf@x
+ \pgfmathsetlength{\pgf@x}{\pgf@circ@res@temp*(-1+cos(\wiper))}
+ \pgfmathsetlength{\pgf@y}{\pgf@circ@res@temp*sin(\wiper)}
+ }
+ % center anchors
+ \anchor{cin}{ \northwest \pgf@y=0pt\advance\pgf@x by \radius}
+ % horizontal angles
+ \anchor{in}{ \northwest \pgf@y=0pt}
+ \anchor{ain}{ \northwest \pgf@y=0pt}
+
+ \anchor{center}{ \central \pgf@y=0pt }
+ \anchor{east}{ \northeast \pgf@y=0pt }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \central \pgf@y=-\pgf@y }
+ \anchor{north}{ \central }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northeast }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northeast \pgf@y=-\pgf@y }
+
+ \anchor{ext center}{ \pgf@y=0pt \pgf@x=0pt \advance\pgf@x by -\width}
+ \anchor{ext east}{ \extnorthwest \pgf@y=0pt \pgf@x=-\pgf@x \advance\pgf@x by -\width}
+ \anchor{ext west}{ \extnorthwest \pgf@y=0pt \advance\pgf@x by -\width}
+ \anchor{ext south}{ \extnorthwest \pgf@x=0pt \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+ \anchor{ext north}{ \extnorthwest \pgf@x=0pt \advance\pgf@x by -\width}
+ \anchor{ext south west}{ \extnorthwest \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+ \anchor{ext north east}{ \extnorthwest \pgf@x=-\pgf@x \advance\pgf@x by -\width}
+ \anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
+ \anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgf@circ@res@right = \width
+ \pgf@circ@res@left = -\width
+
+ \pgfscope %wiper
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \pgf@circ@res@temp=\radius\relax
+ \pgf@circ@res@temp=\ctikzvalof{multipoles/rotary/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\wiper}{2\pgf@circ@res@right}}}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+
+ \ifpgf@circ@rotaryarrow
+ \pgfscope % arrow
+ \ifpgf@circ@rotaryarrow@ccw\pgfsetarrowsstart{latexslim}\fi
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % center of cin node
+ \pgftransformrotate{\wiper}
+ \pgfpathmoveto{\pgfpointpolar{50}{1.0\pgf@circ@res@right}}
+ \pgfpatharc{50}{-50}{1.0\pgf@circ@res@right}
+ \ifpgf@circ@rotaryarrow@cw\pgfsetarrowsend{latexslim}\fi
+ \pgfusepath{draw}
+ \endpgfscope
+ \fi
+
+ % \typeout{CHANNELS\space\channels\space ANGLE\space\angle}
+ \c@pgf@counta=\channels\relax
+ \pgfmathsetmacro{\currenta}{-\angle}
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0
+ % \typeout{LOOP\space\the\c@pgf@counta\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right}
+ \pgfscope
+ \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out \the\c@pgf@counta}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfmathsetmacro{\currenta}{\currenta+\stepa}
+ \advance\c@pgf@counta by -1\relax%
+ \repeatpgfmathloop
+
+ \pgfscope % input
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
+ \endpgfscope
+ }
+ % \pgf@sh@s@<name of the shape here> contains all the code for the shape
+ % and is executed just before a node is drawn.
+ \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{%
+ % Start with the maximum pin number and go backwards.
+ \c@pgf@counta=\channels\relax
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0
+ % we will create two anchors per pin: the "normal one" like `pin 1` for the
+ % electrical contact, and the "border one" like `bpin 1` for labels.
+ % they will coincide if `external pins width` is set to 0.
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\c@pgf@counta\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\c@pgf@counta}{1}{0}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\c@pgf@counta\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\c@pgf@counta}{0}{0}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\c@pgf@counta\endcsname{%
+ \noexpand\pgf@circ@rotaryanchor{\the\c@pgf@counta}{0}{1}%
+ }
+ \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\c@pgf@counta\endcsname{%
+ \noexpand\pgf@circ@rotarysqanchor{\the\c@pgf@counta}{0}%
+ }
+ \advance\c@pgf@counta by -1\relax%
+ \repeatpgfmathloop%
+ }%
}
-\def\pgf@circ@chippinanchorQL#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{-\width/2-\extshift}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
+
+\def\pgf@circ@rotaryanchor#1#2#3{% #1: numero del pin; #2: 1 - x pos, 0 - center; #3 0: inner, 1 outer
+ \pgf@circ@res@temp=\width
+ \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
+ \pgfmathsetlength{\pgf@x}{2*(\pgf@circ@res@temp+#3*\radius/2)*cos(\myangle))+#2*\radius}
+ \pgfmathsetlength{\pgf@y}{2*(\pgf@circ@res@temp+#3*\radius/2)*sin(\myangle)}
+ \advance\pgf@x by -\pgf@circ@res@temp
}
-\def\pgf@circ@chippinanchorQT#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}{\height/2+\extshift}%
+
+\def\pgf@circ@rotarysqanchor#1{% external square anchors
+ \pgf@circ@res@temp=\width
+ \pgfmathsetmacro{\myangle}{\angle-(#1-1)*\stepa}
+ \pgfpointborderrectangle{\pgfpointpolar{\myangle}{1pt}}{\pgfpoint{2.5\pgf@circ@res@temp}{2.5\pgf@circ@res@temp}}
+ \advance\pgf@x by -\pgf@circ@res@temp
}
-\def\pgf@circ@chippinanchorQB#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}{-\height/2-\extshift}%
+
+% Seven segments displays
+
+\pgfdeclareshape{bare7seg}{
+ \savedmacro{\dotstatus}{\edef\dotstatus{\pgf@circ@sevenseg@dotstate}}
+ \saveddimen{\dotspace}{% the dot is on the right, and occupy the same as the thickness
+ \ifpgf@circ@sevenseg@dot
+ \pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/thickness}}
+ \else
+ \pgf@x=0pt
+ \fi
+ }
+ % The object extension is more or less (-width/2,-width) to (width/2,width)
+ % and adjusted for line thickness (both sides) and eventually the dot
+ \saveddimen{\width}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}}
+ \saveddimen{\gap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/segment sep}}}
+ \saveddimen{\boxgap}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{seven seg/box sep}}}
+ \savedanchor{\southwest}{% both negative
+ \pgfmathsetlength{\pgf@x}{-0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
+ -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
+ \pgfmathsetlength{\pgf@y}{-\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
+ -0.5*\ctikzvalof{seven seg/thickness}-\ctikzvalof{seven seg/box sep}}
+ }
+ \savedanchor{\northeast}{% both positive
+ \ifpgf@circ@sevenseg@dot
+ \pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{seven seg/thickness}}
+ \else
+ \pgf@circ@res@other=0pt
+ \fi
+ \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
+ +0.5*\ctikzvalof{seven seg/thickness}+\pgf@circ@res@other+\ctikzvalof{seven seg/box sep}}
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen
+ +0.5*\ctikzvalof{seven seg/thickness}+\ctikzvalof{seven seg/box sep}}
+ }
+ \savedanchor{\topright}{% anchor without the box sep and the thickness
+ \pgfmathsetlength{\pgf@x}{0.5*\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{seven seg/width}*\pgf@circ@Rlen}
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{north west}{\southwest\pgf@y=-\pgf@y}
+ \anchor{north east}{\northeast}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\southwest}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0pt}
+ \anchor{south}{\southwest\pgf@x=0pt}
+ \anchor{west}{\southwest\pgf@y=0pt}
+ \anchor{a}{\topright\pgf@x=0pt}
+ \anchor{b}{\topright\pgf@y=0.5\pgf@y}
+ \anchor{c}{\topright\pgf@y=-0.5\pgf@y}
+ \anchor{d}{\topright\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{e}{\topright\pgf@x=-\pgf@x\pgf@y=-0.5\pgf@y}
+ \anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{g}{\pgfpointorigin}
+ \anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
+ \behindbackgroundpath{%
+ \southwest % I do not want the dot here, it will stick out
+ \pgf@circ@res@up = -\pgf@y
+ \pgf@circ@res@down = \pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \pgf@circ@res@left = -\pgf@x
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{multipoles/thickness}\pgflinewidth}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfpathrectanglecorners%
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
+ \ifpgf@circ@sevenseg@box
+ \pgf@circ@draworfill
+ \else
+ \pgf@circ@maybefill
+ \fi
+ \endpgfscope
+ \edef\bits{\ctikzvalof{seven seg/bits}}
+ \pgfscope
+ \pfg@circ@sseg@drawbits{\bits}
+ \endpgfscope
+ \pgfscope
+ \ifpgf@circ@sevenseg@dot
+ \pgf@circ@sseg@drawdots
+ \fi
+ \endpgfscope
+ }
}
-\def\pgf@circ@chippinanchorQRB#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
+
+\def\pgf@circ@sseg@splitbits#1#2#3#4#5#6#7\relax{%split the seven bits
+ \edef\@@a{#1}\edef\@@b{#2}\edef\@@c{#3}\edef\@@d{#4}\edef\@@e{#5}\edef\@@f{#6}\edef\@@g{#7}%
}
-\def\pgf@circ@chippinanchorQLB#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{-\width/2}{\height/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}%
+\def\pgf@circ@sseg@drawone#1#2#3#4#5{% #1 on off the x1, y1, x2 , y2
+ \ifnum #1 > 0\relax
+ \pgfsetcolor{\ctikzvalof{seven seg/color on}}
+ \else
+ \pgfsetcolor{\ctikzvalof{seven seg/color off}}
+ \fi
+ \pgfpathmoveto{\pgfpoint{#2}{#3}}
+ \pgfpathlineto{\pgfpoint{#4}{#5}}
+ \pgfusepath{draw}
}
-\def\pgf@circ@chippinanchorQTB#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}{\height/2}%
+\def\pfg@circ@sseg@drawbits#1{% #1 must be 7 bits
+ \expandafter\pgf@circ@sseg@splitbits#1\relax% a bit of magic...
+ \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
+ \pgfsetlinewidth{\ctikzvalof{seven seg/thickness}}
+ % \pgfsetroundcap
+ \pgfsetarrowsstart{Triangle Cap[]}
+ \pgfsetarrowsend{Triangle Cap[]}
+ % segments
+ \pgf@circ@sseg@drawone{\@@a}{-\width/2+\gap}{\width}{\width/2-\gap}{\width}
+ \pgf@circ@sseg@drawone{\@@b}{\width/2}{\width-\gap}{\width/2}{0pt+\gap}
+ \pgf@circ@sseg@drawone{\@@c}{\width/2}{0pt-\gap}{\width/2}{-\width+\gap}
+ \pgf@circ@sseg@drawone{\@@d}{\width/2-\gap}{-\width}{-\width/2+\gap}{-\width}
+ \pgf@circ@sseg@drawone{\@@e}{-\width/2}{-\width+\gap}{-\width/2}{0pt-\gap}
+ \pgf@circ@sseg@drawone{\@@f}{-\width/2}{0pt+\gap}{-\width/2}{\width-\gap}
+ \pgf@circ@sseg@drawone{\@@g}{-\width/2+\gap}{0pt}{\width/2-\gap}{0pt}
}
-\def\pgf@circ@chippinanchorQBB#1{%
- % When this macro is called,
- % \extshift, \height and \chipspacing will be defined.
- \pgfpoint{\width/2+(\pgf@circ@qfp@pin@shift-#1)*\chipspacing}{-\height/2}%
+\def\pgf@circ@sseg@drawdots{% dots
+ \edef\what{empty}
+ \ifx\what\pgf@circ@sevenseg@dotstate
+ % do nothing
+ \else
+ \pgfmathsetlength{\pgf@circ@res@other}{0.5*\ctikzvalof{seven seg/thickness}}
+ \edef\what{off}
+ \ifx\what\pgf@circ@sevenseg@dotstate
+ % dot off
+ \pgfsetfillcolor{\ctikzvalof{seven seg/color off}}
+ \pgfsetcolor{\ctikzvalof{seven seg/color off}}
+ \else
+ % dot on
+ \pgfsetfillcolor{\ctikzvalof{seven seg/color on}}
+ \pgfsetcolor{\ctikzvalof{seven seg/color on}}
+ \fi
+ \pgfpathcircle{\pgfpoint{\width/2+2*\pgf@circ@res@other}{-\width}}{\pgf@circ@res@other}
+ \pgfusepath{draw,fill}
+ \fi
}
-
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
index cb1c15022bd..bc10b95dc44 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
@@ -23,14 +23,11 @@
\newif\ifpgf@circuit@bipole@inverted
\ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
-
\newif\ifpgf@circuit@bipole@voltage@backward
\ctikzset{bipole/voltage/direction/.is choice}
\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
-
-
% Initialize paths
\def\pgfcircresetpath{
\ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
@@ -139,6 +136,56 @@
\tikztonodes%draw pending nodes an path
}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Handling of terminals
+
+\ctikzset{bipole/nodes/.is family}
+\ctikzset{bipole/nodes/left/.initial=none}
+\ctikzset{bipole/nodes/right/.initial=none}
+\tikzset{bipole nodes/.style n args={2}{%
+ \circuitikzbasekey/bipole/nodes/left=#1,
+ \circuitikzbasekey/bipole/nodes/right=#2
+ }
+}
+
+%% Easily usable styles
+
+\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+
+% rectjoinfill workarounds
+
+\ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=circ}}
+\ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=ocirc}}
+\ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamondpole}}
+\ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=ocirc, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=circ, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamondpole, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+
+\tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
+
+\def\drawpoles{
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{none}}
+ \ifx\pgf@temp\pgf@circ@temp\else(\tikztostart) node[\pgf@circ@temp] {}\fi
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} }
+ \ifx\pgf@temp\pgf@circ@temp\else(\tikztotarget) node[\pgf@circ@temp] {}\fi
+}
%% Path definitions
\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
index b1082ac4a12..a09d2076e66 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
@@ -18,7 +18,7 @@
\pgf@x=0pt
\pgf@y=0pt
}
- \savedmacro{\stretto}{\def\stretto{0.4}}
+ \savedmacro{\stretto}{\def\stretto{\ctikzvalof{quadpoles/#1/inner}}}
\savedanchor\northwest{%
\pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
\pgf@y=.5\pgf@y
@@ -254,6 +254,234 @@
}
+\pgfcircdeclarequadpole{transformer}{
+ \pgf@circ@drawtransformerbasicbody
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
+ \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
+ \pgfusepath{draw}
+
+}{}
+
+%% four-port
+% defines a general outer box for four-ports
+% TikZ usage:
+% \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
+% (coup.port1) to[short,-o] ++(-1,0)
+%
+
+\long\def\pgfcircdeclarefourport#1#2{
+ \pgfdeclareshape{#1}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=.5\pgf@circ@Rlen
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/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{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ #2
+
+ % draw inner text
+ \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ }
+ }
+}
+
+% four-port
+\pgfcircdeclarefourport{fourport}{}
+
+
+% straight coupler
+\pgfcircdeclarefourport{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarefourport{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+}
% contrib Kristofer M. Monisit
@@ -650,233 +878,3 @@
\pgfusepath{draw}
}
}
-
-
-\pgfcircdeclarequadpole{transformer}{
- \pgf@circ@drawtransformerbasicbody
-}{\pgf@circ@drawtransformerbasicanchor}
-
-\pgfcircdeclarequadpole{transformer core}{
-
- \pgf@circ@drawtransformerbasicbody
-
- \pgfmoveto{\pgfpoint%
- {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
- {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
- }
- \pgflineto{
- \pgfpoint
- {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
- {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
- }
-
- \pgfmoveto{\pgfpoint%
- {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
- {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
- }
- \pgflineto{
- \pgfpoint
- {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
- {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
- }
-
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
- \pgfusepath{draw}
-}{\pgf@circ@drawtransformerbasicanchor}
-
-
-\pgfcircdeclarequadpole{gyrator}{
-
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
-
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
-
- \pgfusepath{draw}
-
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\pgflinewidth}
- \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
- \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
-
- \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
- \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
- \pgfusepath{draw}
-
-}{}
-
-%% four-port
-% defines a general outer box for four-ports
-% TikZ usage:
-% \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
-% (coup.port1) to[short,-o] ++(-1,0)
-%
-
-\long\def\pgfcircdeclarefourport#1#2{
- \pgfdeclareshape{#1}{
- \anchor{center}{
- \northwest
- \pgf@x=0pt
- \pgf@y=0pt
- }
- \savedanchor\northwest{%
- \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=.5\pgf@circ@Rlen
- \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/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{1}{
- \northwest
- \pgf@y=-0.5\pgf@y
- }
- \anchor{2}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-0.5\pgf@y
- }
- \anchor{3}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=0.5\pgf@y
- }
- \anchor{4}{
- \northwest
- \pgf@y=0.5\pgf@y
- }
-
- \anchor{text}{
- \northwest
- \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
- \pgf@x=-.5\wd\pgfnodeparttextbox
- }
- \backgroundpath{
- \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-
- \northwest
- \pgf@circ@res@up = \pgf@y
- \pgf@circ@res@down = -\pgf@y
- \pgf@circ@res@right = -\pgf@x
- \pgf@circ@res@left = \pgf@x
-
- \pgfstartlinewidth=\pgflinewidth
-
- % draw outer box
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
- \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfusepath{draw}
-
- % draw inner stuff
- #2
-
- % draw inner text
- \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
- }
- }
-}
-
-% four-port
-\pgfcircdeclarefourport{fourport}{}
-
-
-% straight coupler
-\pgfcircdeclarefourport{coupler}{
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
- \pgfusepath{draw}
-
- \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
- \pgfsetarrows{latex-latex}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
- \pgfsetarrows{latex-latex}
- \pgfusepath{draw}
-}
-
-% "bended" coupler
-\pgfcircdeclarefourport{coupler2}{
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
- \pgfusepath{draw}
-
- \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
- \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
- \pgfsetarrowsend{latex}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
- \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
- \pgfsetarrowsend{latex}
- \pgfusepath{draw}
-
- \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
- \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
- \pgfsetarrowsend{latex}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
- \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
- \pgfsetarrowsend{latex}
- \pgfusepath{draw}
-}
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex
index 82eddb17453..657d0664f60 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex
@@ -126,7 +126,7 @@
\pgfpointorigin
}
\savedanchor\northwest{%
- \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
+ \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
\pgf@x=-\pgf@y
}
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
@@ -143,23 +143,184 @@
\anchor{north west}{ \northwest }
\anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
\anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% Diamond terminal, unfilled
+
+\pgfdeclareshape{odiamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
}
\behindforegroundpath{
\pgfscope
- \pgfmathsetlength{\pgf@circ@res@temp}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
\pgftransformrotate{45}
\pgfpathrectanglecorners
- {\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@temp}{\pgf@circ@res@up+\pgf@circ@res@temp}}
- {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up-\pgf@circ@res@temp}}
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgfsetfillcolor{white}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% square terminal, filled
+
+\pgfdeclareshape{squarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
\pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
\pgfsetfillopacity{1.0}
\pgfusepath{draw,fill}
\endpgfscope
}
}
+%% square terminal, unfilled
+\pgfdeclareshape{osquarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@x=-\pgf@y
+ }
+ \anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{w}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \anchor{north}{ \northwest \pgf@x=0pt }
+ \anchor{n}{ \northwest \pgf@x=0pt }
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ \anchorborder{
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{\pgf@circ@res@up}{\pgfqpoint{\pgf@circ@res@up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgfsetfillcolor{white}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
% BNC connector
\pgfdeclareshape{bnc}{
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
index 5a0417ed240..bfcffe9d359 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
@@ -145,13 +145,23 @@
\pgf@x=0pt
\pgf@y=.5\pgf@circ@res@other
}
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
% mid of the lever, to stack switches
\anchor{mid}{\midlever}
-
- \anchor{left}{\northwest \pgf@y=0pt }
- \anchor{in}{ \northwest \pgf@y=0pt}
- \anchor{out 1}{ \northwest \pgf@x=-\pgf@x }
- \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % center anchors
+ \anchor{cin}{ \northwest \pgf@y=0pt}
+ \anchor{cout 1}{ \northwest \pgf@x=-\pgf@x }
+ \anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % horizontal angles
+ \anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius}
+ \anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius}
+ \anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y }
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
\anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
@@ -173,7 +183,7 @@
\pgfscope
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
- \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=\radius\relax
\pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
\pgfsetlinewidth{2\pgf@circ@res@temp}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
@@ -186,15 +196,15 @@
% terminals
\pgfscope
\pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}}
\endpgfscope
\pgfscope
\pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}}
\endpgfscope
\pgfscope
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}}
\endpgfscope
}
@@ -347,14 +357,14 @@
\pgf@circ@res@right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@circ@Rlen
\pgf@circ@res@right = .5\pgf@circ@res@right
\pgf@circ@res@left = -\pgf@circ@res@right
- }%
- \savedmacro\inputs{% get number of inputs
- \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
- \ifnum\pgf@circ@res@count=0
- \pgf@circ@res@count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/inputs}\relax%
- \fi
+ }%
+ \savedmacro\inputs{% get number of inputs
+ \pgf@circ@res@count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+ \ifnum\pgf@circ@res@count=0
+ \pgf@circ@res@count=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/inputs}\relax%
+ \fi
\ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\fi
- \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
+ \ifnum\pgf@circ@res@count>16 \pgf@circ@res@count=16\fi
\def\inputs{\the\pgf@circ@res@count}%
}%
\savedanchor\step{% 1/2 gap at edges
@@ -4178,4 +4188,346 @@
}
}
+% Electronic tubes, submitted by J. op den Brouw
+
+% Draw tube outline
+\def\pgf@circ@tubes@drawtube{%
+ \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfutil@tempdima=\pgf@circ@res@right
+ \advance\pgfutil@tempdima by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}}
+ \pgfpatharc{270}{90}{\pgf@circ@res@up}
+ \else
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}}
+ \pgfutil@tempdima=\pgf@circ@res@up
+ \advance\pgfutil@tempdima by -\pgf@circ@res@right
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{\pgf@circ@res@right}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}}
+ \pgfpatharc{180}{0}{-\pgf@circ@res@right}
+ \fi
+ \pgfpathclose
+}
+
+%% The diode (tube), triode, tetrode and pentode only differ in the
+%% number of grids. So we construct a generic declare function in
+%% which we can put code for the grid anchors and grid drawing code
+%% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
+\long\def\pgfcircdeclaretube#1#2#3{%
+ \pgfdeclareshape{#1}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
+ % x and y should be half the Rlen
+ \pgf@y=\pgf@circ@res@up
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@circ@res@right
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{north} {%
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{east}{%
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0pt
+ }
+ \anchor{south}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{west}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{north west}{%
+ \northwest
+ }
+ \anchor{north east}{%
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{anode} {%
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{cathode}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{cathode 1}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{cathode 2}{%
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
+ }
+ \anchor{filament 1}{%
+ \northwest
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@x=\pgfmathresult\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{filament 2}{%
+ \northwest
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@x=-\pgfmathresult\pgf@x
+ \pgf@y=-\pgf@y
+ }
+
+ % Extra anchors
+ #2
+
+ \backgroundpath{
+ \pgfscope
+ % Line width for tripoles
+ \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth}
+
+ % Setup to draw tube
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up
+ \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+
+ % Tube fill color (if any)
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \else
+ \pgfscope
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgf@circ@tubes@drawtube
+ \pgfusepath{fill}
+ \endpgfscope
+ \fi
+
+ % Tube outline
+ \pgf@circ@tubes@drawtube
+
+ % Setup to draw grid, filament, anode and cathode
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen
+ \pgf@circ@res@up=0.5\pgf@circ@res@up
+ \pgf@circ@res@right=0.5\pgf@circ@res@right
+
+ % Grid drawing
+ #3
+
+ % Filament (is not drawn by default)
+ \ifpgf@circuit@tubes@filament
+ \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up
+ \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up
+ \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgf@xa=\pgfmathresult\pgf@circ@res@right
+ \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}}
+ \pgf@ya=\pgfmathresult\pgf@circ@res@up
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}
+ \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}}
+ \pgf@circuit@tubes@filamentfalse
+ \fi
+
+ % Anode (or plate)
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
+ \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+
+ % Cathode
+ \ifpgf@circuit@tubes@nocathode
+ \pgf@circuit@tubes@nocathodefalse
+ \else
+ \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \ifpgf@circuit@tubes@fullcathode
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgf@circuit@tubes@fullcathodefalse
+ \else
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}}
+ \fi
+ \fi
+
+ % Draw the background
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+ }
+}
+
+\pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
+
+\pgfcircdeclaretube{triode}
+{
+ \anchor{grid} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+}
+{
+ % Grid protrusion
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \@tempcnta=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\@tempcnta by 2\relax
+ \advance\@tempcnta by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \@tempcnta
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \@tempcnta=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\@tempcnta by-1
+ \ifnum\@tempcnta>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{tetrode}
+{
+ \anchor{grid} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
+ \pgf@y=0.5\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \pgfutil@tempdima=0.5\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \pgfutil@tempdimb=0.5\pgfutil@tempdimb
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \@tempcnta=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\@tempcnta by 2\relax
+ \advance\@tempcnta by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \@tempcnta
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \@tempcnta=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\@tempcnta by-1
+ \ifnum\@tempcnta>0\relax
+ \repeat
+}
+
+\pgfcircdeclaretube{pentode}
+{
+ \anchor{grid} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+ \anchor{screen} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+ \anchor{suppressor} {%
+ \northwest
+ \pgfutil@tempdima=\pgf@y
+ \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y
+ \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima
+ }
+}
+{
+ % Grid x/y points
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up
+ \pgfutil@tempdimb=-\pgfutil@tempdima
+ \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ \@tempdimc=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up
+ % Grid protrusion
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\@tempdimc}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\@tempdimc}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \@tempcnta=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\@tempcnta by 2\relax
+ \advance\@tempcnta by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \@tempcnta
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \@tempcnta=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\@tempdimc}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\@tempdimc}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \advance\@tempcnta by-1
+ \ifnum\@tempcnta>0\relax
+ \repeat
+}
+
\endinput
diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.4.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.4.sty
new file mode 100644
index 00000000000..bb803ed36cd
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.4.sty
@@ -0,0 +1,10127 @@
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+
+%%%%%
+%%%%%
+%%%%%
+%%%%% Se c'è l'opzione symbol, fallback to siunitx con warning
+%%%%%
+%%%%%
+
+\NeedsTeXFormat{LaTeX2e}
+
+\def\pgfcircversion{0.4}
+\def\pgfcircversiondate{2012/12/20}
+
+\ProvidesPackage{circuitikz-0.4}%
+ [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
+
+%% Version 2.0 of pgf/TikZ is required
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\usepgflibrary{decorations.pathmorphing,arrows}
+
+\DeclareOption{european}{
+ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
+ \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester = european}
+}
+
+\DeclareOption{american}{
+ \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester = american}
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{fulldiodes}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiodes}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{europeanvoltages}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{americanvoltages}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrents}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrents}{
+ \ctikzset{current = american}
+}
+
+\DeclareOption{europeanvoltages}{
+ \ctikzset{voltage = european}
+}
+
+\DeclareOption{americanresistors}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistors}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductors}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductors}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductors}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanports}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanports}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{americangfsurgearrester}{
+ \ctikzset{gas filled surge arrester = american}
+}
+
+\DeclareOption{europeangfsurgearrester}{
+ \ctikzset{gas filled surge arrester = european}
+}
+
+
+\DeclareOption{siunitx}{
+ \pgf@circ@siunitxtrue
+}
+
+\DeclareOption{nosiunitx}{
+ \pgf@circ@siunitxfalse
+}
+
+\DeclareOption{arrowmos}{
+ \pgf@circuit@mos@arrowstrue
+}
+
+\DeclareOption{noarrowmos}{
+ \pgf@circuit@mos@arrowsfalse
+}
+
+\DeclareOption{straightlabels}{
+ \ctikzset{label/align = straight}
+}
+
+\DeclareOption{rotatelabels}{
+ \ctikzset{label/align = rotate}
+}
+
+\DeclareOption{smartlabels}{
+ \ctikzset{label/align = smart}
+}
+
+
+
+\DeclareOption{fulldiode}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiode}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{europeanvoltage}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{americanvoltage}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrent}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrent}{
+ \ctikzset{current = american}
+}
+
+\DeclareOption{europeanvoltage}{
+ \ctikzset{voltage = european}
+}
+
+\DeclareOption{americanresistor}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistor}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductor}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductor}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductor}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanport}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{betterproportions}{
+ \ctikzset{monopoles/ground/width/.initial=.15}
+
+ \ctikzset{bipoles/resistor/height/.initial=.23}
+ \ctikzset{bipoles/resistor/width/.initial=.6}
+ \ctikzset{bipoles/capacitor/height/.initial=.4}
+ \ctikzset{bipoles/capacitor/width/.initial=.1}
+ \ctikzset{bipoles/potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
+ \ctikzset{bipoles/photoresistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistor/main/.initial=.7}
+ \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
+ \ctikzset{bipoles/thermistorptc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorptc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/main/.initial=.7}
+ \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/width/.initial=.6}
+ \ctikzset{bipoles/vresistor/height/.initial=.45}
+ \ctikzset{bipoles/vresistor/width/.initial=.6}
+ \ctikzset{bipoles/cuteinductor/height/.initial=.23}
+ \ctikzset{bipoles/cuteinductor/width/.initial=.6}
+ \ctikzset{bipoles/cuteinductor/coils/.initial=6}
+ \ctikzset{bipoles/americaninductor/height/.initial=.23}
+ \ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+ \ctikzset{bipoles/americaninductor/width/.initial=.6}
+ \ctikzset{bipoles/americaninductor/coils/.initial=4}
+ \ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+ \ctikzset{bipoles/vcuteinductor/coil height/.initial=.23}
+ \ctikzset{bipoles/vcuteinductor/width/.initial=.6}
+ \ctikzset{bipoles/vcuteinductor/coils/.initial=6}
+ \ctikzset{bipoles/vamericaninductor/height/.initial=.45}
+ \ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+ \ctikzset{bipoles/vamericaninductor/width/.initial=.6}
+ \ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+ \ctikzset{bipoles/generic/height/.initial=.23}
+ \ctikzset{bipoles/generic/width/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/ageneric/height/.initial=.23}
+ \ctikzset{bipoles/ageneric/width/.initial=.6}
+ \ctikzset{bipoles/memristor/height/.initial=.23}
+ \ctikzset{bipoles/memristor/wave height/.initial=.375}
+ \ctikzset{bipoles/memristor/width/.initial=.60}
+ \ctikzset{bipoles/tgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tgeneric/width/.initial=.6}
+ \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
+ \ctikzset{bipoles/fullgeneric/height/.initial=.23}
+ \ctikzset{bipoles/fullgeneric/width/.initial=.6}
+ \ctikzset{bipoles/diode/height/.initial=.3}
+ \ctikzset{bipoles/diode/width/.initial=.25}
+
+ \ctikzset{tripoles/thyristor/height/.initial=.66}
+ \ctikzset{tripoles/thyristor/height 2/.initial=.3}
+ \ctikzset{tripoles/thyristor/width/.initial=.6}
+ \ctikzset{tripoles/thyristor/diode height/.initial=.3}
+ \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+ \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+ \ctikzset{tripoles/triac/height/.initial=.66}
+ \ctikzset{tripoles/triac/width/.initial=.6}
+ \ctikzset{tripoles/triac/diode width left/.initial=.3}
+ \ctikzset{tripoles/triac/diode width right/.initial=.3}
+}
+
+%%%%%%%%%
+
+
+
+%%%%%%%%%%% Springe nach circuitikz.code
+%%%---------- open: circuitikz.code.tex
+
+%% Options
+
+
+
+
+%% Keys
+
+\long\def\pgf@circ@comment#1{}
+
+\def\circuitikzbasekey{/tikz/circuitikz}
+
+\pgfkeys{\circuitikzbasekey/.is family}
+
+\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
+\let\ctikzset\circuitikzset
+\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
+\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
+
+\newif\ifpgf@circuit@inputarrow
+\ctikzset{inputarrow/.is choice}
+\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
+
+\ctikzset{bipoles/.is family}
+\ctikzset{bipoles/border margin/.initial=1.1}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{bipoles/length/.initial=1.4cm}
+\ctikzset{nodes width/.initial=.04}
+\newdimen\pgf@circ@Rlen
+\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}}
+
+
+\ctikzset{monopoles/.is family}
+\ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/chassis/width/.initial=.25}
+\ctikzset{monopoles/alternative chassis/width/.initial=.25}
+\ctikzset{monopoles/equipotentiality/width/.initial=.25}
+\ctikzset{monopoles/tlinestub/width/.initial=.25}
+\ctikzset{monopoles/antenna/width/.initial=.25}
+\ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/width/.initial=.25}
+\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/rxantenna/width/.initial=.25}
+\ctikzset{monopoles/tground/thickness/.initial=3}
+\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/match/width/.initial=.4}
+\ctikzset{monopoles/oscillator/width/.initial=.7}
+
+\ctikzset{bipoles/resistor/height/.initial=.3}
+\ctikzset{bipoles/resistor/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/height/.initial=.8}
+\ctikzset{bipoles/potentiometer/height 2/.initial=.3}
+\ctikzset{bipoles/potentiometer/width/.initial=.8}
+\ctikzset{bipoles/photoresistor/height/.initial=.6}
+\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
+\ctikzset{bipoles/photoresistor/width/.initial=.8}
+\ctikzset{bipoles/thermistor/main/.initial=.7}
+\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/width/.initial=.8}
+\ctikzset{bipoles/thermistorntc/main/.initial=.7}
+\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistorptc/width/.initial=.8}
+\ctikzset{bipoles/thermistorptc/main/.initial=.7}
+\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistor/width/.initial=.8}
+\ctikzset{bipoles/varistor/main/.initial=.7}
+\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/varistor/width/.initial=.8}
+\ctikzset{bipoles/vresistor/height/.initial=.6}
+\ctikzset{bipoles/vresistor/width/.initial=.8}
+\ctikzset{bipoles/cuteinductor/height/.initial=.3}
+\ctikzset{bipoles/cuteinductor/width/.initial=.8}
+\ctikzset{bipoles/cuteinductor/coils/.initial=6}
+\ctikzset{bipoles/americaninductor/height/.initial=.3}
+\ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+\ctikzset{bipoles/americaninductor/width/.initial=.8}
+\ctikzset{bipoles/americaninductor/coils/.initial=4}
+\ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/coil height/.initial=.3}
+\ctikzset{bipoles/vcuteinductor/width/.initial=.8}
+\ctikzset{bipoles/vcuteinductor/coils/.initial=6}
+\ctikzset{bipoles/vamericaninductor/height/.initial=.6}
+\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+\ctikzset{bipoles/vamericaninductor/width/.initial=.8}
+\ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+\ctikzset{bipoles/isource/height/.initial=.60}
+\ctikzset{bipoles/isource/width/.initial=.60}
+\ctikzset{bipoles/isourceam/height/.initial=.60}
+\ctikzset{bipoles/isourceam/width/.initial=.60}
+\ctikzset{bipoles/vsource/height/.initial=.60}
+\ctikzset{bipoles/vsource/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/height/.initial=.60}
+\ctikzset{bipoles/vsourceam/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/margin/.initial=.7}
+\ctikzset{bipoles/isourcesin/height/.initial=.60}
+\ctikzset{bipoles/isourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesin/height/.initial=.60}
+\ctikzset{bipoles/vsourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/height/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/width/.initial=.60}
+\ctikzset{bipoles/cisource/height/.initial=.7}
+\ctikzset{bipoles/cisource/width/.initial=.7}
+\ctikzset{bipoles/cisourceam/height/.initial=.7}
+\ctikzset{bipoles/cisourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsource/height/.initial=.7}
+\ctikzset{bipoles/cvsource/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/height/.initial=.7}
+\ctikzset{bipoles/cvsourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/margin/.initial=.7}
+\ctikzset{bipoles/cvsourceam/text scale/.initial=1}
+\ctikzset{bipoles/cisourcesin/width/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/height/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/width/.initial=.7}
+\ctikzset{bipoles/capacitor/height/.initial=.6}
+\ctikzset{bipoles/capacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/height/.initial=.6}
+\ctikzset{bipoles/pcapacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/vcapacitor/height/.initial=.6}
+\ctikzset{bipoles/vcapacitor/width/.initial=.5}
+\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/battery/height/.initial=.6}
+\ctikzset{bipoles/battery/width/.initial=.3}
+\ctikzset{bipoles/battery1/height/.initial=.6}
+\ctikzset{bipoles/battery1/width/.initial=.3}
+\ctikzset{bipoles/diode/height/.initial=.50}
+\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/varcap/height/.initial=.50}
+\ctikzset{bipoles/varcap/width/.initial=.45}
+\ctikzset{bipoles/interr/height/.initial=.35}
+\ctikzset{bipoles/interr/width/.initial=.35}
+\ctikzset{bipoles/interr/height 2/.initial=.1}
+\ctikzset{bipoles/generic/height/.initial=.30}
+\ctikzset{bipoles/generic/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
+\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
+\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
+\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
+\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
+\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
+\ctikzset{bipoles/fuse/height/.initial=.20}
+\ctikzset{bipoles/fuse/width/.initial=.50}
+\ctikzset{bipoles/afuse/height/.initial=.20}
+\ctikzset{bipoles/afuse/width/.initial=.50}
+\ctikzset{bipoles/generic potentiometer/height/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
+\ctikzset{bipoles/generic potentiometer/width/.initial=.80}
+\ctikzset{bipoles/ageneric/height/.initial=.30}
+\ctikzset{bipoles/ageneric/width/.initial=.80}
+\ctikzset{bipoles/memristor/height/.initial=.30}
+\ctikzset{bipoles/memristor/wave height/.initial=.5}
+\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/tgeneric/height/.initial=.70}
+\ctikzset{bipoles/tgeneric/width/.initial=.80}
+\ctikzset{bipoles/tfullgeneric/height/.initial=.70}
+\ctikzset{bipoles/tfullgeneric/width/.initial=.80}
+\ctikzset{bipoles/fullgeneric/height/.initial=.30}
+\ctikzset{bipoles/fullgeneric/width/.initial=.80}
+\ctikzset{bipoles/open/height/.initial=.25}
+\ctikzset{bipoles/open/width/.initial=.8}
+\ctikzset{bipoles/ammeter/height/.initial=.60}
+\ctikzset{bipoles/ammeter/width/.initial=.60}
+\ctikzset{bipoles/voltmeter/height/.initial=.60}
+\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/buffer/height/.initial=1}
+\ctikzset{bipoles/buffer/width/.initial=1}
+\ctikzset{bipoles/not port/width/.initial=1}
+\ctikzset{bipoles/not port/height/.initial=.8}
+\ctikzset{bipoles/not port/circle width/.initial=.15}
+\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/tline/height/.initial=.3}
+\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/squid/height/.initial=.60}
+\ctikzset{bipoles/squid/width/.initial=.60}
+\ctikzset{bipoles/barrier/height/.initial=.60}
+\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/thermocouple/height/.initial=.250}
+\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
+\ctikzset{bipoles/thermocouple/width/.initial=.140}
+\ctikzset{bipoles/pushbutton/height/.initial=.5}
+\ctikzset{bipoles/pushbutton/height 2/.initial=.0}
+\ctikzset{bipoles/pushbutton/width/.initial=.50}
+\ctikzset{bipoles/twoport/width/.initial=.7}
+\ctikzset{bipoles/twoport/height/.initial=.7}
+\ctikzset{bipoles/twoport/text/.initial=}
+\ctikzset{bipoles/vco/width/.initial=.7}
+\ctikzset{bipoles/bandpass/width/.initial=.7}
+\ctikzset{bipoles/highpass/width/.initial=.7}
+\ctikzset{bipoles/lowpass/width/.initial=.7}
+\ctikzset{bipoles/adc/width/.initial=.7}
+\ctikzset{bipoles/dac/width/.initial=.7}
+\ctikzset{bipoles/dsp/width/.initial=.7}
+\ctikzset{bipoles/fft/width/.initial=.7}
+\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/vamp/width/.initial=.7}
+\ctikzset{bipoles/piattenuator/width/.initial=.7}
+\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
+\ctikzset{bipoles/tattenuator/width/.initial=.7}
+\ctikzset{bipoles/vtattenuator/width/.initial=.7}
+\ctikzset{bipoles/phaseshifter/width/.initial=.7}
+\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
+\ctikzset{bipoles/detector/width/.initial=.7}
+
+\newif\ifpgf@circuit@mos@arrows
+\ctikzset{tripoles/mos style/.is choice}
+\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
+\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
+\ctikzset{tripoles/nmos/width/.initial=.7}
+\ctikzset{tripoles/nmos/gate height/.initial=.35}
+\ctikzset{tripoles/nmos/base height/.initial=.5}
+\ctikzset{tripoles/nmos/height/.initial=1.1}
+\ctikzset{tripoles/nmos/base width/.initial=.5}
+\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/width/.initial=.7}
+\ctikzset{tripoles/pmos/gate height/.initial=.35}
+\ctikzset{tripoles/pmos/base height/.initial=.5}
+\ctikzset{tripoles/pmos/height/.initial=1.1}
+\ctikzset{tripoles/pmos/base width/.initial=.5}
+\ctikzset{tripoles/pmos/gate width/.initial=.62}
+
+\ctikzset{tripoles/nfet/width/.initial=.7}
+\ctikzset{tripoles/nfet/gate height/.initial=.35}
+\ctikzset{tripoles/nfet/base height/.initial=.5}
+\ctikzset{tripoles/nfet/height/.initial=1.1}
+\ctikzset{tripoles/nfet/base width/.initial=.5}
+\ctikzset{tripoles/nfet/gate width/.initial=.62}
+
+\ctikzset{tripoles/pfet/width/.initial=.7}
+\ctikzset{tripoles/pfet/gate height/.initial=.35}
+\ctikzset{tripoles/pfet/base height/.initial=.5}
+\ctikzset{tripoles/pfet/height/.initial=1.1}
+\ctikzset{tripoles/pfet/base width/.initial=.5}
+\ctikzset{tripoles/pfet/gate width/.initial=.62}
+
+\ctikzset{tripoles/nigfete/width/.initial=.7}
+\ctikzset{tripoles/nigfete/gate height/.initial=.35}
+\ctikzset{tripoles/nigfete/base height/.initial=.5}
+\ctikzset{tripoles/nigfete/height/.initial=1.1}
+\ctikzset{tripoles/nigfete/base width/.initial=.5}
+\ctikzset{tripoles/nigfete/gate width/.initial=.62}
+
+\ctikzset{tripoles/nigfetd/width/.initial=.7}
+\ctikzset{tripoles/nigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetd/base height/.initial=.5}
+\ctikzset{tripoles/nigfetd/height/.initial=1.1}
+\ctikzset{tripoles/nigfetd/base width/.initial=.5}
+\ctikzset{tripoles/nigfetd/gate width/.initial=.62}
+
+\ctikzset{tripoles/pigfete/width/.initial=.7}
+\ctikzset{tripoles/pigfete/gate height/.initial=.35}
+\ctikzset{tripoles/pigfete/base height/.initial=.5}
+\ctikzset{tripoles/pigfete/height/.initial=1.1}
+\ctikzset{tripoles/pigfete/base width/.initial=.5}
+\ctikzset{tripoles/pigfete/gate width/.initial=.62}
+
+\ctikzset{tripoles/pigfetd/width/.initial=.7}
+\ctikzset{tripoles/pigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetd/base height/.initial=.5}
+\ctikzset{tripoles/pigfetd/height/.initial=1.1}
+\ctikzset{tripoles/pigfetd/base width/.initial=.5}
+\ctikzset{tripoles/pigfetd/gate width/.initial=.62}
+
+\ctikzset{tripoles/npn/width/.initial=.6}
+\ctikzset{tripoles/npn/gate height/.initial=.45}
+\ctikzset{tripoles/npn/gate height 2/.initial=.15}
+\ctikzset{tripoles/npn/base height/.initial=.4}
+\ctikzset{tripoles/npn/height/.initial=1.1}
+\ctikzset{tripoles/npn/gate width/.initial=.5}
+
+
+
+\ctikzset{tripoles/pnp/width/.initial=.6}
+\ctikzset{tripoles/pnp/gate height/.initial=.45}
+\ctikzset{tripoles/pnp/gate height 2/.initial=.15}
+\ctikzset{tripoles/pnp/base height/.initial=.4}
+\ctikzset{tripoles/pnp/height/.initial=1.1}
+\ctikzset{tripoles/pnp/gate width/.initial=.5}
+
+\ctikzset{tripoles/pigbt/width/.initial=.6}
+\ctikzset{tripoles/pigbt/gate height/.initial=.45}
+\ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/pigbt/base height/.initial=.4}
+\ctikzset{tripoles/pigbt/height/.initial=1.1}
+\ctikzset{tripoles/pigbt/gate width/.initial=.62}
+\ctikzset{tripoles/pigbt/base width/.initial=.5}
+\ctikzset{tripoles/nigbt/width/.initial=.6}
+\ctikzset{tripoles/nigbt/gate height/.initial=.45}
+\ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/nigbt/base height/.initial=.4}
+\ctikzset{tripoles/nigbt/height/.initial=1.1}
+\ctikzset{tripoles/nigbt/gate width/.initial=.62}
+\ctikzset{tripoles/nigbt/base width/.initial=.5}
+
+\ctikzset{tripoles/njfet/width/.initial=.7}
+\ctikzset{tripoles/njfet/gate height/.initial=.5}
+\ctikzset{tripoles/njfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/njfet/gate width/.initial=.5}
+\ctikzset{tripoles/njfet/height/.initial=1.1}
+\ctikzset{tripoles/pjfet/width/.initial=.7}
+\ctikzset{tripoles/pjfet/gate height/.initial=.5}
+\ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/pjfet/gate width/.initial=.5}
+\ctikzset{tripoles/pjfet/height/.initial=1.1}
+
+\ctikzset{tripoles/isfet/width/.initial=1}
+\ctikzset{tripoles/isfet/gate height/.initial=.35}
+\ctikzset{tripoles/isfet/base height/.initial=.5}
+\ctikzset{tripoles/isfet/height/.initial=1.1}
+\ctikzset{tripoles/isfet/base width/.initial=.3}
+\ctikzset{tripoles/isfet/gate width/.initial=.5}
+\ctikzset{tripoles/isfet/wave width/.initial=.16}
+\ctikzset{tripoles/isfet/wave amp/.initial=.06}
+\ctikzset{tripoles/isfet/waves y sep/.initial=.22}
+\ctikzset{tripoles/isfet/waves x sep/.initial=.8}
+
+\newif\ifpgf@circuit@europeanlogicport
+\ctikzset{logic ports/.is choice}
+\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue } }
+\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse } }
+
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+
+\ctikzset{tripoles/american and port/width/.initial=1.1}
+\ctikzset{tripoles/american and port/height/.initial=.8}
+\ctikzset{tripoles/american and port/port width/.initial=.7}
+\ctikzset{tripoles/american and port/input height/.initial=.5}
+\ctikzset{tripoles/american nand port/width/.initial=1.1}
+\ctikzset{tripoles/american nand port/height/.initial=.8}
+\ctikzset{tripoles/american nand port/port width/.initial=.7}
+\ctikzset{tripoles/american nand port/circle width/.initial=.15}
+\ctikzset{tripoles/american nand port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/width/.initial=1.1}
+\ctikzset{tripoles/american or port/height/.initial=.8}
+\ctikzset{tripoles/american or port/port width/.initial=.7}
+\ctikzset{tripoles/american or port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/input skip/.initial=.25}
+\ctikzset{tripoles/american or port/aaa/.initial=.6}
+\ctikzset{tripoles/american or port/bbb/.initial=.4}
+\ctikzset{tripoles/american or port/ccc/.initial=.5}
+\ctikzset{tripoles/american or port/ddd/.initial=.0}
+\ctikzset{tripoles/american nor port/width/.initial=1.1}
+\ctikzset{tripoles/american nor port/height/.initial=.8}
+\ctikzset{tripoles/american nor port/port width/.initial=.7}
+\ctikzset{tripoles/american nor port/input height/.initial=.5}
+\ctikzset{tripoles/american nor port/input skip/.initial=.25}
+\ctikzset{tripoles/american nor port/circle width/.initial=.15}
+\ctikzset{tripoles/american nor port/aaa/.initial=.6}
+\ctikzset{tripoles/american nor port/bbb/.initial=.4}
+\ctikzset{tripoles/american nor port/ccc/.initial=.5}
+\ctikzset{tripoles/american nor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xor port/width/.initial=1.1}
+\ctikzset{tripoles/american xor port/height/.initial=.8}
+\ctikzset{tripoles/american xor port/port width/.initial=.7}
+\ctikzset{tripoles/american xor port/input height/.initial=.5}
+\ctikzset{tripoles/american xor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xor port/distance/.initial=.1}
+\ctikzset{tripoles/american xor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/width/.initial=1.1}
+\ctikzset{tripoles/american xnor port/height/.initial=.8}
+\ctikzset{tripoles/american xnor port/port width/.initial=.7}
+\ctikzset{tripoles/american xnor port/input height/.initial=.5}
+\ctikzset{tripoles/american xnor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xnor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xnor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xnor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xnor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/european and port/width/.initial=1.4}
+\ctikzset{tripoles/european and port/height/.initial=.65}
+\ctikzset{tripoles/european and port/reserved/.initial=.6}
+\ctikzset{tripoles/european and port/input height/.initial=.6}
+\ctikzset{tripoles/european or port/width/.initial=1.4}
+\ctikzset{tripoles/european or port/height/.initial=.65}
+\ctikzset{tripoles/european or port/reserved/.initial=.6}
+\ctikzset{tripoles/european or port/input height/.initial=.6}
+\ctikzset{tripoles/european xor port/width/.initial=1.4}
+\ctikzset{tripoles/european xor port/height/.initial=.65}
+\ctikzset{tripoles/european xor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xor port/input height/.initial=.6}
+\ctikzset{tripoles/european nand port/width/.initial=1.4}
+\ctikzset{tripoles/european nand port/not height/.initial=.3}
+\ctikzset{tripoles/european nand port/not width/.initial=.8}
+\ctikzset{tripoles/european nand port/height/.initial=.65}
+\ctikzset{tripoles/european nand port/reserved/.initial=.6}
+\ctikzset{tripoles/european nand port/input height/.initial=.6}
+\ctikzset{tripoles/european not port/width/.initial=1.4}
+\ctikzset{tripoles/european not port/not height/.initial=.3}
+\ctikzset{tripoles/european not port/not width/.initial=.8}
+\ctikzset{tripoles/european not port/height/.initial=.65}
+\ctikzset{tripoles/european not port/reserved/.initial=.6}
+\ctikzset{tripoles/european not port/input height/.initial=0}
+\ctikzset{tripoles/european xnor port/width/.initial=1.4}
+\ctikzset{tripoles/european xnor port/not height/.initial=.3}
+\ctikzset{tripoles/european xnor port/not width/.initial=.8}
+\ctikzset{tripoles/european xnor port/height/.initial=.65}
+\ctikzset{tripoles/european xnor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xnor port/input height/.initial=.6}
+\ctikzset{tripoles/european nor port/width/.initial=1.4}
+\ctikzset{tripoles/european nor port/not height/.initial=.3}
+\ctikzset{tripoles/european nor port/not width/.initial=.8}
+\ctikzset{tripoles/european nor port/height/.initial=.65}
+\ctikzset{tripoles/european nor port/reserved/.initial=.6}
+\ctikzset{tripoles/european nor port/input height/.initial=.6}
+\ctikzset{tripoles/op amp/width/.initial=1.7}
+\ctikzset{tripoles/op amp/port width/.initial=.7}
+\ctikzset{tripoles/op amp/height/.initial=1.4}
+\ctikzset{tripoles/op amp/input height/.initial=.5}
+\ctikzset{tripoles/op amp/up pos/.initial=.45}
+\ctikzset{tripoles/plain amp/width/.initial=1.7}
+\ctikzset{tripoles/plain amp/port width/.initial=.7}
+\ctikzset{tripoles/plain amp/height/.initial=1.4}
+\ctikzset{tripoles/plain amp/input height/.initial=.5}
+\ctikzset{tripoles/plain amp/up pos/.initial=.45}
+
+\ctikzset{tripoles/thyristor/height/.initial=1.10}
+\ctikzset{tripoles/thyristor/height 2/.initial=.5}
+\ctikzset{tripoles/thyristor/width/.initial=1.0}
+\ctikzset{tripoles/thyristor/diode height/.initial=.5}
+\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+\ctikzset{tripoles/triac/height/.initial=1.1}
+\ctikzset{tripoles/triac/width/.initial=1}
+\ctikzset{tripoles/triac/diode width left/.initial=.3}
+\ctikzset{tripoles/triac/diode width right/.initial=.3}
+
+\ctikzset{tripoles/spdt/width/.initial=.85}
+\ctikzset{tripoles/spdt/height/.initial=.45}
+\ctikzset{tripoles/spdt/margin/.initial=.45}
+
+\ctikzset{tripoles/toggleswitch/height/.initial=.8}
+\ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
+\ctikzset{tripoles/toggleswitch/width/.initial=.80}
+
+\ctikzset{tripoles/mixer/width/.initial=0.7}
+\ctikzset{tripoles/adder/width/.initial=0.7}
+\ctikzset{tripoles/circulator/width/.initial=.7}
+
+\ctikzset{tripoles/wilkinson/height/.initial=1.3}
+\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+
+\ctikzset{quadpoles/transformer/width/.initial=1.5}
+\ctikzset{quadpoles/transformer/width1/.initial=.4}
+\ctikzset{quadpoles/transformer/height/.initial=1.5}
+\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/width/.initial=1.5}
+\ctikzset{quadpoles/transformer core/height/.initial=1.5}
+\ctikzset{quadpoles/transformer core/core height/.initial=.5}
+\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/width/.initial=1.5}
+\ctikzset{quadpoles/gyrator/height/.initial=1.5}
+\ctikzset{quadpoles/coupler/width/.initial=1.3}
+\ctikzset{quadpoles/coupler/height/.initial=1.3}
+
+\ctikzset{bipole/.is family}
+\ctikzset{bipole/kind/.initial = }
+\ctikzset{bipole/name/.initial = }
+\newif\ifpgf@circuit@bipole@reversed
+\ctikzset{bipole/reversed/.is if=pgf@circuit@bipole@reversed}
+\newif\ifpgf@circuit@bipole@isvoltage
+\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
+\newif\ifpgf@circuit@bipole@iscurrent
+\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
+
+\ctikzset{bipole/voltage/.is family}
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+\newif\ifpgf@circuit@bipole@voltage@below
+\ctikzset{bipole/voltage/position/.is choice}
+\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
+\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
+
+\ctikzset{bipole/voltage/label/unit/.initial=}
+\ctikzset{bipole/voltage/label/name/.initial=}
+
+\ctikzset{bipole/current/.is family}
+\newif\ifpgf@circuit@bipole@current@backward
+\ctikzset{bipole/current/direction/.is choice}
+\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
+\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
+\newif\ifpgf@circuit@bipole@current@before
+\ctikzset{bipole/current/x position/.is choice}
+\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
+\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
+\newif\ifpgf@circuit@bipole@current@below
+\ctikzset{bipole/current/y position/.is choice}
+\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
+\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
+
+\ctikzset{bipole/current/label/unit/.initial=}
+\ctikzset{bipole/current/label/name/.initial=}
+
+\ctikzset{bipole/label/.is family}
+\ctikzset{bipole/label/position/.initial=90}
+\ctikzset{bipole/label/unit/.initial=}
+\ctikzset{bipole/label/name/.initial=}
+\ctikzset{bipole/nodes/.is family}
+\ctikzset{bipole/nodes/left/.is choice}
+\ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}}
+\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}}
+\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}}
+\ctikzset{bipole/nodes/right/.is choice}
+\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}}
+\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}}
+\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}}
+
+
+\newif\ifpgf@circuit@europeanresistor
+\ctikzset{resistor/.is choice}
+\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
+\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
+
+\ctikzset{inductor/.is choice}
+\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
+\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
+\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+
+\newif\ifpgf@circuit@fulldiode
+\ctikzset{diode/.is if=pgf@circuit@fulldiode}
+\ctikzset{diode/.is choice}
+\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse }
+\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
+\ctikzset{thickness/.initial=2}
+\ctikzset{color/.initial=black}
+\pgfkeys{/tikz/color/.add code={}{\ctikzset{color=#1}}}
+
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circ@siunitx@res
+
+\ctikzset{voltage/.is family}
+\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
+\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
+\ctikzset{voltage/bump a/.initial=1.2}
+\ctikzset{voltage/bump b/.initial=1.5}
+\ctikzset{voltage/european label distance/.initial=1.4}
+\ctikzset{voltage/american label distance/.initial=1.1}
+% special cases
+\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
+\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
+\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
+\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
+\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
+%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
+%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
+
+\ctikzset{current/.is family}
+\ctikzset{current/distance/.initial = .5}
+
+\tikzset{american currents/.style = { \circuitikzbasekey/current = american } }
+\tikzset{european currents/.style = { \circuitikzbasekey/current = european } }
+\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } }
+\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } }
+\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } }
+\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } }
+
+\newif\ifpgf@circuit@europeangfsurgearrester
+\ctikzset{gas filled surge arrester/.is choice}
+\ctikzset{gas filled surge arrester/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } }
+\ctikzset{gas filled surge arrester/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } }
+
+\tikzset{american gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = american } }
+\tikzset{european gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = european } }
+\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } }
+\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } }
+\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } }
+\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full } }
+\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty } }
+\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } }
+\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } }
+\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester } }
+\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester } }
+\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } }
+
+% I should try to make the tree clearer (this voltaege conflicts with the options above)
+
+\newif\ifpgf@circuit@europeanvoltage
+\ctikzset{voltage/.is choice}
+\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } }
+\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } }
+
+\newif\ifpgf@circuit@europeancurrent
+\ctikzset{current/.is choice}
+\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse }
+\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue }
+
+\ctikzset{label/align/.is choice}
+\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
+\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
+\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+%% dependencies
+
+
+
+
+%%%%%%%%%% new
+\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+
+
+
+
+
+%%%%%%%%%%% Springe nach pgfcircutils
+%%%---------- open: pgfcircutils.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%\def\pgf@circ@handleSI#1{%
+ % \pgf@circ@siunitx@resfalse
+%
+ % \edef\len{\stringlength[e]{#1}}
+ %\testmatchingchar[e]{#1}{\len}{>}%
+ %\ifmatchingchar%
+ % \ifnum\findchars{#1}{<}=0
+ % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
+ %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
+ %\pgf@circ@siunitx@restrue
+% \else
+% \fi
+ %\else
+ %\fi
+%}
+
+\def\pgf@circ@handleSI#1{
+ \noexpandarg
+ \def\pgf@temp{}
+ \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
+ \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
+
+ \ifnum\pgf@circ@handleSI@unit@len=0
+ \pgf@circ@siunitx@resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf@circ@siunitx@restrue
+ \noexpandarg
+ \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
+ %\typeout{si |#1|}
+ }{
+ \pgf@circ@siunitx@resfalse
+ %\typeout{no si |#1|}
+ }
+ \fi
+}
+
+\def\pgf@circ@finallabel#1{%
+ \edef\pgf@temp{}%
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1label/unit}}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \ctikzvalof{bipole/#1label/name}%
+ \else%
+ $\SI{\ctikzvalof{bipole/#1label/name}}{\ctikzvalof{bipole/#1label/unit}}$%
+ \fi%
+}
+
+\def\pgf@circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf@circ@temp}
+ \edef\pgf@temp{}
+ }
+ \ifx\pgf@circ@temp\pgf@temp
+}
+
+
+%%%---------- close: pgfcircutils
+%%%%%%%%%%% Springe nach pgfcircmath
+%%%---------- open: pgfcircmath.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Math routines
+
+\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
+
+% angle between 0 and 360
+\def\pgf@circ@slope#1#2{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{#2}%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \ifdim\pgf@x<0.1pt
+ \ifdim\pgf@x>-0.1pt % vertical
+ \ifdim\pgf@y<0pt
+ \def\pgfmathresult{-90.0}
+ \else
+ \def\pgfmathresult{+90.0}
+ \fi
+ \else % oblique with dx < 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0pt
+ \pgfmathsubtract{\pgfmathresult}{+180}
+ \fi
+ \fi
+ \else % oblique with dx > 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0pt
+ \pgfmathsubtract{\pgfmathresult}{+180}
+ \fi
+ \fi
+ \pgf@x=\pgfmathresult pt
+ \ifdim\pgf@x<0pt
+ \pgfmathadd{\pgfmathresult}{+360}
+ \fi
+ }
+
+
+%%%---------- close: pgfcircmath
+
+%%%%%%%%%%% Springe nach pgfcircshapes
+%%%---------- open: pgfcircshapes.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Other shapes
+
+
+%% Nothing
+
+\pgfdeclareshape{emptyshape}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \northeast
+ \pgf@y=-\pgf@y
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \northeast
+ \pgf@y=0cm
+ \pgf@x=-\pgf@x
+ }
+ \anchor{text}{%
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+}
+
+%% Full terminal
+
+\pgfdeclareshape{circ}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}}
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Empty terminal
+
+\pgfdeclareshape{ocirc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}}
+ }
+
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Current arrow
+
+\pgfdeclareshape{currarrow}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+
+ \endpgfscope
+ }
+
+}
+
+%% Current arrow
+
+\pgfdeclareshape{inputarrow}{
+ \savedanchor{\tip}{
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \tip
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{fill}
+
+ \endpgfscope
+ }
+
+}
+
+%%%---------- close: pgfcircshapes
+%%%%%%%%%%% Springe nach pgfcircmonopoles
+%%%---------- open: pgfcircmonopoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Monopoles
+
+%% Ground symbol
+
+\pgfdeclareshape{ground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+
+
+\pgfdeclareshape{rground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{tground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ %\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{sground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+% noiseless ground
+\pgfdeclareshape{nground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{1.3\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpatharc{0}{180}{1.3\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% protective ground
+\pgfdeclareshape{pground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathcircle{\pgfpoint{0pt}{-\pgf@circ@res@step}} {1.2\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% chassis ground
+\pgfdeclareshape{cground}{
+\anchor{center}{
+ \pgfpointorigin
+}
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/chassis/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Contributed by Leonardo Azzinnari
+\pgfdeclareshape{tlinestub}{
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+
+
+\pgfdeclareshape{antenna}{
+\anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+
+ % \pgfpathmoveto{\pgfpointorigin}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ % \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgftransformxshift{ -4\pgf@circ@res@step }
+
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{txantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{rxantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Vcc
+\pgfdeclareshape{vcc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgf@x=0pt
+ \pgf@y=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgf@y=2\pgf@y
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+% match
+\pgfdeclareshape{match}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+ \pgf@x=1.5\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \pgf@y=-1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
+ \pgfusepath{fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+% oscillator
+\pgfdeclareshape{oscillator}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{north}{
+ \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ \pgf@x=-0.5\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{south}{
+ \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ \pgf@x=-0.5\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{east}{
+ \pgfpointorigin
+ \pgf@x=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ }
+ \anchor{west}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgf@x=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ \pgf@x=-2\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \pgf@y=-\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/oscillator/width}\pgf@circ@Rlen
+ \pgf@circ@res@step=.5\pgf@circ@res@step
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{-\pgf@circ@res@step}{0}} {\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+%%%---------- close: pgfcircmonopoles
+%%%%%%%%%%% Springe nach pgfcircbipoles
+%%%---------- open: pgfcircbipoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%% Generic macro for defining a bipole shape
+% #1 - additional anchors
+% #2 - lower y-size of the bipole (from the center).
+% #3 - #shape is the name of the shape
+% #4 - upper y-size of the bipole (from the center)
+% #5 - width of the bipole
+% #6 - macros drawing the bipole
+
+
+\long\def\pgfcircdeclarebipole#1#2#3#4#5#6{
+ \pgfdeclareshape{#3shape}{
+
+ \savedanchor{\northeast}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\northeastborder}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwestborder}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwest}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\centerpoint}{
+ \pgf@circ@res@down=-#2\pgf@circ@Rlen
+ \pgf@circ@res@up=#4\pgf@circ@Rlen
+ \pgfpointorigin
+ \pgf@y=\pgf@circ@res@up
+ \advance\pgf@y by\pgf@circ@res@down
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{n}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=0cm
+ }
+ \anchor{ne}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ }
+ \anchor{nw}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=-\pgf@x
+ }
+ \anchor{e}{%
+ \ifpgf@circuit@bipole@reversed\else\southwest\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{s}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=0cm
+ }
+ \anchor{se}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=-\pgf@x
+ }
+ \anchor{sw}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ }
+ \anchor{w}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{north}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{right}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{above}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=0cm
+ }
+ \anchor{left}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{below}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=0cm
+ }
+ \anchor{a}{%
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{b} {
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \savedanchor{\textanchor}{%
+ \pgf@y=\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \anchor{text}{%
+ \textanchor
+ }
+ \anchorborder{%
+ \def\pgf@temp{false}
+ \ifpgf@circuit@bipole@reversed\pgf@temp
+ \pgf@circ@res@left=-\pgf@x
+ \pgf@circ@res@right=-\pgf@y
+ \else
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@right=\pgf@y
+ \fi
+ \ifdim\pgf@circ@res@right>0cm
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
+ \else
+ \southwestborder
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
+ \fi
+ }
+
+ #1
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@zero = 0cm
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@res@right = \pgf@x
+ \southwest
+ \pgf@circ@res@down = \pgf@y
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ #6
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Standard bipole shapes declarations
+
+%% Resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/resistor/height}}{resistor}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 12
+
+ \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
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+
+%% Variable resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vresistor/height}}{vresistor}{\ctikzvalof{bipoles/vresistor/height}}{\ctikzvalof{bipoles/vresistor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vresistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 12
+ \def\myfrac{.5}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \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
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\myfrac\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/capacitor/height}}{capacitor}{\ctikzvalof{bipoles/capacitor/height}}{\ctikzvalof{bipoles/capacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+%% Polar Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pcapacitor/height}}{polarcapacitor}{\ctikzvalof{bipoles/pcapacitor/height}}{\ctikzvalof{bipoles/pcapacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/pcapacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+}
+
+%% Battery
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 6
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+%% Battery 1
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+
+
+
+ \pgfusepath{draw}
+}
+
+
+
+%% cute inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/cuteinductor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/cuteinductor/coils}
+
+ \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/cuteinductor/height}\pgf@circ@Rlen
+ \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude
+ \pgfdecorationsegmentlength = \pgf@circ@res@step
+ \pgfdecorationsegmentaspect=.6
+
+ \pgfdecoration{{coil}{\pgfdecoratedremainingdistance}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \endpgfdecoration
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{stroke}
+}
+
+
+
+%% american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+
+ \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/americaninductor/height}\pgf@circ@Rlen
+ \pgfdecorationsegmentamplitude=.45\pgfdecorationsegmentamplitude
+ \pgfdecorationsegmentlength = 1.99\pgf@circ@res@step
+
+ \pgfdecoration{{bumps}{\pgfdecoratedremainingdistance}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \endpgfdecoration
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{stroke}
+}
+
+
+
+
+
+%% Independent voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+%% Independent voltage source - American style
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+
+
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+
+ \pgfusepath{draw}
+}
+
+
+
+%% Independent sinusoidal voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesin/height}}{vsourcesin}{\ctikzvalof{bipoles/vsourcesin/height}}{\ctikzvalof{bipoles/vsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+% contributed by Alistair Kwan
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesquare/height}}{vsourcesquare}{\ctikzvalof{bipoles/vsourcesquare/height}}{\ctikzvalof{bipoles/vsourcesquare/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Independent current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Independent current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isourceam/height}}{isourceAM}{\ctikzvalof{bipoles/isourceam/height}}{\ctikzvalof{bipoles/isourceam/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+
+
+
+%% Independent sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isourcesin}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+%% Controlled voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled voltage source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourceam/height}}{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
+ \pgfusepath{draw}
+}
+
+
+%% Controlled sinusoidal voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Controlled sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Controlled current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{draw}}
+ \endpgfscope
+}
+
+%% Black generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Black tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+}
+
+%% Black photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black varcap
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+%% Empty generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.2\pgf@circ@res@left}{.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty varcap
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+%% Closing SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}}
+ \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@right}{-.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.14\pgf@circ@res@right}{-.35\pgf@circ@res@up}}
+ \pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+}
+
+%% Opening SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@right}{.1\pgf@circ@res@down}}
+ \pgfpatharc{15}{50}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.85\pgf@circ@res@left}{1.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.87\pgf@circ@res@left}{1.26\pgf@circ@res@up}}
+ \pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+
+}
+
+
+%% Push Button
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pushbutton/height 2}}{pushbutton}{\ctikzvalof{bipoles/pushbutton/height}}{\ctikzvalof{bipoles/pushbutton/width}}{
+
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Ammeter
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ammeter/height}}{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{
+ \def\pgf@circ@temp{right}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \def\pgf@circ@temp{below}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \pgf@circ@res@step=1.2\pgf@circ@res@up
+ \fi
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetarrowsend{}
+
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfnode{circle}{center}{\textbf{A}}{}{}
+}
+
+%% Voltmeter
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/voltmeter/height}}{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{
+ \def\pgf@circ@temp{right}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \def\pgf@circ@temp{below}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \pgf@circ@res@step=1.2\pgf@circ@res@up
+ \fi
+ \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetarrowsend{}
+
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfnode{circle}{center}{\textbf{V}}{}{}
+
+}
+
+%% Short circuit
+
+\pgfcircdeclarebipole{}{0}{short}{0}{0}{ }
+
+%% Open circuit
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/open/height}}{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{
+
+}
+
+%% Generic bipole - used as resistor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/generic/height}}{generic}{\ctikzvalof{bipoles/generic/height}}{\ctikzvalof{bipoles/generic/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+%% fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+
+%% Generic bipole, filled - used as inductor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fullgeneric/height}}{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw,fill}
+}
+
+
+%% Generic asymmetric bipole
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ageneric/height}}{ageneric}{\ctikzvalof{bipoles/ageneric/height}}{\ctikzvalof{bipoles/ageneric/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+%% asymmetric fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/afuse/height}}{afuse}{\ctikzvalof{bipoles/afuse/height}}{\ctikzvalof{bipoles/afuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Memristor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/memristor/height}}{memristor}{\ctikzvalof{bipoles/memristor/height}}{\ctikzvalof{bipoles/memristor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Generic empty tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Photoresistor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/photoresistor/height 2}}{photoresistor}{\ctikzvalof{bipoles/photoresistor/height}}{\ctikzvalof{bipoles/photoresistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Thermistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistor/height}}{thermistor}{\ctikzvalof{bipoles/thermistor/height}}{\ctikzvalof{bipoles/thermistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+
+%% Thermistor PTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorptc/height 2}}{thermistorptc}{\ctikzvalof{bipoles/thermistorptc/height}}{\ctikzvalof{bipoles/thermistorptc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Thermistor NTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% thermocouple
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermocouple/height 2}}{thermocouple}{\ctikzvalof{bipoles/thermocouple/height}}{\ctikzvalof{bipoles/thermocouple/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+}
+
+%% Varistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varistor/height}}{varistor}{\ctikzvalof{bipoles/varistor/height}}{\ctikzvalof{bipoles/varistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}}
+}
+
+
+
+%% Generic full tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tfullgeneric/height}}{tfullgeneric}{\ctikzvalof{bipoles/tfullgeneric/height}}{\ctikzvalof{bipoles/tfullgeneric/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Variable Cute Inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcuteinductor/height}}{vcuteinductor}{\ctikzvalof{bipoles/vcuteinductor/height}}{\ctikzvalof{bipoles/vcuteinductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/vcuteinductor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vcuteinductor/coils}
+
+ \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/vcuteinductor/coil height}\pgf@circ@Rlen
+ \pgfdecorationsegmentamplitude=.5\pgfdecorationsegmentamplitude
+ \pgfdecorationsegmentlength = \pgf@circ@res@step
+ \pgfdecorationsegmentaspect=.6
+
+ \pgfdecoration{{coil}{\pgfdecoratedremainingdistance}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \endpgfdecoration
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% variable american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
+
+ \pgfdecorationsegmentamplitude=\ctikzvalof{bipoles/vamericaninductor/height}\pgf@circ@Rlen
+ \pgfdecorationsegmentamplitude=.45\pgfdecorationsegmentamplitude
+ \pgfdecorationsegmentamplitude=.45\pgfdecorationsegmentamplitude % per freccia
+ \pgfdecorationsegmentlength = 1.99\pgf@circ@res@step
+
+ \pgfdecoration{{bumps}{\pgfdecoratedremainingdistance}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \endpgfdecoration
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Variable Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcapacitor/height}}{vcapacitor}{\ctikzvalof{bipoles/vcapacitor/height}}{\ctikzvalof{bipoles/vcapacitor/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Handling of terminals
+
+
+%% Easily usable styles
+
+\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=full}}
+
+\tikzset{reversed/.style = {\circuitikzbasekey/bipole/reversed=true}}
+
+
+%% The output routine
+
+\def\drawpoles{
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[ocirc] {} }
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[circ] {} }
+ \fi
+ \fi
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[ocirc] {} }
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[circ] {} }
+ \fi
+ \fi
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%% Lamp
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height}
+ }{tline}{\ctikzvalof{bipoles/tline/height}
+ }{\ctikzvalof{bipoles/tline/width}
+ }
+ {
+ \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0}}
+ {\pgfpoint{\pgf@circ@res@step}{0}}
+ {\pgfpoint{0}{-\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% SQUID added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+% Generic barrier added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+}
+
+
+% Contributed by Danilo Piazzalunga
+
+\pgfdeclareshape{buffer}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+
+
+\pgfdeclareshape{plain amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+%% Generic two port box
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/twoport/height}}{twoport}{\ctikzvalof{bipoles/twoport/height}}{\ctikzvalof{bipoles/twoport/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+}
+
+%% voltage controled oscillator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vco/width}}{vco}{\ctikzvalof{bipoles/twoport/width}}{\ctikzvalof{bipoles/vco/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+}
+
+%% bandpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandpass/width}}{bandpass}{\ctikzvalof{bipoles/bandpass/width}}{\ctikzvalof{bipoles/bandpass/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% highpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/highpass/width}}{highpass}{\ctikzvalof{bipoles/highpass/width}}{\ctikzvalof{bipoles/highpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.65\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{-0.35\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% lowpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lowpass/width}}{lowpass}{\ctikzvalof{bipoles/lowpass/width}}{\ctikzvalof{bipoles/lowpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{0.35\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.65\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{-0.15\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf@circ@res@step}{0.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+%% ADC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/adc/width}}{adc}{\ctikzvalof{bipoles/adc/width}}{\ctikzvalof{bipoles/adc/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{A}
+ \def\textii{D}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{A}
+ \def\textii{D}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DAC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dac/width}}{dac}{\ctikzvalof{bipoles/dac/width}}{\ctikzvalof{bipoles/dac/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{D}
+ \def\textii{A}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{D}
+ \def\textii{A}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DSP
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dsp/width}}{dsp}{\ctikzvalof{bipoles/dsp/width}}{\ctikzvalof{bipoles/dsp/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{DSP}}
+}
+
+%% FFT
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fft/width}}{fft}{\ctikzvalof{bipoles/fft/width}}{\ctikzvalof{bipoles/fft/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{FFT}}
+}
+
+%% Amplifier
+\pgfcircdeclarebipole{}{
+ %\ifpgf@circuit@box
+ \ctikzvalof{bipoles/twoport/width}
+ %\else
+ % \ctikzvalof{bipoles/amp/width}
+ %\fi
+ }{amp}{
+ %\ifpgf@circuit@box
+ \ctikzvalof{bipoles/twoport/width}
+ %\else
+ % \ctikzvalof{bipoles/amp/width}
+ % \fi
+ }{
+ % \ifpgf@circuit@box
+ \ctikzvalof{bipoles/twoport/width}
+ % \else
+ % \ctikzvalof{bipoles/amp/width}
+ % \fi
+ }{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/amp/width}\pgf@circ@Rlen
+
+
+ % draw outer box
+ %\ifpgf@circuit@box
+ % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ %\fi
+ % draw outer box
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgfusepath{draw}
+}
+
+
+%% variable amplifier
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamp/width}}{vamp}{\ctikzvalof{bipoles/vamp/width}}{\ctikzvalof{bipoles/vamp/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vamp/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.63\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0.75\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.7\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% pi attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piattenuator/width}}{piattenuator}{\ctikzvalof{bipoles/piattenuator/width}}{\ctikzvalof{bipoles/piattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% variable pi attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vpiattenuator/width}}{vpiattenuator}{\ctikzvalof{bipoles/vpiattenuator/width}}{\ctikzvalof{bipoles/vpiattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% T attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tattenuator/width}}{tattenuator}{\ctikzvalof{bipoles/tattenuator/width}}{\ctikzvalof{bipoles/tattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% variable T attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vtattenuator/width}}{vtattenuator}{\ctikzvalof{bipoles/vtattenuator/width}}{\ctikzvalof{bipoles/vtattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{phaseshifter}{\ctikzvalof{bipoles/phaseshifter/width}}{\ctikzvalof{bipoles/phaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+}
+
+%% variable phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{vphaseshifter}{\ctikzvalof{bipoles/vphaseshifter/width}}{\ctikzvalof{bipoles/vphaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% detector
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/detector/width}}{detector}{\ctikzvalof{bipoles/detector/width}}{\ctikzvalof{bipoles/detector/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % draw inner stuff
+ \pgfsetlinewidth{0.8\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{0.75\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@fulldiode
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
+ \fi
+
+}
+
+
+
+
+%% european gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{european gas filled surge arrester}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{\ctikzvalof{bipoles/european gas filled surge arrester/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+
+
+
+%% american gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{american gas filled surge arrester}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
+ %\def\pgf@circ@temp{right}
+ %\ifx\tikz@res@label@pos\pgf@circ@temp
+ % \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ %\else
+% \def\pgf@circ@temp{below}
+% \ifx\tikz@res@label@pos\pgf@circ@temp
+% \pgf@circ@res@step=-1.2\pgf@circ@res@up
+% \else
+% \pgf@circ@res@step=1.2\pgf@circ@res@up
+% \fi
+% \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfnode{circle}{center}{}{}{}
+
+ \pgfscope
+ \pgfsetarrowsend{latex}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+
+ %\pgftransformshift{\pgfpoint{.25\pgf@circ@res@left}{.45\pgf@circ@res@down}}
+ %\pgfnode{circ}{center}{}{}{}
+ %\pgftransformshift{}
+ \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
+ \pgfusepath{fill}
+}
+
+
+
+
+
+
+%%%---------- close: pgfcircbipoles
+%%%%%%%%%%% Springe nach pgfcirctripoles
+%%%---------- open: pgfcirctripoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Tripoles
+
+
+\pgfdeclareshape{mixer}
+{
+ \savedanchor\northwest{
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{adder}
+{
+ \savedanchor\northwest{
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+
+ \pgfdeclareshape{spdt}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out 1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{out 2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left
+
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+ \pgfpathlineto{
+ \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
+ {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
+ }
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Logic ports
+%%
+
+
+
+
+
+
+\long\def\pgfcircdeclarelogicport#1#2{
+ \pgfdeclareshape{american #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \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
+
+ #2
+
+ }
+ }
+}
+
+
+\pgfcircdeclarelogicport{and}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+ \pgfpathcurveto
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{nand}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{nor}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+
+
+\pgfcircdeclarelogicport{or}{
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{xor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{xnor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfdeclareshape{american not port}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% #1 - name
+% #2 - text inside
+% #3 - number of inputs
+% #4 - is it a not
+
+\long\def\pgfcircdeclareeurologicport#1#2#3#4{
+ \pgfdeclareshape{european #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \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
+ \def\pgf@temp{1}
+ \def\pgf@circ@temp{#3}
+ \ifx\pgftemp\pgf@circ@temp % one input
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}
+ \else % two inputs
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \fi%
+ %
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
+ %
+ \edef\pgf@temp{not}
+ \edef\pgf@circ@temp{#4}
+ \ifx\pgf@temp\pgf@circ@temp % is a not
+ \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf@circ@res@up}}
+ \fi
+ %
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgftext{#2}
+ %
+ %
+ %
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+%
+%
+ }
+ }
+}
+
+
+
+\pgfcircdeclareeurologicport{and}{$\&$}{2}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{2}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{2}{}
+\pgfcircdeclareeurologicport{not}{$1$}{1}{not}
+\pgfcircdeclareeurologicport{nand}{$\&$}{2}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{2}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{2}{not}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\long\def\pgfcircdeclaretransistor#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northeast{% upper right
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x=0pt
+ }
+% \savedanchor\northeast{%
+% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+% \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y
+% \pgf@y=.5\pgf@y
+% \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+% \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x
+% }
+ \savedanchor\left{%center left
+ \pgf@y=0pt
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x
+ }
+ \anchor{text}{
+ \northeast
+ \pgfpoint
+ {12\pgf@circ@res@right +0.2*(\pgf@circ@res@right-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left)}
+ {0.6\pgf@y}
+ }
+ %
+ % pseudo-bipole
+ \anchor{left}{ % south
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{right}{
+ \northeast
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{south east}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+
+ #2
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ %
+ %
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \left
+ \pgf@circ@res@left = \pgf@x
+ %
+ #3
+ %
+ }
+ }
+}
+
+
+
+
+
+
+\long\def\pgfcircdeclaremos#1#2#3{
+ \pgfcircdeclaretransistor{#1}{
+ \anchor{G}{
+ \left
+ }
+ \anchor{gate}{
+ \left
+ }
+ \anchor{B}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x
+ }
+ \anchor{base}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x
+ }
+ #2
+ }
+ {#3}
+}
+
+
+
+
+
+
+
+
+
+\pgfcircdeclaremos{nmos}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclaremos{pmos}{
+ \anchor{S}{
+ \northeast
+ }
+ \anchor{source}{
+ \northeast
+ }
+ \anchor{D}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{drain}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathcircle{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgfusepath{draw,fill}
+
+}
+
+
+
+
+
+
+
+\pgfcircdeclaretransistor{pnp}{
+ \anchor{E}{
+ \northeast
+ }
+ \anchor{emitter}{
+ \northeast
+ }
+ \anchor{B}{
+ \left
+ }
+ \anchor{base}{
+ \left
+ }
+ \anchor{C}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{collector}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pnp/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+
+
+\pgfcircdeclaretransistor{npn}{
+ \anchor{C}{
+ \northeast
+ }
+ \anchor{collector}{
+ \northeast
+ }
+ \anchor{B}{
+ \left
+ }
+ \anchor{base}{
+ \left
+ }
+ \anchor{E}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{emitter}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+
+}
+
+
+
+\pgfcircdeclaretransistor{pigbt}{
+ \anchor{E}{
+ \northeast
+ }
+ \anchor{emitter}{
+ \northeast
+ }
+ \anchor{B}{
+ \left
+ }
+ \anchor{base}{
+ \left
+ }
+ \anchor{C}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{collector}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+
+}
+
+
+
+\pgfcircdeclaretransistor{nigbt}{
+ \anchor{C}{
+ \northeast
+ }
+ \anchor{collector}{
+ \northeast
+ }
+ \anchor{B}{
+ \left
+ }
+ \anchor{base}{
+ \left
+ }
+ \anchor{E}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{emitter}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigbt/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+
+}
+
+
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Contrib
+
+
+%%
+% IGFET (e.g. MOSFET)
+\long\def\pgfcircdeclarefet#1#2#3{
+ \pgfcircdeclaretransistor{#1}{
+ \anchor{B}{
+ \left
+ \pgf@x=\pgf@circ@res@right
+ }
+ \anchor{base}{
+ \left
+ \pgf@x=\pgf@circ@res@right
+ }
+ #2
+ }
+ {#3}
+}
+
+
+
+\pgfcircdeclarefet{nfet}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{G}{
+ \left
+ }
+ \anchor{gate}{
+ \left
+ }
+
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarefet{pfet}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{G}{
+ \left
+ }
+ \anchor{gate}{
+ \left
+ }
+
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgftransformrotate{180}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pfet/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfcircdeclarefet{nigfete}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
+
+ % GATE, ENHANCEMENT TYPE (DASHED)
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base height}\pgf@circ@res@down}}
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % GATE
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ % GATE CONNECTION
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+% N-CHANNEL IGFET DEPLETION TYPE
+\pgfcircdeclarefet{nigfetd}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ }
+
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@up}}
+
+ % GATE, DEPLETION TYPE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base height}\pgf@circ@res@down}}
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % GATE
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ % GATE CONNECTION
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}}
+ %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetd/gate height}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfcircdeclarefet{pigfete}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ % GATE, DASHED, BOLD
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % GATE
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ % Arrow has to be rotated, as this is a p-channel fet
+ \pgftransformrotate{180}
+ \pgftransformlineattime{-.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ % GATE CONNECTION (in line with source)
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}}
+ %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+% P-CHANNEL IGFET DEPLETION TYPE
+\pgfcircdeclarefet{pigfetd}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+
+
+ % GATE DEPLETION TYPE
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % BULK
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % GATE
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ % PFET!
+ \pgftransformrotate{180}
+ \pgftransformlineattime{-.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ % GATE CONNECTION
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}}
+ %\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfetd/gate height}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Contrib Danilo Piazzalunga
+
+
+
+
+
+
+\pgfcircdeclaretransistor{njfet}{
+ \anchor{G}{
+ \left
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/height}\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@y
+ \pgf@y=-.5\pgf@y
+ }
+ \anchor{gate}{
+ \left
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/height}\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@y
+ \pgf@y=-.5\pgf@y
+ }
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclaretransistor{pjfet}{
+ \anchor{G}{
+ \left
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/height}\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@y
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{gate}{
+ \left
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/height}\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@y
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{S}{
+ \northeast
+ }
+ \anchor{source}{
+ \northeast
+ }
+ \anchor{D}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{drain}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+
+
+
+
+% ISFET
+\pgfcircdeclarefet{isfet}{
+ \anchor{D}{
+ \northeast
+ }
+ \anchor{drain}{
+ \northeast
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ % GATE, DEPLETION TYPE
+ \pgfscope %% added
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth} %% added
+ \pgfusepath{draw} %% added
+ \endpgfscope %% added
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % GATE
+ %\pgfscope
+ %\pgfpathmoveto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ %\pgfpathlineto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ %\pgfusepath{draw}
+ %\endpgfscope
+
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfusepath{draw}
+
+ % Wavy lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%% Black thyristor
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{anode}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{cathode}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/thyristor/height 2}}{thyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+
+%% Empty triac
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{anode}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{cathode}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/triac/height}}{triac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+
+
+
+
+
+
+\pgfcircdeclarebipole{
+ \anchor{out 1}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{out 2}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=.8\pgf@y
+ }
+}{\ctikzvalof{tripoles/toggleswitch/height 2}}{toggleswitch}{\ctikzvalof{tripoles/toggleswitch/height}}{\ctikzvalof{tripoles/toggleswitch/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetdash{}{0cm}
+}
+
+
+
+
+
+
+
+
+
+
+\pgfdeclareshape{op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+
+
+
+%% Potentiometer
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+ \anchor{W}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/potentiometer/height 2}}{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}{\ctikzvalof{bipoles/potentiometer/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/potentiometer/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 12
+
+ \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
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+
+%% Generic tunable
+
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/generic potentiometer/height 2}}{genericpotentiometer}{\ctikzvalof{bipoles/generic potentiometer/height}}{\ctikzvalof{bipoles/generic potentiometer/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+\pgfdeclareshape{circulator}
+{
+ \savedanchor\northwest{
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % inner arrow
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
+ \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+% Wilkinson divider
+\pgfdeclareshape{wilkinson}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{out2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ % draw inner resisitor - european or american style is recognised
+ {
+ \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgftransformrotate{90}
+
+ % calculate size of resistor
+ \ifpgf@circuit@europeanresistor
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}}
+ \fi
+ }
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+
+%%%---------- close: pgfcirctripoles
+%%%%%%%%%%% Springe nach pgfcircquadpoles
+%%%---------- open: pgfcircquadpoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Quadripoles
+
+\long\def\pgfcircdeclarequadpole#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
+ }
+ \anchor{A2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{A1}{
+ \northwest
+ }
+ \anchor{B2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{base}{
+ \northwest
+ \pgf@x=0pt
+ }
+ #3
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ %\pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+
+ #2
+
+ }
+ }
+}
+
+
+
+\def\pgf@circ@drawtransformerbasicanchor{
+ \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
+ \anchor{AA2}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{AA1}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+}
+
+\def\pgf@circ@drawtransformerbasicbody{
+ \def\stretto{.4}
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@down}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+
+ \endpgfscope
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@up}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+ % contrib Kristofer M. Monisit
+
+ \pgfdeclareshape{fd op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out +}{
+ \northwest
+ \pgf@y=.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out -}{
+ \northwest
+ \pgf@y=-.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$}
+
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$}
+
+
+ % Negative output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$}
+
+
+ % Positive output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$}
+
+
+ % Draw them all!
+ \pgfusepath{draw}
+
+ % Triangle
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+
+\pgfcircdeclarequadpole{transformer}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \def\stretto{.4}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
+ \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
+ \pgfusepath{draw}
+
+}{}
+
+%% coupler
+% defines a general outer box for couplers
+% TikZ usage:
+% \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
+% (coup.port1) to[short,-o] ++(-1,0)
+%
+
+\long\def\pgfcircdeclarecoupler#1#2{
+ \pgfdeclareshape{#1}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{port1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{port4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ #2
+
+ }
+ }
+}
+
+% straight coupler
+\pgfcircdeclarecoupler{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarecoupler{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+
+}
+
+%%%---------- close: pgfcircquadpoles
+%%%%%%%%%%% Springe nach pgfcircnpoles
+%%%---------- open: pgfcircnpoles.tex
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% N-poles
+
+\pgfkeys{/tikz/circuitikz,lab/.code={
+
+
+}}
+
+\long\def\pgfcircdeclarenpole#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
+ }
+ \anchor{A2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{A1}{
+ \northwest
+ }
+ \anchor{B2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{base}{
+ \northwest
+ \pgf@x=0pt
+ }
+ #3
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ %\pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+
+ #2
+
+ }
+ }
+}
+
+
+
+\def\pgf@circ@drawtransformerbasicanchor{
+ \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
+ \anchor{AA2}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{AA1}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+}
+
+\def\pgf@circ@drawtransformerbasicbody{
+ \def\stretto{.4}
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@down}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+
+ \endpgfscope
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@up}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+ % contrib Kristofer M. Monisit
+
+ \pgfdeclareshape{fd op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out +}{
+ \northwest
+ \pgf@y=.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out -}{
+ \northwest
+ \pgf@y=-.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\scriptsize\ $-$}
+
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\scriptsize\ $+$}
+
+
+ % Negative output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\scriptsize\ $-$}
+
+
+ % Positive output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\scriptsize\ $+$}
+
+
+ % Draw them all!
+ \pgfusepath{draw}
+
+ % Triangle
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+
+\pgfcircdeclarequadpole{transformer}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \def\stretto{.4}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
+ \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
+ \pgfusepath{draw}
+
+}{}
+
+%% coupler
+% defines a general outer box for couplers
+% TikZ usage:
+% \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
+% (coup.port1) to[short,-o] ++(-1,0)
+%
+
+\long\def\pgfcircdeclarecoupler#1#2{
+ \pgfdeclareshape{#1}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/coupler/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{port1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{port4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ #2
+
+ }
+ }
+}
+
+% straight coupler
+\pgfcircdeclarecoupler{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarecoupler{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+
+}
+
+%%%---------- close: pgfcircnpoles
+
+%%%%%%%%%%% Springe nach pgfcirclabel
+%%%---------- open: pgfcirclabel.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Bipole label positioning
+
+%% Options
+\ctikzset{label/.style = { l=#1 } }
+\ctikzset{l/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{label above/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l^/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{label below/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+\ctikzset{l_/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+
+
+\def\pgf@circ@drawlabel{
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{label/align}}
+ \def\pgf@circ@temp{straight}
+ }
+ \ifx\pgf@temp\pgf@circ@temp %straight
+ \pgf@circ@drawreglabel
+ \else
+ \pgfextra{\def\pgf@circ@temp{rotate}}
+ \ifx\pgf@temp\pgf@circ@temp %rotate
+ \pgf@circ@drawrotlabel
+ \else % smart
+ \pgf@circ@drawsmartlabel
+ \fi
+ \fi
+}
+
+\def\pgf@circ@drawsmartlabel{
+ \pgfextra{
+ %\pgfmathadd{\pgf@circ@direction}{360}
+ \pgfmathmod{\pgf@circ@direction}{90}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \ifnum \pgfcircmathresult > 20
+ \ifnum \pgfcircmathresult < 70 % NON quasi retto
+ \pgf@circ@drawrotlabel
+ \else
+ \pgf@circ@drawreglabel
+ \fi
+ \else
+ \pgf@circ@drawreglabel
+ \fi
+}
+
+%% Output routing
+%% #1 - node name
+
+\def\pgf@circ@drawrotlabel{
+ \pgfextra{
+ % calcolo rotazione label
+ \def\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label
+ \edef\pgfcirclabrot{\pgf@circ@direction} % primo e quarto quadrante
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 90 \ifnum \pgfcircmathresult < 270 % terzo e secondo
+ \pgfmathsubtract{\pgf@circ@direction}{180}
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \pgfmathadd{\pgf@circ@temp}{180} %%%
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} %%%
+ \fi\fi
+
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@temp}{180}
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ }
+ coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.north)$)
+ (labelcoor) node [rotate=\pgfcirclabrot] {\pgf@circ@finallabel{}} % c'era un transform shape
+}
+
+\def\pgf@circ@drawreglabel{
+ \pgfextra{
+ \pgfmathsubtract{\pgf@circ@direction}{90}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label
+ \ifnum \pgf@circ@temp < 0
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ }
+ node [ anchor = \pgf@circ@labanc]
+ at (\ctikzvalof{bipole/name}.\pgf@circ@temp) {\pgf@circ@finallabel{}}
+}
+
+
+\ctikzset{text/.style = { t=#1 } }
+\ctikzset{t/.code = {
+ \ctikzsetvalof{bipoles/twoport/text}{#1}
+}}
+
+%%%---------- close: pgfcirclabel
+%%%%%%%%%%% Springe nach pgfcircvoltage
+%%%---------- open: pgfcircvoltage.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Voltage management
+
+
+\ctikzset{v^>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v^</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v_>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+
+% Default position varies whether the component is a voltage source
+% or not
+\ctikzset{v/.code = {
+ \ifpgf@circuit@bipole@isvoltage
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \fi
+ \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
+ \ctikzsetvalof{bipole/voltage/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }
+}
+
+\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
+\ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
+\ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
+\ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
+
+
+%% Output routine for generic bipoles
+
+\def\pgf@circ@drawvoltagegeneric{
+ \pgfextra{
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@voltage@below\pgf@circuit@bipole@voltage@belowfalse\else\pgf@circuit@bipole@voltage@belowtrue\fi
+ \fi
+
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@voltage@angle{90}
+ \else
+ \def\pgf@circ@voltage@angle{-90}
+ \fi
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
+ { \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
+ { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
+ }
+
+ coordinate (pgfcirc@mid) at ($(\tikztostart) ! \distacefromnode ! (\ctikzvalof{bipole/name}.left)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@mid) ! -\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen ! \pgf@circ@voltage@angle:(\ctikzvalof{bipole/name}.left)$)
+
+ coordinate (pgfcirc@mid) at ($(\tikztotarget) ! \distacefromnode ! (\ctikzvalof{bipole/name}.right)$)
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@mid) ! \ctikzvalof{voltage/distance from line}\pgf@circ@Rlen ! \pgf@circ@voltage@angle : (\ctikzvalof{bipole/name}.right)$)
+
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
+ \else
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vto)
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$}
+ \fi
+ \fi
+}
+
+%% Output routine for voltage sources
+
+\def\pgf@circ@drawvoltagegenerator{
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-120)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-60)$)
+ \else
+ coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.120)$)
+ coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.60)$)
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vcont2) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont1)
+ \else
+ (pgfcirc@Vcont1) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont2)
+ \fi
+
+ \else % american voltage
+
+ \pgfextra{
+ \def\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}}
+ \def\pgf@circ@temp{battery}
+ \ifx\pgf@temp\pgf@circ@temp
+ \edef\pgf@circ@batteria{battery}
+ \else
+ \def\pgf@circ@temp{battery1}
+ \ifx\pgf@temp\pgf@circ@temp
+ \edef\pgf@circ@batteria{battery}
+ \else
+ \edef\pgf@circ@batteria{false}
+ \fi
+ \fi
+ \edef\pgf@circ@temp{battery}
+ }
+
+ \ifx\pgf@circ@batteria\pgf@circ@temp % if it is a battery, must put + and -
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vcont2) node {$-$} (pgfcirc@Vcont1) node {$+$}
+ \else
+ (pgfcirc@Vcont1) node {$-$} (pgfcirc@Vcont2) node {$+$}
+ \fi
+ \fi
+
+ \fi
+}
+
+%% Output routine
+
+\def\pgf@circ@drawvoltage{ % node name
+ \pgfextra{
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@voltage@label@where{90}
+ \fi
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
+ { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
+ }
+
+ \ifpgf@circuit@bipole@isvoltage
+ \pgf@circ@drawvoltagegenerator
+ \else
+ \pgf@circ@drawvoltagegeneric
+ \fi
+ (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)
+ coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
+ \ifpgf@circuit@europeanvoltage\eudist\else\ctikzvalof{voltage/american label distance}\fi !
+ (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$)
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=0]
+ at (Vlab) { \pgf@circ@finallabel{voltage/} }
+}
+
+
+
+
+
+% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.-110) $)
+% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.-70) $)
+% \else
+% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.110) $)
+% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.70) $)
+% \fi
+%%%---------- close: pgfcircvoltage
+%%%%%%%%%%% Springe nach pgfcirccurrent
+%%%---------- open: pgfcirccurrent.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Current handling
+
+%% Options
+
+
+\ctikzset{i^>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i>^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i>_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i^</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i<^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i<_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i/.code = {
+% \ifpgf@circuit@bipole@iscurrent
+% \pgfkeys{\circuitikzbasekey/bipole/current/position=above}
+% \else
+% \pgfkeys{\circuitikzbasekey/bipole/current/position=below}
+% \fi
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
+ \ctikzsetvalof{bipole/current/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}
+}
+
+\ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
+\ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
+\ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
+\ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
+
+
+\def\pgf@circ@drawnormalcurrent{
+ \ifpgf@circuit@bipole@current@before
+ \ifpgf@circuit@bipole@current@backward
+ { (\ctikzvalof{bipole/name}.left) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztostart)
+ }
+ \else
+ { (\tikztostart) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\ctikzvalof{bipole/name}.left)
+ }
+ \fi
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ { (\tikztotarget) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\ctikzvalof{bipole/name}.right)
+ }
+ \else
+ { (\ctikzvalof{bipole/name}.right) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztotarget)
+ }
+ \fi
+ \fi
+}
+
+%% Output routine
+%% #1 - node name
+
+\def\pgf@circ@drawcurrent{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@bipole@current@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@current@label@where{+90}
+ \fi
+ }
+
+
+ \pgfextra{ \def\pgf@temp{short} \edef\pgf@circ@temp{\ctikzvalof{bipole/kind}} }
+
+ \ifx\pgf@circ@temp\pgf@temp % caso di corrente (centrata) su un corto
+ \ifpgf@circuit@bipole@current@backward
+ { (\tikztotarget) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztostart) }
+ \else
+ { (\tikztostart) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztotarget) }
+ \fi
+
+ \else % altri bipoli - e quindi tra nodo e target
+
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@europeancurrent
+ \pgf@circ@drawnormalcurrent
+ \else
+ \fi
+ \else
+ \pgf@circ@drawnormalcurrent
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@iscurrent
+ node [anchor=\pgf@circ@dir] at (\ctikzvalof{bipole/name}.\pgf@circ@bipole@current@label@where)
+ { \pgf@circ@finallabel{current/} }
+ \else
+ (Iarrow.\pgf@circ@bipole@current@label@where) node [anchor=\pgf@circ@dir]
+ { \pgf@circ@finallabel{current/} }
+ \fi
+
+}
+
+
+
+
+%%%---------- close: pgfcirccurrent
+%%%%%%%%%%% Springe nach pgfcircinputarrows
+%%%---------- open: pgfcircinputarrows.tex
+% Copyright 2013 by Stefan Erhardt
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Show input arrows for selected parts
+
+
+\ctikzset{>/.style = {
+ \circuitikzbasekey/inputarrow = true
+ }
+}
+
+
+
+
+
+%%%---------- close: pgfcircinputarrows
+
+
+
+
+%%%---------- close: circuitikz.code
+
+\ExecuteOptions{europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility}
+
+\ProcessOptions\relax
+
+\ifpgf@circ@siunitx
+ \RequirePackage{xstring}[2009/03/13]
+ %\expandafter\let\csname angstrom\endcsname\relax
+ \RequirePackage{siunitx}
+\fi
+
+%%%%%%%%%%% Springe nach circuitikz1.code
+%%%---------- open: circuitikz1.code.tex
+%%%%%%%%%%%%
+%% Dimensions
+
+% coordinate bipoli
+\newdimen\pgf@circ@res@up \newdimen\pgf@circ@res@down \newdimen\pgf@circ@res@zero
+\newdimen\pgf@circ@res@left \newdimen\pgf@circ@res@right
+\newdimen\pgf@circ@res@other
+\newdimen\pgf@circ@res@step
+
+% thickness iniziale
+\newdimen \pgfstartlinewidth
+
+\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+
+
+
+% Names
+\ctikzset{name/.style = { n=#1 } }
+\ctikzset{n/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/name=#1}
+}}
+
+% Reflect the node along
+\ctikzset{mirrored/.is choice}
+\ctikzset{mirror value/.initial=1}
+\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
+\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
+\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
+
+% Initialize paths
+\def\pgfcircresetpath{
+ \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90,
+ bipole/reversed=false, bipole/kind=,
+ bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
+ bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,
+ bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
+ bipole/current/y position=above, bipole/current/direction=forward,
+ mirrored=false
+ }
+}
+
+
+%% Generic bipole path
+\def\pgf@circ@bipole@path#1#2{
+ \pgfextra{
+ \ctikzset{bipole/kind = #1}
+
+ \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+ \def\pgf@circ@temp{}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = #2\pgf@circ@rand} % create it
+ \fi
+
+ \def\pgf@temp{open}
+ \def\pgf@circ@temp{#1}
+ }
+ \ifpgf@circuit@bipole@reversed
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabel\fi
+ \drawpoles
+ \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
+ \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
+ % reset
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+%% Path definitions
+
+\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
+\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
+\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
+\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
+\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
+\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
+\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
+\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
+\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
+\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
+\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
+\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}}
+\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
+\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
+\def\pgf@circ@inductor@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductor@path{#1}%
+ \else%
+ \pgf@circ@americaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@vinductor@path#1{
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@veuropeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@vcuteinductor@path{#1}%
+ \else%
+ \pgf@circ@vamericaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
+\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
+\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
+\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
+\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
+\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
+\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
+\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
+\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
+\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
+\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
+\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
+\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
+\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
+\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
+\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
+\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
+\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
+\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
+\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
+\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
+\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
+\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
+\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
+\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
+\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
+\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
+\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
+\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
+\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
+\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
+\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
+\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
+\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
+\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
+\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
+\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
+\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
+\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
+\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
+\def\pgf@circ@empty@path#1{}
+\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
+\def\pgf@circ@thyristor@path#1{\pgf@circ@bipole@path{thyristor}{#1}}
+\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
+\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
+\def\pgf@circ@triac@path#1{\pgf@circ@bipole@path{triac}{#1}}
+\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
+\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
+\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
+\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
+\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
+\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
+
+\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
+\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
+\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
+\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
+\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
+\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
+\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
+\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
+\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
+\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
+\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
+\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
+\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
+\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
+\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
+\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
+\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
+\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
+
+
+%% Styles
+
+%% Aggiungere per thyristor e tripoli semplici
+
+%\def\ctikzsetbipole#1#2{%
+% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
+%}
+%\ctikzsetbipole{resistor}{\pgf@circ@resistor@path}
+
+\tikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
+\tikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
+\tikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
+\tikzset{ammeter/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path, l=#1}}
+\tikzset{voltmeter/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path, l=#1}}
+\tikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
+\tikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
+\tikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
+\tikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
+\tikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
+\tikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\tikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
+\tikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
+\tikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
+\tikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
+\tikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
+\tikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
+\tikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
+\tikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
+\tikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
+\tikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
+\tikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
+\tikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
+\tikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
+\tikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
+\tikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
+\tikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
+\tikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
+\tikzset{transmission line/.style = {tline = #1}}
+\tikzset{TL/.style = {tline = #1}}
+\tikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\tikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\tikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\tikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\tikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }}
+\tikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, v=#1 }}
+\tikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\tikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\tikzset{voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\tikzset{controlled voltage source/.style = {\ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\tikzset{controlled current source/.style = {\ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+
+\tikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
+\tikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
+\tikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
+\tikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
+\tikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
+\tikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
+\tikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
+
+\tikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
+
+\tikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
+\tikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
+\tikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
+\tikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
+\tikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
+
+\tikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
+\tikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
+\tikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
+\tikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
+\tikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
+\tikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
+\tikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
+\tikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
+\tikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
+\tikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
+\tikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
+\tikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
+\tikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
+\tikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
+\tikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
+\tikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
+\tikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
+\tikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
+
+
+
+\tikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
+\tikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
+\tikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
+\tikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
+\tikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
+\tikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
+\tikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
+
+\tikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
+\tikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\tikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\tikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\tikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\tikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
+\tikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+
+ \tikzset{Schottky diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Schottky diode}}
+ \tikzset{Zener diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi Zener diode}}
+ \tikzset{tunnel diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi tunnel diode}}
+ \tikzset{photodiode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi photodiode}}
+ \tikzset{led/.style = {\ifpgf@circuit@fulldiode full \else empty \fi led}}
+ \tikzset{varcap/.style = {\ifpgf@circuit@fulldiode full \else empty \fi varcap}}
+ \tikzset{diode/.style = {\ifpgf@circuit@fulldiode full \else empty \fi diode}}
+
+\tikzset{thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thyristor@path}}
+\tikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
+\tikzset{triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@triac@path}}
+
+\tikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\tikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
+\tikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\tikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
+
+\tikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
+\tikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
+
+% short forms
+\tikzset{vsource/.style = {voltage source = #1}}
+\tikzset{isource/.style = {current source = #1}}
+\tikzset{cisource/.style = {controlled current source = #1}}
+\tikzset{cvsource/.style = {controlled voltage source = #1}}
+\tikzset{vsourcesin/.style = {sinusoidal voltage source = #1}}
+\tikzset{vsourcesquare/.style = {square voltage source = #1}}
+\tikzset{isourcesin/.style = {sinusoidal current source = #1}}
+\tikzset{cisourcesin/.style = {controlled sinusoidal current source = #1}}
+\tikzset{cvsourcesin/.style = {controlled sinusoidal voltage source = #1}}
+
+\tikzset{controlled vsource/.style = {controlled voltage source = #1}}
+\tikzset{controlled isource/.style = {controlled current source = #1}}
+\tikzset{controlled vsourcesin/.style = {controlled sinusoidal voltage source = #1}}
+\tikzset{controlled isourcesin/.style = {controlled sinusoidal current source = #1}}
+
+\tikzset{R/.style= {resistor = #1}}
+\tikzset{vR/.style= {variable resistor = #1}}
+\tikzset{phR/.style= {photoresistor = #1}}
+\tikzset{thR/.style= {thermistor = #1}}
+\tikzset{thRp/.style= {thermistor ptc= #1}}
+\tikzset{thRn/.style= {thermistor ntc= #1}}
+\tikzset{pR/.style= {potentiometer = #1}}
+\tikzset{C/.style = {capacitor = #1}}
+\tikzset{pC/.style = {polar capacitor = #1}}
+\tikzset{vC/.style = {variable capacitor = #1}}
+\tikzset{L/.style = {inductor = #1}}
+\tikzset{vL/.style = {variable inductor = #1}}
+\tikzset{V/.style = {voltage source = #1}}
+\tikzset{cV/.style = {controlled voltage source = #1}}
+\tikzset{sV/.style = {sinusoidal voltage source = #1}}
+\tikzset{sqV/.style = {square voltage source = #1}}
+\tikzset{csV/.style = {controlled sinusoidal voltage source = #1}}
+\def\pgf@temp#1{
+ \tikzset{V#1/.style = {voltage source, v#1=##1} }
+ \tikzset{cV#1/.style = {controlled voltage source, v#1=##1} }
+ \tikzset{sV#1/.style = {sinusoidal voltage source, v#1=##1} }
+ \tikzset{csV#1/.style = {controlled sinusoidal voltage source, v#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+\tikzset{I/.style = {current source = #1}}
+\tikzset{cI/.style = {controlled current source = #1}}
+\tikzset{sI/.style = {sinusoidal current source = #1}}
+\tikzset{csI/.style = {controlled sinusoidal current source = #1}}
+\def\pgf@temp#1{
+ \tikzset{I#1/.style = {current source, i#1=##1} }
+ \tikzset{cI#1/.style = {controlled current source, i#1=##1} }
+ \tikzset{sI#1/.style = {sinusoidal current source, i#1=##1} }
+ \tikzset{csI#1/.style = {controlled sinusoidal current source, i#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+\tikzset{Do/.style = {empty diode}}
+\tikzset{tDo/.style = {empty tunnel diode}}
+\tikzset{zDo/.style = {empty Zener diode}}
+\tikzset{sDo/.style = {empty Schottky diode}}
+\tikzset{pDo/.style = {empty photodiode}}
+\tikzset{leDo/.style = {empty led}}
+\tikzset{VCo/.style = {empty varcap}}
+\tikzset{D*/.style = {full diode}}
+\tikzset{tD*/.style = {full tunnel diode}}
+\tikzset{zD*/.style = {full Zener diode}}
+\tikzset{sD*/.style = {full Schottky diode}}
+\tikzset{pD*/.style = {full photodiode}}
+\tikzset{leD*/.style = {full led}}
+\tikzset{VC*/.style = {full varcap}}
+\tikzset{D/.style = {diode}}
+\tikzset{tD/.style = {tunnel diode}}
+\tikzset{zD/.style = {Zener diode}}
+\tikzset{sD/.style = {Schottky diode}}
+\tikzset{pD/.style = {photodiode}}
+\tikzset{leD/.style = {led}}
+\tikzset{VC/.style = {varcap}}
+
+\tikzset{Tr/.style = {triac}}
+\tikzset{Mr/.style = {memristor}}
+\tikzset{Ty/.style = {thyristor}}
+
+\tikzset{cspst/.style = {closing switch = #1}}
+\tikzset{ospst/.style = {opening switch = #1}}
+
+\tikzset{afuse/.style = {asymmetric fuse=#1}}
+
+
+\def\inheritlogicport#1#2{
+ \pgfdeclareshape{#2 port}{
+ \inheritsavedanchors[from=#1 #2 port]
+ \inheritbackgroundpath[from=#1 #2 port]
+ \inheritanchor[from=#1 #2 port]{in}
+ \inheritanchor[from=#1 #2 port]{in 1}
+ \inheritanchor[from=#1 #2 port]{in 2}
+ \inheritanchor[from=#1 #2 port]{out}
+ \inheritanchor[from=#1 #2 port]{center}
+ \inheritanchor[from=#1 #2 port]{left}
+ }
+}
+
+\ifpgf@circuit@europeanlogicport
+ \inheritlogicport{european}{and}
+ \inheritlogicport{european}{or}
+ \inheritlogicport{european}{xor}
+ \inheritlogicport{european}{not}
+ \inheritlogicport{european}{nand}
+ \inheritlogicport{european}{nor}
+ \inheritlogicport{european}{xnor}
+\else
+ \inheritlogicport{american}{and}
+ \inheritlogicport{american}{or}
+ \inheritlogicport{american}{xor}
+ \inheritlogicport{american}{not}
+ \inheritlogicport{american}{nand}
+ \inheritlogicport{american}{nor}
+ \inheritlogicport{american}{xnor}
+\fi
+
+% Transistor like bipoles
+
+\def\pgf@circ@trans@path#1#2{
+ \pgfextra{
+ \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+ \def\pgf@circ@temp{#2}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
+ \fi
+ }
+ \ifpgf@circuit@bipole@reversed
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathadd{\pgfmathresult}{-90}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
+ (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+\def\pgf@circ@definetranspath#1{
+ \tikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
+}
+
+\pgf@circ@definetranspath{nmos}
+\pgf@circ@definetranspath{pmos}
+\pgf@circ@definetranspath{npn}
+\pgf@circ@definetranspath{pnp}
+\pgf@circ@definetranspath{nfet}
+\pgf@circ@definetranspath{nigfete}
+\pgf@circ@definetranspath{nigfetd}
+\pgf@circ@definetranspath{pfet}
+\pgf@circ@definetranspath{pigfete}
+\pgf@circ@definetranspath{pigfetd}
+\pgf@circ@definetranspath{njfet}
+\pgf@circ@definetranspath{pjfet}
+\pgf@circ@definetranspath{pigbt}
+\pgf@circ@definetranspath{nigbt}
+%%%---------- close: circuitikz1.code
+
+\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
+
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.6.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.6.sty
new file mode 100644
index 00000000000..475980e1a2b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.6.sty
@@ -0,0 +1,10290 @@
+% Copyright 2007-2016 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+
+%%%%%
+%%%%%
+%%%%%
+%%%%% Se c'è l'opzione symbol, fallback to siunitx with warning
+%%%%%
+%%%%%
+
+\NeedsTeXFormat{LaTeX2e}
+
+\def\pgfcircversion{0.6}
+\def\pgfcircversiondate{2016/06/06}
+
+\ProvidesPackage{circuitikz-0.6}
+ [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
+
+%% Version 2.0 of pgf/TikZ is required
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\usepgflibrary{arrows}
+
+
+% The options are listed in the manual in this order
+
+\DeclareOption{europeanvoltage}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{americanvoltage}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrent}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrent}{
+ \ctikzset{current = american}
+}
+
+\DeclareOption{europeanvoltage}{
+ \ctikzset{voltage = european}
+}
+
+\DeclareOption{americanresistor}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistor}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductor}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductor}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductor}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanport}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{european}{
+ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
+ \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester = european}
+}
+
+\DeclareOption{american}{
+ \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester = american}
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{fulldiodes}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiodes}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{europeanvoltages}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{americanvoltages}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrents}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrents}{
+ \ctikzset{current = american}
+}
+
+\DeclareOption{europeanvoltages}{
+ \ctikzset{voltage = european}
+}
+
+\DeclareOption{americanresistors}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistors}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductors}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductors}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductors}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanports}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanports}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{americangfsurgearrester}{
+ \ctikzset{gas filled surge arrester = american}
+}
+
+\DeclareOption{europeangfsurgearrester}{
+ \ctikzset{gas filled surge arrester = european}
+}
+
+\DeclareOption{siunitx}{
+ \pgf@circ@siunitxtrue
+}
+
+\DeclareOption{nosiunitx}{
+ \pgf@circ@siunitxfalse
+}
+
+\DeclareOption{fulldiode}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiode}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{strokediode}{
+ \ctikzset{diode = stroke}
+}
+
+\DeclareOption{arrowmos}{
+ \pgf@circuit@mos@arrowstrue
+}
+
+\DeclareOption{noarrowmos}{
+ \pgf@circuit@mos@arrowsfalse
+}
+
+\DeclareOption{fetbodydiode}{
+ \pgf@circuit@fet@bodydiodetrue
+}
+
+\DeclareOption{nofetbodydiode}{
+ \pgf@circuit@fet@bodydiodefalse
+}
+
+\DeclareOption{fetsolderdot}{
+ \pgf@circuit@fet@solderdottrue
+}
+
+\DeclareOption{nofetsolderdot}{
+ \pgf@circuit@fet@solderdotfalse
+}
+
+\DeclareOption{emptypmoscircle}{
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+
+\DeclareOption{lazymos}{
+ \ctikzset{tripoles/nmos/width=.5}
+ \ctikzset{tripoles/nmos/gate height=.35}
+ \ctikzset{tripoles/nmos/base height=.35}
+ \ctikzset{tripoles/nmos/height/.initial=1.2}
+ \ctikzset{tripoles/nmos/base width=.5}
+ \ctikzset{tripoles/nmos/gate width=.65}
+
+ \ctikzset{tripoles/pmos/width=.5}
+ \ctikzset{tripoles/pmos/gate height=.35}
+ \ctikzset{tripoles/pmos/base height=.35}
+ \ctikzset{tripoles/pmos/height/.initial=1.2}
+ \ctikzset{tripoles/pmos/base width=.5}
+ \ctikzset{tripoles/pmos/gate width=.65}
+
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+\DeclareOption{straightlabels}{
+ \ctikzset{label/align = straight}
+}
+
+\DeclareOption{rotatelabels}{
+ \ctikzset{label/align = rotate}
+}
+
+\DeclareOption{smartlabels}{
+ \ctikzset{label/align = smart}
+}
+
+\DeclareOption{compatibility}{
+ \pgf@circuit@compattrue
+}
+
+\DeclareOption{oldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectiontrue
+}
+\DeclareOption{nooldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectionfalse
+}
+
+\DeclareOption{betterproportions}{
+ \ctikzset{monopoles/ground/width/.initial=.15}
+
+ \ctikzset{bipoles/resistor/height/.initial=.23}
+ \ctikzset{bipoles/resistor/width/.initial=.6}
+ \ctikzset{bipoles/capacitor/height/.initial=.4}
+ \ctikzset{bipoles/capacitor/width/.initial=.1}
+ \ctikzset{bipoles/potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
+ \ctikzset{bipoles/photoresistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistor/main/.initial=.7}
+ \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
+ \ctikzset{bipoles/thermistorptc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorptc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/main/.initial=.7}
+ \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/width/.initial=.6}
+ \ctikzset{bipoles/vresistor/height/.initial=.45}
+ \ctikzset{bipoles/vresistor/width/.initial=.6}
+ \ctikzset{bipoles/generic/height/.initial=.23}
+ \ctikzset{bipoles/generic/width/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/ageneric/height/.initial=.23}
+ \ctikzset{bipoles/ageneric/width/.initial=.6}
+ \ctikzset{bipoles/memristor/height/.initial=.23}
+ \ctikzset{bipoles/memristor/wave height/.initial=.375}
+ \ctikzset{bipoles/memristor/width/.initial=.60}
+ \ctikzset{bipoles/tgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tgeneric/width/.initial=.6}
+ \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
+ \ctikzset{bipoles/fullgeneric/height/.initial=.23}
+ \ctikzset{bipoles/fullgeneric/width/.initial=.6}
+ \ctikzset{bipoles/diode/height/.initial=.3}
+ \ctikzset{bipoles/diode/width/.initial=.25}
+
+ \ctikzset{tripoles/thyristor/height/.initial=.66}
+ \ctikzset{tripoles/thyristor/height 2/.initial=.3}
+ \ctikzset{tripoles/thyristor/width/.initial=.6}
+ \ctikzset{tripoles/thyristor/diode height/.initial=.3}
+ \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+ \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+ \ctikzset{tripoles/triac/height/.initial=.66}
+ \ctikzset{tripoles/triac/width/.initial=.6}
+ \ctikzset{tripoles/triac/diode width left/.initial=.3}
+ \ctikzset{tripoles/triac/diode width right/.initial=.3}
+}
+
+%%%%%%%%%
+%%%%%%%%%%% Springe nach tex/pgfcirc.defines
+%%%---------- open: tex/pgfcirc.defines.tex
+
+%% Options
+
+%%%%%%%%%%%%
+%% Dimensions
+
+% coordinates
+\newdimen\pgf@circ@res@up
+\newdimen\pgf@circ@res@down
+\newdimen\pgf@circ@res@zero
+\newdimen\pgf@circ@res@left
+\newdimen\pgf@circ@res@right
+\newdimen\pgf@circ@res@other
+\newdimen\pgf@circ@res@step
+\newdimen\pgf@circ@res@temp
+% inital thickness
+\newdimen \pgfstartlinewidth
+%% Keys
+
+\long\def\pgf@circ@comment#1{}
+
+\def\circuitikzbasekey{/tikz/circuitikz}
+
+\pgfkeys{\circuitikzbasekey/.is family}
+
+\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
+\let\ctikzset\circuitikzset
+\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
+\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circuit@compat
+\newif\ifpgf@circ@oldvoltagedirection
+
+% Option ">" for twoports
+\newif\ifpgf@circuit@inputarrow
+\ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/.is choice}
+\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
+
+% Option "boxed" for nodes and twoports
+\newif\ifpgf@circuit@boxed
+\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
+
+% Option "dashed" for nodes and twoports
+\newif\ifpgf@circuit@dashed
+\pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
+\ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
+
+% Option "t=*" for nodes
+\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
+
+
+
+\ctikzset{bipoles/.is family}
+\ctikzset{bipoles/border margin/.initial=1.1}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{bipoles/length/.initial=1.4cm}
+\ctikzset{nodes width/.initial=.04}
+\newdimen\pgf@circ@Rlen
+\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}}
+
+\ctikzset{monopoles/.is family}
+\ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/tground/thickness/.initial=3}
+\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/match/width/.initial=.4}
+\ctikzset{monopoles/chassis/width/.initial=.25}
+\ctikzset{monopoles/alternative chassis/width/.initial=.25}
+\ctikzset{monopoles/equipotentiality/width/.initial=.25}
+\ctikzset{monopoles/tlinestub/width/.initial=.25}
+\ctikzset{monopoles/antenna/width/.initial=.25}
+\ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/width/.initial=.25}
+\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/rxantenna/width/.initial=.25}
+
+\ctikzset{bipoles/resistor/height/.initial=.3}
+\ctikzset{bipoles/resistor/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/height/.initial=.8}
+\ctikzset{bipoles/potentiometer/height 2/.initial=.3}
+\ctikzset{bipoles/potentiometer/width/.initial=.8}
+\ctikzset{bipoles/photoresistor/height/.initial=.6}
+\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
+\ctikzset{bipoles/photoresistor/width/.initial=.8}
+\ctikzset{bipoles/thermistor/main/.initial=.7}
+\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/width/.initial=.8}
+\ctikzset{bipoles/thermistorntc/main/.initial=.7}
+\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistorptc/width/.initial=.8}
+\ctikzset{bipoles/thermistorptc/main/.initial=.7}
+\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistor/width/.initial=.8}
+\ctikzset{bipoles/varistor/main/.initial=.7}
+\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/varistor/width/.initial=.8}
+\ctikzset{bipoles/vresistor/height/.initial=.6}
+\ctikzset{bipoles/vresistor/width/.initial=.8}
+\ctikzset{bipoles/cuteinductor/height/.initial=.3}
+\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
+\ctikzset{bipoles/cuteinductor/width/.initial=.6}
+\ctikzset{bipoles/cuteinductor/coils/.initial=5}
+\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/americaninductor/height/.initial=.3}
+\ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+\ctikzset{bipoles/americaninductor/width/.initial=.8}
+\ctikzset{bipoles/americaninductor/coils/.initial=4}
+\ctikzset{bipoles/americaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
+\ctikzset{bipoles/vcuteinductor/width/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/coils/.initial=5}
+\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/vamericaninductor/height/.initial=.6}
+\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+\ctikzset{bipoles/vamericaninductor/width/.initial=.8}
+\ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/esource/height/.initial=.60}
+\ctikzset{bipoles/esource/width/.initial=.60}
+\ctikzset{bipoles/pvsource/height/.initial=.60}
+\ctikzset{bipoles/pvsource/width/.initial=.60}
+\ctikzset{bipoles/isource/height/.initial=.60}
+\ctikzset{bipoles/isource/width/.initial=.60}
+\ctikzset{bipoles/oosource/height/.initial=.60}
+\ctikzset{bipoles/oosource/width/.initial=.60}
+\ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/dcisource/height/.initial=.60}
+\ctikzset{bipoles/dcisource/width/.initial=.60}
+\ctikzset{bipoles/dcvsource/height/.initial=.60}
+\ctikzset{bipoles/dcvsource/width/.initial=.60}
+\ctikzset{bipoles/vsourcetri/height/.initial=.60}
+\ctikzset{bipoles/vsourcetri/width/.initial=.60}
+\ctikzset{bipoles/isourceam/height/.initial=.60}
+\ctikzset{bipoles/isourceam/width/.initial=.60}
+\ctikzset{bipoles/vsource/height/.initial=.60}
+\ctikzset{bipoles/vsource/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/height/.initial=.60}
+\ctikzset{bipoles/vsourceam/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/margin/.initial=.7}
+\ctikzset{bipoles/isourcesin/height/.initial=.60}
+\ctikzset{bipoles/isourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesin/height/.initial=.60}
+\ctikzset{bipoles/vsourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/height/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/width/.initial=.60}
+\ctikzset{bipoles/cisource/height/.initial=.7}
+\ctikzset{bipoles/cisource/width/.initial=.7}
+\ctikzset{bipoles/cisourceam/height/.initial=.7}
+\ctikzset{bipoles/cisourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsource/height/.initial=.7}
+\ctikzset{bipoles/cvsource/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/height/.initial=.7}
+\ctikzset{bipoles/cvsourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/margin/.initial=.7}
+\ctikzset{bipoles/cvsourceam/text scale/.initial=1}
+\ctikzset{bipoles/cisourcesin/width/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/height/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/width/.initial=.7}
+\ctikzset{bipoles/capacitor/height/.initial=.6}
+\ctikzset{bipoles/capacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/height/.initial=.5}
+\ctikzset{bipoles/ecapacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath}
+\ctikzset{bipoles/pcapacitor/height/.initial=.6}
+\ctikzset{bipoles/pcapacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/vcapacitor/height/.initial=.6}
+\ctikzset{bipoles/vcapacitor/width/.initial=.5}
+\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/piezoelectric/height/.initial=.7}
+\ctikzset{bipoles/piezoelectric/width/.initial=.5}
+\ctikzset{bipoles/battery/height/.initial=.6}
+\ctikzset{bipoles/battery/width/.initial=.3}
+\ctikzset{bipoles/battery1/height/.initial=.6}
+\ctikzset{bipoles/battery1/width/.initial=.3}
+\ctikzset{bipoles/diode/height/.initial=.50}
+\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/varcap/height/.initial=.50}
+\ctikzset{bipoles/varcap/width/.initial=.45}
+\ctikzset{bipoles/interr/height/.initial=.35}
+\ctikzset{bipoles/interr/width/.initial=.35}
+\ctikzset{bipoles/interr/height 2/.initial=.1}
+\ctikzset{bipoles/generic/height/.initial=.30}
+\ctikzset{bipoles/generic/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
+\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
+\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
+\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
+\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
+\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
+\ctikzset{bipoles/fuse/height/.initial=.20}
+\ctikzset{bipoles/fuse/width/.initial=.50}
+\ctikzset{bipoles/afuse/height/.initial=.20}
+\ctikzset{bipoles/afuse/width/.initial=.50}
+\ctikzset{bipoles/generic potentiometer/height/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
+\ctikzset{bipoles/generic potentiometer/width/.initial=.80}
+\ctikzset{bipoles/ageneric/height/.initial=.30}
+\ctikzset{bipoles/ageneric/width/.initial=.80}
+\ctikzset{bipoles/memristor/height/.initial=.30}
+\ctikzset{bipoles/memristor/wave height/.initial=.5}
+\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/tgeneric/height/.initial=.70}
+\ctikzset{bipoles/tgeneric/width/.initial=.80}
+\ctikzset{bipoles/tfullgeneric/height/.initial=.70}
+\ctikzset{bipoles/tfullgeneric/width/.initial=.80}
+\ctikzset{bipoles/fullgeneric/height/.initial=.30}
+\ctikzset{bipoles/fullgeneric/width/.initial=.80}
+\ctikzset{bipoles/open/height/.initial=.25}
+\ctikzset{bipoles/open/width/.initial=.8}
+\ctikzset{bipoles/ammeter/height/.initial=.60}
+\ctikzset{bipoles/ammeter/width/.initial=.60}
+\ctikzset{bipoles/ohmmeter/height/.initial=.60}
+\ctikzset{bipoles/ohmmeter/width/.initial=.60}
+\ctikzset{bipoles/voltmeter/height/.initial=.60}
+\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/buffer/height/.initial=1}
+\ctikzset{bipoles/buffer/width/.initial=1}
+\ctikzset{bipoles/not port/width/.initial=1}
+\ctikzset{bipoles/not port/height/.initial=.8}
+\ctikzset{bipoles/not port/circle width/.initial=.15}
+\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/tline/height/.initial=.3}
+\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/squid/height/.initial=.60}
+\ctikzset{bipoles/squid/width/.initial=.60}
+\ctikzset{bipoles/barrier/height/.initial=.60}
+\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/thermocouple/height/.initial=.250}
+\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
+\ctikzset{bipoles/thermocouple/width/.initial=.140}
+\ctikzset{bipoles/pushbutton/height/.initial=.5}
+\ctikzset{bipoles/pushbutton/height 2/.initial=.0}
+\ctikzset{bipoles/pushbutton/width/.initial=.50}
+
+\ctikzset{bipoles/twoport/width/.initial=.7}
+\ctikzset{bipoles/twoport/height/.initial=.7}
+\ctikzset{bipoles/twoport/text/.initial=}
+\ctikzset{bipoles/vco/width/.initial=.7}
+\ctikzset{bipoles/bandpass/width/.initial=.7}
+\ctikzset{bipoles/highpass/width/.initial=.7}
+\ctikzset{bipoles/lowpass/width/.initial=.7}
+\ctikzset{bipoles/adc/width/.initial=.7}
+\ctikzset{bipoles/dac/width/.initial=.7}
+\ctikzset{bipoles/dsp/width/.initial=.7}
+\ctikzset{bipoles/fft/width/.initial=.7}
+\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/vamp/width/.initial=.7}
+\ctikzset{bipoles/piattenuator/width/.initial=.7}
+\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
+\ctikzset{bipoles/tattenuator/width/.initial=.7}
+\ctikzset{bipoles/vtattenuator/width/.initial=.7}
+\ctikzset{bipoles/phaseshifter/width/.initial=.7}
+\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
+\ctikzset{bipoles/detector/width/.initial=.7}
+
+
+\newif\ifpgf@circuit@trans@depletiontype
+\pgf@circuit@trans@depletiontypefalse
+
+\newif\ifpgf@circuit@mos@arrows
+\ctikzset{tripoles/mos style/.is choice}
+\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
+\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
+
+% Option solderdot for fet
+\newif\ifpgf@circuit@fet@solderdot
+\pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+\ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+
+% Option bodydiode for fet
+\newif\ifpgf@circuit@fet@bodydiode
+\pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+\ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+
+% Option draw fet without gate connection
+\newif\ifpgf@circuit@bpt@drawgate
+\pgf@circuit@bpt@drawgatetrue
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+
+% Option draw bpt without base connection
+\newif\ifpgf@circuit@bpt@drawbase
+\pgf@circuit@bpt@drawbasetrue
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+
+% Option draw bpt with optical input
+\newif\ifpgf@circuit@bpt@drawphoto
+\pgf@circuit@bpt@drawphotofalse
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+
+% Option draw pmos with empty circle
+\newif\ifpgf@circuit@pmos@emptycircle
+\newif\ifpgf@circuit@pmos@emptycircle
+\pgf@circuit@pmos@emptycirclefalse
+\pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+\ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+
+
+\newif\ifpgf@circuit@trans@ntype
+\pgf@circuit@trans@ntypetrue %default true
+%\newif\ifpgf@circuit@trans@ptype
+%\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
+\ctikzset{tripoles/nmos/width/.initial=.7}
+\ctikzset{tripoles/nmos/gate height/.initial=.35}
+\ctikzset{tripoles/nmos/base height/.initial=.5}
+\ctikzset{tripoles/nmos/conn height/.initial=0}
+\ctikzset{tripoles/nmos/height/.initial=1.1}
+\ctikzset{tripoles/nmos/base width/.initial=.5}
+\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nmos/curr direction/.initial=1}
+
+\ctikzset{tripoles/pmos/width/.initial=.7}
+\ctikzset{tripoles/pmos/gate height/.initial=.35}
+\ctikzset{tripoles/pmos/base height/.initial=.5}
+\ctikzset{tripoles/pmos/conn height/.initial=0}
+\ctikzset{tripoles/pmos/height/.initial=1.1}
+\ctikzset{tripoles/pmos/base width/.initial=.5}
+\ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pmos/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nfet/width/.initial=.7}
+\ctikzset{tripoles/nfet/gate height/.initial=.35}
+\ctikzset{tripoles/nfet/base height/.initial=.5}
+\ctikzset{tripoles/nfet/conn height/.initial=0}
+\ctikzset{tripoles/nfet/height/.initial=1.1}
+\ctikzset{tripoles/nfet/base width/.initial=.5}
+\ctikzset{tripoles/nfet/gate width/.initial=.62}
+\ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pfet/width/.initial=.7}
+\ctikzset{tripoles/pfet/gate height/.initial=.35}
+\ctikzset{tripoles/pfet/base height/.initial=.5}
+\ctikzset{tripoles/pfet/conn height/.initial=0}
+\ctikzset{tripoles/pfet/height/.initial=1.1}
+\ctikzset{tripoles/pfet/base width/.initial=.5}
+\ctikzset{tripoles/pfet/gate width/.initial=.62}
+\ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigfete/width/.initial=.7}
+\ctikzset{tripoles/nigfete/gate height/.initial=.35}
+\ctikzset{tripoles/nigfete/base height/.initial=.5}
+\ctikzset{tripoles/nigfete/conn height/.initial=.35}
+\ctikzset{tripoles/nigfete/height/.initial=1.1}
+\ctikzset{tripoles/nigfete/base width/.initial=.5}
+\ctikzset{tripoles/nigfete/gate width/.initial=.62}
+\ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfete/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetd/width/.initial=.7}
+\ctikzset{tripoles/nigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetd/base height/.initial=.5}
+\ctikzset{tripoles/nigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetd/height/.initial=1.1}
+\ctikzset{tripoles/nigfetd/base width/.initial=.5}
+\ctikzset{tripoles/nigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetd/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfete/width/.initial=.7}
+\ctikzset{tripoles/pigfete/gate height/.initial=.35}
+\ctikzset{tripoles/pigfete/base height/.initial=.5}
+\ctikzset{tripoles/pigfete/conn height/.initial=.35}
+\ctikzset{tripoles/pigfete/height/.initial=1.1}
+\ctikzset{tripoles/pigfete/base width/.initial=.5}
+\ctikzset{tripoles/pigfete/gate width/.initial=.62}
+\ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfete/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetd/width/.initial=.7}
+\ctikzset{tripoles/pigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetd/base height/.initial=.5}
+\ctikzset{tripoles/pigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetd/height/.initial=1.1}
+\ctikzset{tripoles/pigfetd/base width/.initial=.5}
+\ctikzset{tripoles/pigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
+
+\ctikzset{tripoles/npn/width/.initial=.6}
+\ctikzset{tripoles/npn/base height/.initial=.45}
+\ctikzset{tripoles/npn/base height 2/.initial=.15}
+\ctikzset{tripoles/npn/base height/.initial=.4}
+\ctikzset{tripoles/npn/conn height/.initial=0}
+\ctikzset{tripoles/npn/height/.initial=1.1}
+\ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/npn/curr direction/.initial=1}
+
+\ctikzset{tripoles/pnp/width/.initial=.6}
+\ctikzset{tripoles/pnp/base height/.initial=.45}
+\ctikzset{tripoles/pnp/base height 2/.initial=.15}
+\ctikzset{tripoles/pnp/base height/.initial=.4}
+\ctikzset{tripoles/pnp/conn height/.initial=0}
+\ctikzset{tripoles/pnp/height/.initial=1.1}
+\ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pnp/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigbt/width/.initial=.6}
+\ctikzset{tripoles/pigbt/gate height/.initial=.45}
+\ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/pigbt/base height/.initial=.4}
+\ctikzset{tripoles/pigbt/conn height/.initial=0}
+\ctikzset{tripoles/pigbt/height/.initial=1.1}
+\ctikzset{tripoles/pigbt/gate width/.initial=.62}
+\ctikzset{tripoles/pigbt/base width/.initial=.5}
+\ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigbt/width/.initial=.6}
+\ctikzset{tripoles/nigbt/gate height/.initial=.45}
+\ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/nigbt/base height/.initial=.4}
+\ctikzset{tripoles/nigbt/conn height/.initial=0}
+\ctikzset{tripoles/nigbt/height/.initial=1.1}
+\ctikzset{tripoles/nigbt/gate width/.initial=.62}
+\ctikzset{tripoles/nigbt/base width/.initial=.5}
+\ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/Lpigbt/width/.initial=.6}
+\ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lpigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lpigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/Lnigbt/width/.initial=.6}
+\ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lnigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lnigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/njfet/width/.initial=.7}
+\ctikzset{tripoles/njfet/gate height/.initial=.5}
+\ctikzset{tripoles/njfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/njfet/gate width/.initial=.5}
+\ctikzset{tripoles/njfet/conn height/.initial=.35}
+\ctikzset{tripoles/njfet/height/.initial=1.1}
+\ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/njfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pjfet/width/.initial=.7}
+\ctikzset{tripoles/pjfet/gate height/.initial=.5}
+\ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/pjfet/gate width/.initial=.5}
+\ctikzset{tripoles/pjfet/conn height/.initial=.35}
+\ctikzset{tripoles/pjfet/height/.initial=1.1}
+\ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pjfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/isfet/width/.initial=1}
+\ctikzset{tripoles/isfet/gate height/.initial=.35}
+\ctikzset{tripoles/isfet/base height/.initial=.5}
+\ctikzset{tripoles/isfet/height/.initial=1.1}
+\ctikzset{tripoles/isfet/base width/.initial=.3}
+\ctikzset{tripoles/isfet/gate width/.initial=.5}
+\ctikzset{tripoles/isfet/conn height/.initial=0}
+\ctikzset{tripoles/isfet/wave width/.initial=.16}
+\ctikzset{tripoles/isfet/wave amp/.initial=.06}
+\ctikzset{tripoles/isfet/waves y sep/.initial=.22}
+\ctikzset{tripoles/isfet/waves x sep/.initial=.8}
+\ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/isfet/curr direction/.initial=1}
+
+\newif\ifpgf@circuit@europeanlogicport
+\ctikzset{logic ports/.is choice}
+\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue } }
+\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse } }
+
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+
+\ctikzset{tripoles/american and port/width/.initial=1.1}
+\ctikzset{tripoles/american and port/height/.initial=.8}
+\ctikzset{tripoles/american and port/port width/.initial=.7}
+\ctikzset{tripoles/american and port/input height/.initial=.5}
+\ctikzset{tripoles/american nand port/width/.initial=1.1}
+\ctikzset{tripoles/american nand port/height/.initial=.8}
+\ctikzset{tripoles/american nand port/port width/.initial=.7}
+\ctikzset{tripoles/american nand port/circle width/.initial=.15}
+\ctikzset{tripoles/american nand port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/width/.initial=1.1}
+\ctikzset{tripoles/american or port/height/.initial=.8}
+\ctikzset{tripoles/american or port/port width/.initial=.7}
+\ctikzset{tripoles/american or port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/input skip/.initial=.25}
+\ctikzset{tripoles/american or port/aaa/.initial=.6}
+\ctikzset{tripoles/american or port/bbb/.initial=.4}
+\ctikzset{tripoles/american or port/ccc/.initial=.5}
+\ctikzset{tripoles/american or port/ddd/.initial=.0}
+\ctikzset{tripoles/american nor port/width/.initial=1.1}
+\ctikzset{tripoles/american nor port/height/.initial=.8}
+\ctikzset{tripoles/american nor port/port width/.initial=.7}
+\ctikzset{tripoles/american nor port/input height/.initial=.5}
+\ctikzset{tripoles/american nor port/input skip/.initial=.25}
+\ctikzset{tripoles/american nor port/circle width/.initial=.15}
+\ctikzset{tripoles/american nor port/aaa/.initial=.6}
+\ctikzset{tripoles/american nor port/bbb/.initial=.4}
+\ctikzset{tripoles/american nor port/ccc/.initial=.5}
+\ctikzset{tripoles/american nor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xor port/width/.initial=1.1}
+\ctikzset{tripoles/american xor port/height/.initial=.8}
+\ctikzset{tripoles/american xor port/port width/.initial=.7}
+\ctikzset{tripoles/american xor port/input height/.initial=.5}
+\ctikzset{tripoles/american xor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xor port/distance/.initial=.1}
+\ctikzset{tripoles/american xor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/width/.initial=1.1}
+\ctikzset{tripoles/american xnor port/height/.initial=.8}
+\ctikzset{tripoles/american xnor port/port width/.initial=.7}
+\ctikzset{tripoles/american xnor port/input height/.initial=.5}
+\ctikzset{tripoles/american xnor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xnor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xnor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xnor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xnor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/european and port/width/.initial=1.4}
+\ctikzset{tripoles/european and port/height/.initial=.65}
+\ctikzset{tripoles/european and port/reserved/.initial=.6}
+\ctikzset{tripoles/european and port/input height/.initial=.6}
+\ctikzset{tripoles/european or port/width/.initial=1.4}
+\ctikzset{tripoles/european or port/height/.initial=.65}
+\ctikzset{tripoles/european or port/reserved/.initial=.6}
+\ctikzset{tripoles/european or port/input height/.initial=.6}
+\ctikzset{tripoles/european xor port/width/.initial=1.4}
+\ctikzset{tripoles/european xor port/height/.initial=.65}
+\ctikzset{tripoles/european xor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xor port/input height/.initial=.6}
+\ctikzset{tripoles/european nand port/width/.initial=1.4}
+\ctikzset{tripoles/european nand port/not height/.initial=.3}
+\ctikzset{tripoles/european nand port/not width/.initial=.8}
+\ctikzset{tripoles/european nand port/height/.initial=.65}
+\ctikzset{tripoles/european nand port/reserved/.initial=.6}
+\ctikzset{tripoles/european nand port/input height/.initial=.6}
+\ctikzset{tripoles/european not port/width/.initial=1.4}
+\ctikzset{tripoles/european not port/not height/.initial=.3}
+\ctikzset{tripoles/european not port/not width/.initial=.8}
+\ctikzset{tripoles/european not port/height/.initial=.65}
+\ctikzset{tripoles/european not port/reserved/.initial=.6}
+\ctikzset{tripoles/european not port/input height/.initial=0}
+\ctikzset{tripoles/european xnor port/width/.initial=1.4}
+\ctikzset{tripoles/european xnor port/not height/.initial=.3}
+\ctikzset{tripoles/european xnor port/not width/.initial=.8}
+\ctikzset{tripoles/european xnor port/height/.initial=.65}
+\ctikzset{tripoles/european xnor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xnor port/input height/.initial=.6}
+\ctikzset{tripoles/european nor port/width/.initial=1.4}
+\ctikzset{tripoles/european nor port/not height/.initial=.3}
+\ctikzset{tripoles/european nor port/not width/.initial=.8}
+\ctikzset{tripoles/european nor port/height/.initial=.65}
+\ctikzset{tripoles/european nor port/reserved/.initial=.6}
+\ctikzset{tripoles/european nor port/input height/.initial=.6}
+\ctikzset{tripoles/op amp/width/.initial=1.7}
+\ctikzset{tripoles/op amp/port width/.initial=.7}
+\ctikzset{tripoles/op amp/height/.initial=1.4}
+\ctikzset{tripoles/op amp/input height/.initial=.5}
+\ctikzset{tripoles/op amp/up pos/.initial=.45}
+\ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolut font size needed!
+\ctikzset{tripoles/gm amp/width/.initial=1.7}
+\ctikzset{tripoles/gm amp/port width/.initial=.7}
+\ctikzset{tripoles/gm amp/height/.initial=1.4}
+\ctikzset{tripoles/gm amp/input height/.initial=.5}
+\ctikzset{tripoles/gm amp/up pos/.initial=.45}
+\ctikzset{tripoles/plain amp/width/.initial=1.7}
+\ctikzset{tripoles/plain amp/port width/.initial=.7}
+\ctikzset{tripoles/plain amp/height/.initial=1.4}
+\ctikzset{tripoles/plain amp/input height/.initial=.5}
+\ctikzset{tripoles/plain amp/up pos/.initial=.45}
+
+\ctikzset{tripoles/thyristor/height/.initial=1.10}
+\ctikzset{tripoles/thyristor/height 2/.initial=.5}
+\ctikzset{tripoles/thyristor/width/.initial=1.0}
+\ctikzset{tripoles/thyristor/diode height/.initial=.5}
+\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+\ctikzset{tripoles/triac/height/.initial=1.1}
+\ctikzset{tripoles/triac/width/.initial=1}
+\ctikzset{tripoles/triac/diode width left/.initial=.3}
+\ctikzset{tripoles/triac/diode width right/.initial=.3}
+
+\ctikzset{tripoles/spdt/width/.initial=.85}
+\ctikzset{tripoles/spdt/height/.initial=.45}
+\ctikzset{tripoles/spdt/margin/.initial=.45}
+
+\ctikzset{tripoles/toggleswitch/height/.initial=.8}
+\ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
+\ctikzset{tripoles/toggleswitch/width/.initial=.80}
+
+\ctikzset{tripoles/mixer/width/.initial=0.7}
+\ctikzset{tripoles/adder/width/.initial=0.7}
+\ctikzset{tripoles/circulator/width/.initial=.7}
+\ctikzset{tripoles/oscillator/width/.initial=.7}
+
+
+\ctikzset{tripoles/wilkinson/height/.initial=1.3}
+\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+
+\ctikzset{quadpoles/transformer/width/.initial=1.5}
+\ctikzset{quadpoles/transformer/width1/.initial=.4}
+\ctikzset{quadpoles/transformer/height/.initial=1.5}
+\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/width/.initial=1.5}
+\ctikzset{quadpoles/transformer core/height/.initial=1.5}
+\ctikzset{quadpoles/transformer core/core height/.initial=.5}
+\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/width/.initial=1.5}
+\ctikzset{quadpoles/gyrator/height/.initial=1.5}
+\ctikzset{quadpoles/fourport/width/.initial=1.3}
+\ctikzset{quadpoles/fourport/height/.initial=1.3}
+\ctikzset{quadpoles/coupler/width/.initial=1.3}
+\ctikzset{quadpoles/coupler/height/.initial=1.3}
+\ctikzset{quadpoles/coupler2/width/.initial=1.3}
+\ctikzset{quadpoles/coupler2/height/.initial=1.3}
+
+% %Mechanical section
+\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
+\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
+\ctikzset{bipoles/spring/height/.initial=.5}
+\ctikzset{bipoles/spring/width/.initial=.5}
+\ctikzset{bipoles/mass/height/.initial=.55}
+\ctikzset{bipoles/mass/box height/.initial=.4}
+\ctikzset{bipoles/mass/width/.initial=.5}
+
+\ctikzset{bipoles/damper/height/.initial=.35}
+\ctikzset{bipoles/damper/length/.initial=.3}
+\ctikzset{bipoles/damper/width/.initial=.4}
+
+
+\ctikzset{bipole/.is family}
+\ctikzset{bipole/kind/.initial = }
+\ctikzset{bipole/name/.initial = }
+\newif\ifpgf@circuit@bipole@reversed
+\ctikzset{bipole/reversed/.is if=pgf@circuit@bipole@reversed}
+\newif\ifpgf@circuit@bipole@isvoltage
+\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
+\newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
+\ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
+\newif\ifpgf@circuit@bipole@strokedsymbol
+\ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
+\newif\ifpgf@circuit@bipole@iscurrent
+\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
+
+\ctikzset{bipole/voltage/.is family}
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+\newif\ifpgf@circuit@bipole@voltage@below
+\ctikzset{bipole/voltage/position/.is choice}
+\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
+\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
+
+\ctikzset{bipole/voltage/label/unit/.initial=}
+\ctikzset{bipole/voltage/label/name/.initial=}
+
+\ctikzset{bipole/current/.is family}
+\newif\ifpgf@circuit@bipole@current@backward
+\ctikzset{bipole/current/direction/.is choice}
+\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
+\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
+\newif\ifpgf@circuit@bipole@current@before
+\ctikzset{bipole/current/x position/.is choice}
+\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
+\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
+\newif\ifpgf@circuit@bipole@current@below
+\ctikzset{bipole/current/y position/.is choice}
+\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
+\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
+
+\ctikzset{bipole/current/label/unit/.initial=}
+\ctikzset{bipole/current/label/name/.initial=}
+
+\ctikzset{bipole/label/.is family}
+\ctikzset{bipole/label/position/.initial=90}
+\ctikzset{bipole/label/unit/.initial=}
+\ctikzset{bipole/label/name/.initial=}
+\ctikzset{bipole/nodes/.is family}
+\ctikzset{bipole/nodes/left/.is choice}
+\ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}}
+\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}}
+\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}}
+\ctikzset{bipole/nodes/left/diamond/.code={\ctikzsetvalof{bipole/nodes/left}{diamond}}}
+\ctikzset{bipole/nodes/right/.is choice}
+\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}}
+\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}}
+\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}}
+\ctikzset{bipole/nodes/right/diamond/.code={\ctikzsetvalof{bipole/nodes/right}{diamond}}}
+
+
+
+
+\newif\ifpgf@circuit@europeanresistor
+\ctikzset{resistor/.is choice}
+\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
+\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
+
+\ctikzset{inductor/.is choice}
+\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
+\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
+\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+
+\newif\ifpgf@circuit@strokediode
+\newif\ifpgf@circuit@fulldiode
+\pgf@circuit@strokediodefalse
+\pgf@circuit@fulldiodefalse
+
+\ctikzset{diode/.is choice}
+\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
+\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
+\ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
+
+\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full }}
+\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty }}
+\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke }}
+
+\ctikzset{thickness/.initial=2}
+\ctikzset{color/.initial=black}
+\pgfkeys{/tikz/color/.add code={}{\ctikzset{color=#1}}}
+
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circ@siunitx@res
+
+\ctikzset{voltage/.is family}
+\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
+\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
+\ctikzset{voltage/bump a/.initial=1.2}
+\ctikzset{voltage/bump b/.initial=1.5}
+\ctikzset{voltage/european label distance/.initial=1.4}
+\ctikzset{voltage/american label distance/.initial=1.1}
+% special cases
+\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
+\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
+\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
+\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
+\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
+%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
+%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
+
+\ctikzset{current/.is family}
+\ctikzset{current/distance/.initial = .5}
+
+\tikzset{american currents/.style = { \circuitikzbasekey/current = american } }
+\tikzset{european currents/.style = { \circuitikzbasekey/current = european } }
+\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } }
+\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } }
+\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } }
+\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } }
+
+\newif\ifpgf@circuit@europeangfsurgearrester
+\ctikzset{gas filled surge arrester/.is choice}
+\ctikzset{gas filled surge arrester/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } }
+\ctikzset{gas filled surge arrester/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } }
+
+\tikzset{american gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = american } }
+\tikzset{european gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = european } }
+\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } }
+\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } }
+\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } }
+\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } }
+\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } }
+\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester } }
+\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester } }
+\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } }
+
+% I should try to make the tree clearer (this voltaege conflicts with the options above)
+
+\newif\ifpgf@circuit@europeanvoltage
+\ctikzset{voltage/.is choice}
+\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } }
+\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } }
+
+\newif\ifpgf@circuit@europeancurrent
+\ctikzset{current/.is choice}
+\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse }
+\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue }
+
+\ctikzset{label/align/.is choice}
+\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
+\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
+\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+
+%%%%%%%%%% new
+\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+%%%---------- close: tex/pgfcirc.defines
+%%%%%%%%%%% Springe nach tex/pgfcircutils
+%%%---------- open: tex/pgfcircutils.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%\def\pgf@circ@handleSI#1{%
+ % \pgf@circ@siunitx@resfalse
+%
+ % \edef\len{\stringlength[e]{#1}}
+ %\testmatchingchar[e]{#1}{\len}{>}%
+ %\ifmatchingchar%
+ % \ifnum\findchars{#1}{<}=0
+ % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
+ %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
+ %\pgf@circ@siunitx@restrue
+% \else
+% \fi
+ %\else
+ %\fi
+%}
+
+\def\pgf@circ@handleSI#1{
+ \noexpandarg
+ \def\pgf@temp{}
+ \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
+ \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
+
+ \ifnum\pgf@circ@handleSI@unit@len=0
+ \pgf@circ@siunitx@resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf@circ@siunitx@restrue
+ \noexpandarg
+ \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
+ %\typeout{si |#1|}
+ }{
+ \pgf@circ@siunitx@resfalse
+ %\typeout{no si |#1|}
+ }
+ \fi
+}
+
+\def\pgf@circ@finallabel#1{%
+ \edef\pgf@temp{}%
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1label/unit}}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \ctikzvalof{bipole/#1label/name}%
+ \else%
+ $\SI{\ctikzvalof{bipole/#1label/name}}{\ctikzvalof{bipole/#1label/unit}}$%
+ \fi%
+}
+
+\def\pgf@circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf@circ@temp}
+ \edef\pgf@temp{}
+ }
+ \ifx\pgf@circ@temp\pgf@temp
+}
+
+%%%---------- close: tex/pgfcircutils
+%%%%%%%%%%% Springe nach tex/pgfcircmath
+%%%---------- open: tex/pgfcircmath.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Math routines
+
+\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
+
+% angle between 0 and 360
+\def\pgf@circ@slope#1#2{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{#2}%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \ifdim\pgf@x<0.1pt
+ \ifdim\pgf@x>-0.1pt % vertical
+ \ifdim\pgf@y<0pt
+ \def\pgfmathresult{-90.0}
+ \else
+ \def\pgfmathresult{+90.0}
+ \fi
+ \else % oblique with dx < 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0pt
+ \pgfmathsubtract{\pgfmathresult}{+180}
+ \fi
+ \fi
+ \else % oblique with dx > 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0pt
+ \pgfmathsubtract{\pgfmathresult}{+180}
+ \fi
+ \fi
+ \pgf@x=\pgfmathresult pt
+ \ifdim\pgf@x<0pt
+ \pgfmathadd{\pgfmathresult}{+360}
+ \fi
+ }
+
+
+%%%---------- close: tex/pgfcircmath
+
+%%%%%%%%%%% Springe nach tex/pgfcircshapes
+%%%---------- open: tex/pgfcircshapes.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Other shapes
+
+
+%% Nothing
+
+\pgfdeclareshape{emptyshape}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \northeast
+ \pgf@y=-\pgf@y
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \northeast
+ \pgf@y=0cm
+ \pgf@x=-\pgf@x
+ }
+ \anchor{text}{%
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+}
+
+%% Full terminal
+
+\pgfdeclareshape{circ}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}}
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Empty terminal
+
+\pgfdeclareshape{ocirc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}}
+ }
+
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Diamond terminal
+
+\pgfdeclareshape{diamond}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@temp}{\pgf@circ@res@up+\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up-\pgf@circ@res@temp}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% Current arrow
+
+\pgfdeclareshape{currarrow}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+
+ \endpgfscope
+ }
+
+}
+
+%% Current arrow
+
+\pgfdeclareshape{inputarrow}{
+ \savedanchor{\tip}{
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \tip
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{fill}
+
+ \endpgfscope
+ }
+
+}
+
+
+%% box
+
+\pgfdeclareshape{box}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+
+}
+
+%%%---------- close: tex/pgfcircshapes
+%%%%%%%%%%% Springe nach tex/pgfcircmonopoles
+%%%---------- open: tex/pgfcircmonopoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Monopoles
+
+%% Ground symbol
+
+\pgfdeclareshape{ground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+
+
+\pgfdeclareshape{rground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{tground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ %\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{sground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+% noiseless ground
+\pgfdeclareshape{nground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{1.3\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpatharc{0}{180}{1.3\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% protective ground
+\pgfdeclareshape{pground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathcircle{\pgfpoint{0pt}{-\pgf@circ@res@step}} {1.2\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% chassis ground
+\pgfdeclareshape{cground}{
+\anchor{center}{
+ \pgfpointorigin
+}
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/chassis/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Contributed by Leonardo Azzinnari
+\pgfdeclareshape{tlinestub}{
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+
+
+\pgfdeclareshape{antenna}{
+\anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+
+ % \pgfpathmoveto{\pgfpointorigin}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ % \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgftransformxshift{ -4\pgf@circ@res@step }
+
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{txantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{rxantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Vcc
+\pgfdeclareshape{vcc}{
+\anchor{center}{\pgfpointorigin}
+\anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=2\pgf@circ@res@step
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+}
+
+}
+
+% Vee
+\pgfdeclareshape{vee}{
+\anchor{center}{\pgfpointorigin}
+\anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=-2\pgf@circ@res@step
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+}
+
+}
+
+
+% match
+\pgfdeclareshape{match}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+ \pgf@x=1.5\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \pgf@y=-1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
+ \pgfusepath{fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+
+%%%---------- close: tex/pgfcircmonopoles
+%%%%%%%%%%% Springe nach tex/pgfcircbipoles
+%%%---------- open: tex/pgfcircbipoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%% Generic macro for defining a bipole shape
+% #1 - additional anchors
+% #2 - lower y-size of the bipole (from the center).
+% #3 - #shape is the name of the shape
+% #4 - upper y-size of the bipole (from the center)
+% #5 - width of the bipole
+% #6 - macros drawing the bipole
+
+
+\long\def\pgfcircdeclarebipole#1#2#3#4#5#6{
+ \pgfdeclareshape{#3shape}{
+
+ \savedanchor{\northeast}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\northeastborder}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwestborder}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwest}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\centerpoint}{
+ \pgf@circ@res@down=-#2\pgf@circ@Rlen
+ \pgf@circ@res@up=#4\pgf@circ@Rlen
+ \pgfpointorigin
+ \pgf@y=\pgf@circ@res@up
+ \advance\pgf@y by\pgf@circ@res@down
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{n}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=0cm
+ }
+ \anchor{ne}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ }
+ \anchor{nw}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=-\pgf@x
+ }
+ \anchor{e}{%
+ \ifpgf@circuit@bipole@reversed\else\southwest\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{s}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=0cm
+ }
+ \anchor{se}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=-\pgf@x
+ }
+ \anchor{sw}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ }
+ \anchor{w}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{north}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{right}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{above}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@x=0cm
+ }
+ \anchor{left}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{below}{%
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@x=0cm
+ }
+ \anchor{a}{%
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{b} {
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \savedanchor{\textanchor}{%
+ \pgf@y=\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \anchor{text}{%
+ \textanchor
+ }
+ \anchorborder{%
+ \def\pgf@temp{false}
+ \ifpgf@circuit@bipole@reversed\pgf@temp
+ \pgf@circ@res@left=-\pgf@x
+ \pgf@circ@res@right=-\pgf@y
+ \else
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@right=\pgf@y
+ \fi
+ \ifdim\pgf@circ@res@right>0cm
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
+ \else
+ \southwestborder
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
+ \fi
+ }
+
+ #1
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@zero = 0cm
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@res@right = \pgf@x
+ \southwest
+ \pgf@circ@res@down = \pgf@y
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ #6
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Standard bipole shapes declarations
+
+%% Resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/resistor/height}}{resistor}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \divide \pgf@circ@res@step by 12
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+
+
+%% Variable resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vresistor/height}}{vresistor}{\ctikzvalof{bipoles/vresistor/height}}{\ctikzvalof{bipoles/vresistor/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \divide \pgf@circ@res@step by 12
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/capacitor/height}}{capacitor}{\ctikzvalof{bipoles/capacitor/height}}{\ctikzvalof{bipoles/capacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+%% Polar Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pcapacitor/height}}{polarcapacitor}{\ctikzvalof{bipoles/pcapacitor/height}}{\ctikzvalof{bipoles/pcapacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/pcapacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+}
+
+%% Electrolytic Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ecapacitor/height}}{ecapacitor}{\ctikzvalof{bipoles/ecapacitor/height}}{\ctikzvalof{bipoles/ecapacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/ecapacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+ \pgfsetrectcap
+ % % % Draw plus pole
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ % % Draw minus pole
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{black}
+ \pgfusepath{draw,fill}
+ \pgfsetfillcolor{black}
+ % % plus pole annotation
+ \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
+ {\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$}
+}
+
+%% Battery
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 6
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+%% Battery 1
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+
+
+
+ \pgfusepath{draw}
+}
+
+
+
+%% cute inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/lower coil height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% variable cute inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}{vcuteinductor}{\ctikzvalof{bipoles/vcuteinductor/height}}{\ctikzvalof{bipoles/vcuteinductor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% variable american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Independent voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+%% Independent voltage source - American style
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
+ \fi
+ \fi
+ \pgfusepath{draw}
+}
+
+
+
+%% Independent sinusoidal voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesin/height}}{vsourcesin}{\ctikzvalof{bipoles/vsourcesin/height}}{\ctikzvalof{bipoles/vsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+% contributed by Alistair Kwan
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesquare/height}}{vsourcesquare}{\ctikzvalof{bipoles/vsourcesquare/height}}{\ctikzvalof{bipoles/vsourcesquare/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Empty Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% PV Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pvsource/height}}{pvsource}{\ctikzvalof{bipoles/pvsource/height}}{\ctikzvalof{bipoles/pvsource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ %Adapted from battery1
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %Arrow Part
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% DC Current Source with open shape
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcisource/height}}{dcisource}{\ctikzvalof{bipoles/dcisource/height}}{\ctikzvalof{bipoles/dcisource/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{-90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{270}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \ifpgf@circ@oldvoltagedirection
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgftransformrotate{180}
+ \else
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \fi\fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% DC-Voltage source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcvsource/height}}{dcvsource}{\ctikzvalof{bipoles/dcvsource/height}}{\ctikzvalof{bipoles/dcvsource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
+ \pgfusepath{draw}
+}
+
+
+%% Independent current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Independent double oo source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/oosource/height}}{oosource}{\ctikzvalof{bipoles/oosource/height}}{\ctikzvalof{bipoles/oosource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
+ \pgfusepath{draw}
+}
+
+
+%% Independent current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isourceam/height}}{isourceAM}{\ctikzvalof{bipoles/isourceam/height}}{\ctikzvalof{bipoles/isourceam/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \ifpgf@circ@oldvoltagedirection
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgftransformrotate{180}
+ \else
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \fi\fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+
+
+
+%% Independent sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isourcesin}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+%% Controlled voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled voltage source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourceam/height}}{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
+ \pgfusepath{draw}
+}
+
+
+%% Controlled sinusoidal voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Controlled sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Controlled current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{draw}}
+ \endpgfscope
+}
+
+%% Black generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black alternative zigzag Zener diode
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Black tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+}
+
+%% Black photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black varcap
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+%% Empty generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty alternative zigzag Zener diode
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Empty Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty varcap
+
+\pgfcircdeclarebipole{
+ \anchor{strokepathstart}{
+ \northeast
+ \pgf@y=0cm
+ \pgf@x=.8\pgf@x
+ }
+ \anchor{strokepathend}{
+ \northeast
+ \pgf@y=0cm
+ }
+ }{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+%% SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{spst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}}
+ \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@right}{-.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.14\pgf@circ@res@right}{-.35\pgf@circ@res@up}}
+ \pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+}
+
+%% Closing SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}}
+ \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+}
+
+%% Opening SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@right}{.1\pgf@circ@res@down}}
+ \pgfpatharc{15}{50}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.85\pgf@circ@res@left}{1.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.87\pgf@circ@res@left}{1.26\pgf@circ@res@up}}
+ \pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+
+}
+
+
+%% Push Button
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pushbutton/height 2}}{pushbutton}{\ctikzvalof{bipoles/pushbutton/height}}{\ctikzvalof{bipoles/pushbutton/width}}{
+
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+%METERINGSHAPE
+\long\def\drawmeteringcircle{
+ \def\pgf@circ@temp{right}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \def\pgf@circ@temp{below}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \pgf@circ@res@step=1.2\pgf@circ@res@up
+ \fi
+ \fi
+ %draw connections to circle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ %draw circle
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw arrow
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%AMPEREMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ammeter/height}}{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\textbf{A}}{}{}
+}
+%OHMMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ohmmeter/height}}{ohmmeter}{\ctikzvalof{bipoles/ohmmeter/height}}{\ctikzvalof{bipoles/ohmmeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
+}
+%VOLTMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/voltmeter/height}}{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\textbf{V}}{}{}
+
+}
+
+%% Short circuit
+
+\pgfcircdeclarebipole{}{0}{short}{0}{0}{ }
+
+%% Open circuit
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/open/height}}{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{
+
+}
+
+%% Generic bipole - used as resistor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/generic/height}}{generic}{\ctikzvalof{bipoles/generic/height}}{\ctikzvalof{bipoles/generic/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+%% fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+
+%% Generic bipole, filled - used as inductor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fullgeneric/height}}{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw,fill}
+}
+
+
+%% Generic asymmetric bipole
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ageneric/height}}{ageneric}{\ctikzvalof{bipoles/ageneric/height}}{\ctikzvalof{bipoles/ageneric/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+%% asymmetric fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/afuse/height}}{afuse}{\ctikzvalof{bipoles/afuse/height}}{\ctikzvalof{bipoles/afuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Memristor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/memristor/height}}{memristor}{\ctikzvalof{bipoles/memristor/height}}{\ctikzvalof{bipoles/memristor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Generic empty tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Photoresistor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/photoresistor/height 2}}{photoresistor}{\ctikzvalof{bipoles/photoresistor/height}}{\ctikzvalof{bipoles/photoresistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Thermistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistor/height}}{thermistor}{\ctikzvalof{bipoles/thermistor/height}}{\ctikzvalof{bipoles/thermistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+
+%% Thermistor PTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorptc/height 2}}{thermistorptc}{\ctikzvalof{bipoles/thermistorptc/height}}{\ctikzvalof{bipoles/thermistorptc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Thermistor NTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% thermocouple
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermocouple/height 2}}{thermocouple}{\ctikzvalof{bipoles/thermocouple/height}}{\ctikzvalof{bipoles/thermocouple/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+}
+
+%% Varistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varistor/height}}{varistor}{\ctikzvalof{bipoles/varistor/height}}{\ctikzvalof{bipoles/varistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}}
+}
+
+
+
+%% Generic full tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tfullgeneric/height}}{tfullgeneric}{\ctikzvalof{bipoles/tfullgeneric/height}}{\ctikzvalof{bipoles/tfullgeneric/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+
+
+
+%% Variable Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcapacitor/height}}{vcapacitor}{\ctikzvalof{bipoles/vcapacitor/height}}{\ctikzvalof{bipoles/vcapacitor/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfusepath{draw}
+}
+
+
+%% Piezoelectric Element
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piezoelectric/height}}{piezoelectric}{\ctikzvalof{bipoles/piezoelectric/height}}{\ctikzvalof{bipoles/piezoelectric/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ %% Outer markings
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %% Inner Box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left+4}{\pgf@circ@res@up-1}}{\pgfpoint{\pgf@circ@res@right-4}{\pgf@circ@res@down+1}}
+ \pgfusepath{draw}
+
+}
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Handling of terminals
+
+
+%% Easily usable styles
+
+\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=diamond}}
+
+\tikzset{reversed/.style = {\circuitikzbasekey/bipole/reversed=true}}
+
+
+%% The output routine
+
+\def\drawpoles{
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{diamond} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[diamond] {} }
+ \else
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[ocirc] {} }
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[circ] {} }
+ \fi
+ \fi
+ \fi
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{diamond} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[diamond] {} }
+ \else
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[ocirc] {} }
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[circ] {} }
+ \fi
+ \fi
+ \fi
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%% Lamp
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height}
+ }{tline}{\ctikzvalof{bipoles/tline/height}
+ }{\ctikzvalof{bipoles/tline/width}
+ }
+ {
+ \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0}}
+ {\pgfpoint{\pgf@circ@res@step}{0}}
+ {\pgfpoint{0}{-\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% SQUID added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+% Generic barrier added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+}
+
+
+% Contributed by Danilo Piazzalunga
+
+\pgfdeclareshape{buffer}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+
+
+\pgfdeclareshape{plain amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+%% Generic two port box
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/twoport/height}}{twoport}{\ctikzvalof{bipoles/twoport/height}}{\ctikzvalof{bipoles/twoport/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+}
+
+%% voltage controled oscillator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vco/width}}{vco}{\ctikzvalof{bipoles/twoport/width}}{\ctikzvalof{bipoles/vco/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+}
+
+%% bandpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandpass/width}}{bandpass}{\ctikzvalof{bipoles/bandpass/width}}{\ctikzvalof{bipoles/bandpass/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% highpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/highpass/width}}{highpass}{\ctikzvalof{bipoles/highpass/width}}{\ctikzvalof{bipoles/highpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% lowpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lowpass/width}}{lowpass}{\ctikzvalof{bipoles/lowpass/width}}{\ctikzvalof{bipoles/lowpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% ADC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/adc/width}}{adc}{\ctikzvalof{bipoles/adc/width}}{\ctikzvalof{bipoles/adc/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{A}
+ \def\textii{D}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{A}
+ \def\textii{D}
+ \fi\fi
+
+ % draw inner symbol
+ \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}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DAC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dac/width}}{dac}{\ctikzvalof{bipoles/dac/width}}{\ctikzvalof{bipoles/dac/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{D}
+ \def\textii{A}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{D}
+ \def\textii{A}
+ \fi\fi
+
+ % draw inner symbol
+ \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}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DSP
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dsp/width}}{dsp}{\ctikzvalof{bipoles/dsp/width}}{\ctikzvalof{bipoles/dsp/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{DSP}}
+}
+
+%% FFT
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fft/width}}{fft}{\ctikzvalof{bipoles/fft/width}}{\ctikzvalof{bipoles/fft/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{FFT}}
+}
+
+%% Amplifier
+\pgfcircdeclarebipole{}{
+ \ifpgf@circuit@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@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \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
+ \pgfusepath{draw}
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+}
+
+
+%% variable amplifier
+\pgfcircdeclarebipole{}{
+ \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@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \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
+ \pgfusepath{draw}
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+ % 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}
+}
+
+%% pi attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piattenuator/width}}{piattenuator}{\ctikzvalof{bipoles/piattenuator/width}}{\ctikzvalof{bipoles/piattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vpiattenuator/width}}{vpiattenuator}{\ctikzvalof{bipoles/vpiattenuator/width}}{\ctikzvalof{bipoles/vpiattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% T attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tattenuator/width}}{tattenuator}{\ctikzvalof{bipoles/tattenuator/width}}{\ctikzvalof{bipoles/tattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vtattenuator/width}}{vtattenuator}{\ctikzvalof{bipoles/vtattenuator/width}}{\ctikzvalof{bipoles/vtattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{phaseshifter}{\ctikzvalof{bipoles/phaseshifter/width}}{\ctikzvalof{bipoles/phaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+}
+
+%% variable phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{vphaseshifter}{\ctikzvalof{bipoles/vphaseshifter/width}}{\ctikzvalof{bipoles/vphaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% detector
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/detector/width}}{detector}{\ctikzvalof{bipoles/detector/width}}{\ctikzvalof{bipoles/detector/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % draw inner stuff
+ \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@Rlen / \ctikzvalof{bipoles/generic/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
+ \fi
+
+}
+
+
+
+
+%% european gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{european gas filled surge arrester}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{\ctikzvalof{bipoles/european gas filled surge arrester/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+
+
+
+%% american gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{american gas filled surge arrester}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
+ %\def\pgf@circ@temp{right}
+ %\ifx\tikz@res@label@pos\pgf@circ@temp
+ % \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ %\else
+% \def\pgf@circ@temp{below}
+% \ifx\tikz@res@label@pos\pgf@circ@temp
+% \pgf@circ@res@step=-1.2\pgf@circ@res@up
+% \else
+% \pgf@circ@res@step=1.2\pgf@circ@res@up
+% \fi
+% \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfnode{circle}{center}{}{}{}
+
+ \pgfscope
+ \pgfsetarrowsend{latex}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+
+ %\pgftransformshift{\pgfpoint{.25\pgf@circ@res@left}{.45\pgf@circ@res@down}}
+ %\pgfnode{circ}{center}{}{}{}
+ %\pgftransformshift{}
+ \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
+ \pgfusepath{fill}
+}
+
+% % MECHANICAL SYMBOLS
+
+%% mechanical capacitance - stiffness/spring
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spring/height}}{spring}{\ctikzvalof{bipoles/spring/height}}{\ctikzvalof{bipoles/spring/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical inductance - mass
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/mass/box height}}{mass}{\ctikzvalof{bipoles/mass/height}}{\ctikzvalof{bipoles/mass/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
+
+\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical resistor - damper
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/damper/height}}{damper}{\ctikzvalof{bipoles/damper/height}}{\ctikzvalof{bipoles/damper/width}}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {\pgf@circ@res@zero}}
+ \pgfusepath{stroke}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+
+
+%%%---------- close: tex/pgfcircbipoles
+%%%%%%%%%%% Springe nach tex/pgfcirctripoles
+%%%---------- open: tex/pgfcirctripoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Tripoles
+
+
+
+\pgfdeclareshape{spdt}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out 1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{out 2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left
+
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+ \pgfpathlineto{
+ \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
+ {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
+ }
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Logic ports
+%%
+
+
+
+
+
+
+\long\def\pgfcircdeclarelogicport#1#2{
+ \pgfdeclareshape{american #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \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
+
+ #2
+
+ }
+ }
+}
+
+
+\pgfcircdeclarelogicport{and}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+ \pgfpathcurveto
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{nand}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{nor}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+
+
+\pgfcircdeclarelogicport{or}{
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{xor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{xnor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfdeclareshape{american not port}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% #1 - name
+% #2 - text inside
+% #3 - number of inputs
+% #4 - is it a not
+
+\long\def\pgfcircdeclareeurologicport#1#2#3#4{
+ \pgfdeclareshape{european #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \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
+ \def\pgf@temp{1}
+ \def\pgf@circ@temp{#3}
+ \ifx\pgftemp\pgf@circ@temp % one input
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}
+ \else % two inputs
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \fi%
+ %
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
+ %
+ \edef\pgf@temp{not}
+ \edef\pgf@circ@temp{#4}
+ \ifx\pgf@temp\pgf@circ@temp % is a not
+ \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf@circ@res@up}}
+ \fi
+ %
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgftext{#2}
+ %
+ %
+ %
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+%
+%
+ }
+ }
+}
+
+
+
+\pgfcircdeclareeurologicport{and}{$\&$}{2}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{2}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{2}{}
+\pgfcircdeclareeurologicport{not}{$1$}{1}{not}
+\pgfcircdeclareeurologicport{nand}{$\&$}{2}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{2}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{2}{not}
+
+\long\def\pgfcircdeclaretransistor#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northeast{% upper right
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%center left
+ \pgf@y=0pt
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@y=.7\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=0.1\pgf@x
+ }
+ \anchor{pathstart}{ % south
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{pathend}{
+ \northeast
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \northeast
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{south east}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{base}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{nobase}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x
+ }
+ \anchor{nogate}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@x
+ }
+ \anchor{E}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{emitter}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{C}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{collector}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{D}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{drain}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ #2
+ \backgroundpath{
+ \pgftransformationadjustments
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ %
+ \ifnum \pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction} > 0
+ \pgf@circuit@trans@ntypetrue
+ \else
+ \pgf@circuit@trans@ntypefalse
+ \fi
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \left
+ \pgf@circ@res@left = \pgf@x
+ %
+ #3
+ % BODY DIODE
+ \ifpgf@circuit@fet@bodydiode
+ \drawbodydiode{#1}
+ \fi
+ %
+ }
+ }
+}
+
+\long\def\drawbodydiode#1{
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgftransformrotate{90}
+ \pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}}
+ \ifpgf@circuit@fulldiode
+ \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \else
+ \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \fi
+ \endpgfscope
+ %Draw upper connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope{}
+ %Draw lower connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+}
+
+\long\def\declarebpt#1{
+ \pgfcircdeclaretransistor{#1}{}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transiytor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{.5}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \ifpgf@circuit@bpt@drawphoto
+ \pgfscope
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \else
+ \ifpgf@circuit@bpt@drawbase
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \fi
+ }
+}
+
+\declarebpt{npn}
+\declarebpt{pnp}
+
+\long\def\declareigbt#1{
+\pgfcircdeclaretransistor{#1}{}
+{
+ %draw upper connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ %draw thicker gate lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw lower connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transiytor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{.5}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ %draw gate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
+ \fi
+ \pgfusepath{draw}
+}
+}
+
+\declareigbt{pigbt}
+\declareigbt{nigbt}
+\declareigbt{Lnigbt}
+\declareigbt{Lpigbt}
+
+
+\pgfcircdeclaretransistor{nmos}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+}
+
+
+\pgfcircdeclaretransistor{pmos}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+
+
+ \pgfusepath{draw}
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \pgfpathcircle{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \ifpgf@circuit@pmos@emptycircle
+ \pgfsetfillcolor{white}
+ \fi
+ \pgfusepath{draw,fill}
+}
+
+\long\def\drawfetcore#1{
+ \pgftransformationadjustments
+ %top connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \ifpgf@circuit@trans@depletiontype
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \else
+
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \fi
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %Bulk connection line
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ %bottom connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ %draw thick gate line
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \ifpgf@circuit@trans@ntype
+ \else
+ \pgftransformrotate{180}
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ % GATE CONNECTION
+ \ifpgf@circuit@bpt@drawgate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+ \fi
+
+}
+
+\long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
+{\pgfcircdeclaretransistor{#1}{
+ \anchor{bulk}{\left\pgf@x=0pt}
+ \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
+ #2
+ }
+ {#3}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nfet}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pfet}
+}
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfete}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+
+
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
+\pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfetebulk}
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+
+
+% N-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{nigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfete}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
+\pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfetebulk}
+}
+
+
+% P-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{pigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+\pgfcircdeclaretransistor{njfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclaretransistor{pjfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ % GATE, DEPLETION TYPE
+ \pgfscope %% added
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth} %% added
+ \pgfusepath{draw} %% added
+ \endpgfscope %% added
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ % GATE
+ %\pgfscope
+ %\pgfpathmoveto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ %\pgfpathlineto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ %\pgfusepath{draw}
+ %\endpgfscope
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfusepath{draw}
+
+ % Wavy lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+%% Black thyristor
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{anode}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{cathode}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/thyristor/height 2}}{fullthyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty thyristor
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{anode}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{cathode}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/thyristor/height 2}}{emptythyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty triac
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{anode}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{cathode}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/triac/height}}{emptytriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty triac
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{anode}{
+ \ifpgf@circuit@bipole@reversed\northeast\else\southwest\fi
+ \pgf@y=0cm
+ }
+ \anchor{cathode}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/triac/height}}{fulltriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+
+
+
+
+\pgfcircdeclarebipole{
+ \anchor{out 1}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=0cm
+ }
+ \anchor{out 2}{
+ \ifpgf@circuit@bipole@reversed\southwest\else\northeast\fi
+ \pgf@y=.8\pgf@y
+ }
+}{\ctikzvalof{tripoles/toggleswitch/height 2}}{toggleswitch}{\ctikzvalof{tripoles/toggleswitch/height}}{\ctikzvalof{tripoles/toggleswitch/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetdash{}{0cm}
+}
+
+
+
+
+
+
+
+
+
+
+\pgfdeclareshape{op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+%%Transkonduktanzverstärker
+\pgfdeclareshape{gm amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} %
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ %Umrandung:
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}} %geändert startpunkt neu am ausgangsstrich
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{15pt}}%vom Ausgang nach oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-15pt}}%ecke links unten nach rechts unten
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} %rechts unten zum ausgang
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+
+
+%% Potentiometer
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+ \anchor{W}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/potentiometer/height 2}}{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}{\ctikzvalof{bipoles/potentiometer/width}}{
+\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+\pgftransformationadjustments
+\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+\divide \pgf@circ@res@step by 12
+
+\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+
+\pgf@circ@res@other = \pgf@circ@res@left
+\advance\pgf@circ@res@other by \pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by \pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+\pgfsetbeveljoin
+\pgfusepath{draw}
+
+\pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+\endpgfscope
+}
+
+
+
+
+
+%% Generic tunable
+
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/generic potentiometer/height 2}}{genericpotentiometer}{\ctikzvalof{bipoles/generic potentiometer/height}}{\ctikzvalof{bipoles/generic potentiometer/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+\pgfdeclareshape{mixer}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{adder}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{oscillator}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{text}{
+ \pgf@x=-2\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@Rlen{}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
+
+ % draw outer box
+ \ifpgf@circuit@boxed{}
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{circulator}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed{}
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % inner arrow
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
+ \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+
+% Wilkinson divider
+\pgfdeclareshape{wilkinson}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{out2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \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}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ % draw inner resisitor - european or american style is recognised
+ {
+ \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgftransformrotate{90}
+
+ % calculate size of resistor
+ \ifpgf@circuit@europeanresistor
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}}
+ \fi
+ }
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+% electromechanical device (motor/generator)
+\pgfdeclareshape{elmech}
+{
+ \savedanchor\northwest{
+ %\ifpgf@circuit@boxed
+ % \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ % \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ % \pgf@y=.5\pgf@y
+ % \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ % \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ % \pgf@x=.5\pgf@x
+ %\else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ %\fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ % draw outer box
+ % \ifpgf@circuit@boxed
+ % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ % \fi
+ % draw outer circle
+ %\ifpgf@circuit@boxed
+ % \pgf@circ@res@step=.7\pgf@circ@res@step
+ % \pgfsetdash{}{0pt} % draw solid circle if boxed
+ %\else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ %\fi
+ \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{black}
+ \pgfusepath{draw,fill}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%%%---------- close: tex/pgfcirctripoles
+%%%%%%%%%%% Springe nach tex/pgfcircquadpoles
+%%%---------- open: tex/pgfcircquadpoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Quadripoles
+
+\long\def\pgfcircdeclarequadpole#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
+ }
+ \anchor{A2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{A1}{
+ \northwest
+ }
+ \anchor{B2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{base}{
+ \northwest
+ \pgf@x=0pt
+ }
+ #3
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ %\pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+
+ #2
+
+ }
+ }
+}
+
+
+
+\def\pgf@circ@drawtransformerbasicanchor{
+ \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
+ \anchor{AA2}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{AA1}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+}
+
+\def\pgf@circ@drawtransformerbasicbody{
+ \def\stretto{.4}
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@down}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+
+ \endpgfscope
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@up}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+ % contrib Kristofer M. Monisit
+
+ \pgfdeclareshape{fd op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out +}{
+ \northwest
+ \pgf@y=.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out -}{
+ \northwest
+ \pgf@y=-.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+
+ % Negative output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ % Positive output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+
+ % Draw them all!
+ \pgfusepath{draw}
+
+ % Triangle
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+
+\pgfcircdeclarequadpole{transformer}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \def\stretto{.4}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
+ \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
+ \pgfusepath{draw}
+
+}{}
+
+%% four-port
+% defines a general outer box for four-ports
+% TikZ usage:
+% \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
+% (coup.port1) to[short,-o] ++(-1,0)
+%
+
+\long\def\pgfcircdeclarefourport#1#2{
+ \pgfdeclareshape{#1}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{port1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{port4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ #2
+
+ % draw inner text
+ \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ }
+ }
+}
+
+% four-port
+\pgfcircdeclarefourport{fourport}{}
+
+
+% straight coupler
+\pgfcircdeclarefourport{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarefourport{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+
+}
+%%%---------- close: tex/pgfcircquadpoles
+
+%%%%%%%%%%% Springe nach tex/pgfcirclabel
+%%%---------- open: tex/pgfcirclabel.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Bipole label positioning
+
+%% Options
+\ctikzset{label/.style = { l=#1 } }
+\ctikzset{l/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{label above/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l^/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{label below/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+\ctikzset{l_/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+
+
+\def\pgf@circ@drawlabel{
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{label/align}}
+ \def\pgf@circ@temp{straight}
+ }
+ \ifx\pgf@temp\pgf@circ@temp %straight
+ \pgf@circ@drawreglabel
+ \else
+ \pgfextra{\def\pgf@circ@temp{rotate}}
+ \ifx\pgf@temp\pgf@circ@temp %rotate
+ \pgf@circ@drawrotlabel
+ \else % smart
+ \pgf@circ@drawsmartlabel
+ \fi
+ \fi
+}
+
+\def\pgf@circ@drawsmartlabel{
+ \pgfextra{
+ %\pgfmathadd{\pgf@circ@direction}{360}
+ \pgfmathmod{\pgf@circ@direction}{90}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \ifnum \pgfcircmathresult > 20
+ \ifnum \pgfcircmathresult < 70 % NON quasi retto
+ \pgf@circ@drawrotlabel
+ \else
+ \pgf@circ@drawreglabel
+ \fi
+ \else
+ \pgf@circ@drawreglabel
+ \fi
+}
+
+%% Output routing
+%% #1 - node name
+
+\def\pgf@circ@drawrotlabel{
+ \pgfextra{
+ % calcolo rotazione label
+ \def\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label
+ \edef\pgfcirclabrot{\pgf@circ@direction} % primo e quarto quadrante
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 90 \ifnum \pgfcircmathresult < 270 % terzo e secondo
+ \pgfmathsubtract{\pgf@circ@direction}{180}
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \pgfmathadd{\pgf@circ@temp}{180} %%%
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} %%%
+ \fi\fi
+
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@temp}{180}
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ }
+ coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.north)$)
+ (labelcoor) node [rotate=\pgfcirclabrot] {\pgf@circ@finallabel{}} % c'era un transform shape
+}
+
+\def\pgf@circ@drawreglabel{
+ \pgfextra{
+ \pgfmathsubtract{\pgf@circ@direction}{90}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/label/position}} %%% àncora label
+ \ifnum \pgf@circ@temp < 0
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ }
+ node [ anchor = \pgf@circ@labanc]
+ at (\ctikzvalof{bipole/name}.\pgf@circ@temp) {\pgf@circ@finallabel{}}
+}
+
+
+\ctikzset{text/.style = { t=#1 } }
+\ctikzset{t/.code = {
+ \ctikzsetvalof{bipoles/twoport/text}{#1}
+}}
+
+%%%---------- close: tex/pgfcirclabel
+%%%%%%%%%%% Springe nach tex/pgfcircvoltage
+%%%---------- open: tex/pgfcircvoltage.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Voltage management
+
+
+\ctikzset{v^>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v^</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v_>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+
+% Default position varies whether the component is a voltage source
+% or not
+\ctikzset{v/.code = {
+ \ifpgf@circuit@bipole@isvoltage
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi
+ \fi
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@bipole@current@backward
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \fi\fi\fi
+ \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
+ \ctikzsetvalof{bipole/voltage/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }
+}
+
+\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
+\ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
+\ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
+\ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
+
+
+%% Output routine for generic bipoles
+
+\def\pgf@circ@drawvoltagegeneric{
+ \pgfextra{
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@voltage@below\pgf@circuit@bipole@voltage@belowfalse\else\pgf@circuit@bipole@voltage@belowtrue\fi
+ \fi
+
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@voltage@angle{90}
+ \else
+ \def\pgf@circ@voltage@angle{-90}
+ \fi
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
+ { \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
+ { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
+ }
+
+ coordinate (pgfcirc@mid) at ($(\tikztostart) ! \distacefromnode ! (\ctikzvalof{bipole/name}.left)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@mid) ! -\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen ! \pgf@circ@voltage@angle:(\ctikzvalof{bipole/name}.left)$)
+
+ coordinate (pgfcirc@mid) at ($(\tikztotarget) ! \distacefromnode ! (\ctikzvalof{bipole/name}.right)$)
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@mid) ! \ctikzvalof{voltage/distance from line}\pgf@circ@Rlen ! \pgf@circ@voltage@angle : (\ctikzvalof{bipole/name}.right)$)
+
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
+ \else
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vto)
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$}
+ \fi
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$}
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine for voltage sources
+
+\def\pgf@circ@drawvoltagegenerator{
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-120)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-60)$)
+ \else
+ coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.120)$)
+ coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.60)$)
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vcont2) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont1)
+ \else
+ (pgfcirc@Vcont1) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont2)
+ \fi
+
+ \else % american voltage
+
+ \ifpgf@circuit@bipole@voltageoutsideofsymbol
+ % if it is a battery, must put + and -
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vcont2) node {$-$} (pgfcirc@Vcont1) node {$+$}
+ \else
+ (pgfcirc@Vcont1) node {$+$} (pgfcirc@Vcont2) node {$-$}
+ \fi
+ \fi
+
+ \fi
+}
+
+%% Output routine
+
+\def\pgf@circ@drawvoltage{ % node name
+ \pgfextra{
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@voltage@label@where{90}
+ \fi
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
+ { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
+ }
+
+ \ifpgf@circuit@bipole@isvoltage
+ \pgf@circ@drawvoltagegenerator
+ \else
+ \pgf@circ@drawvoltagegeneric
+ \fi
+ (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)
+ coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
+ \ifpgf@circuit@europeanvoltage\eudist\else\ctikzvalof{voltage/american label distance}\fi !
+ (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$)
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=0]
+ at (Vlab) { \pgf@circ@finallabel{voltage/} }
+}
+
+
+
+
+
+% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.-110) $)
+% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.-70) $)
+% \else
+% coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.110) $)
+% coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) !
+% \ctikzvalof{voltage/bump b} !
+% (\ctikzvalof{bipole/name}.70) $)
+% \fi
+%%%---------- close: tex/pgfcircvoltage
+%%%%%%%%%%% Springe nach tex/pgfcirccurrent
+%%%---------- open: tex/pgfcirccurrent.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Current handling
+
+%% Options
+
+
+\ctikzset{i^>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i>^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i>_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i^</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i<^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i<_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i/.code = {
+% \ifpgf@circuit@bipole@iscurrent
+% \pgfkeys{\circuitikzbasekey/bipole/current/position=above}
+% \else
+% \pgfkeys{\circuitikzbasekey/bipole/current/position=below}
+% \fi
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
+ \ctikzsetvalof{bipole/current/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+%reverse current direction for voltage sources
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@isvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below }
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \fi\fi\fi
+}
+}
+
+
+\ifpgf@circ@oldvoltagedirection
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
+\else
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
+\fi
+\ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
+\ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
+\ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
+
+
+\def\pgf@circ@drawnormalcurrent{
+ \ifpgf@circuit@bipole@current@before
+ \ifpgf@circuit@bipole@current@backward
+ { (\ctikzvalof{bipole/name}.left) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztostart)
+ }
+ \else
+ { (\tikztostart) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\ctikzvalof{bipole/name}.left)
+ }
+ \fi
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ { (\tikztotarget) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\ctikzvalof{bipole/name}.right)
+ }
+ \else
+ { (\ctikzvalof{bipole/name}.right) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztotarget)
+ }
+ \fi
+ \fi
+}
+
+%% Output routine
+%% #1 - node name
+
+\def\pgf@circ@drawcurrent{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@bipole@current@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@current@label@where{+90}
+ \fi
+ }
+
+
+ \pgfextra{ \def\pgf@temp{short} \edef\pgf@circ@temp{\ctikzvalof{bipole/kind}} }
+
+ \ifx\pgf@circ@temp\pgf@temp % caso di corrente (centrata) su un corto
+ \ifpgf@circuit@bipole@current@backward
+ { (\tikztotarget) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztostart) }
+ \else
+ { (\tikztostart) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztotarget) }
+ \fi
+
+ \else % altri bipoli - e quindi tra nodo e target
+
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@europeancurrent
+ \pgf@circ@drawnormalcurrent
+ \else
+ \fi
+ \else
+ \pgf@circ@drawnormalcurrent
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@iscurrent
+ node [anchor=\pgf@circ@dir] at (\ctikzvalof{bipole/name}.\pgf@circ@bipole@current@label@where)
+ { \pgf@circ@finallabel{current/} }
+ \else
+ (Iarrow.\pgf@circ@bipole@current@label@where) node [anchor=\pgf@circ@dir]
+ { \pgf@circ@finallabel{current/} }
+ \fi
+
+}
+
+
+
+
+%%%---------- close: tex/pgfcirccurrent
+
+\ExecuteOptions{nofetbodydiode,nofetsolderdot,nooldvoltagedirection,europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility}
+
+\ProcessOptions\relax
+
+%%%%%%%%%%% Springe nach tex/pgfcircpath
+%%%---------- open: tex/pgfcircpath.tex
+
+\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+
+
+% Names
+\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
+\ctikzset{n/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/name=#1}
+}}
+
+% Reflect the node along
+\ctikzset{mirrored/.is choice}
+\ctikzset{mirror value/.initial=1}
+\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
+\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
+\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
+
+% Initialize paths
+\def\pgfcircresetpath{
+ \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90,
+ bipole/reversed=false, bipole/kind=,
+ bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
+ bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
+ bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
+ bipole/current/y position=above, bipole/current/direction=forward,
+ mirrored=false
+ }
+}
+
+
+%% Generic bipole path
+\def\pgf@circ@bipole@path#1#2{
+ \pgfextra{
+ \ctikzset{bipole/kind = #1}
+
+ \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+ \def\pgf@circ@temp{}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = #2\pgf@circ@rand} % create it
+ \fi
+
+ \def\pgf@temp{open}
+ \def\pgf@circ@temp{#1}
+ }
+ \ifpgf@circuit@bipole@reversed
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ \ifpgf@circuit@bipole@strokedsymbol%draw line thrue symbol(e.g. diodes)
+ \ifcsname pgf@anchor@#1shape@strokepathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.strokepathstart)
+ (\ctikzvalof{bipole/name}.strokepathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center)--(\ctikzvalof{bipole/name}end.center)
+ \fi
+ \else
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
+ (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \fi
+ \fi
+ \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabel\fi
+ \drawpoles
+ \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
+ \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
+ % reset
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+%% Path definitions
+
+\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
+\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
+\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
+\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
+\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
+\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
+\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
+\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
+\def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
+\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
+\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
+\def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
+\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
+\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}}
+\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
+\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
+\def\pgf@circ@inductor@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductor@path{#1}%
+ \else%
+ \pgf@circ@americaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@vinductor@path#1{
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@veuropeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@vcuteinductor@path{#1}%
+ \else%
+ \pgf@circ@vamericaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
+\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
+\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
+\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
+\def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
+\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
+\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
+\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
+\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
+\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
+\def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
+\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
+\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
+\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
+\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
+\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
+\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
+\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
+\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
+\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
+\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
+\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
+\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
+\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
+\def\pgf@circ@spst@path#1{\pgf@circ@bipole@path{spst}{#1}}
+\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
+\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
+\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
+\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
+\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
+\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
+\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
+\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
+\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
+\def\pgf@circ@empty@path#1{}
+\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
+\def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
+\def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
+\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
+\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
+\def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
+\def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
+\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
+\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
+\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
+\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
+\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
+\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
+
+\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
+\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
+\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
+
+\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
+\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
+\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
+\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
+\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
+\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
+\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
+\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
+\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
+\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
+\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
+\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
+\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
+\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
+\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
+\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
+\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
+\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
+
+%%Mechanical
+\def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
+\def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
+\def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
+
+
+
+
+%% Styles
+
+\def\comnpatname{\ifpgf@circuit@compat *\else\fi}
+\def\compattikzset#1{\tikzset{\comnpatname#1}}
+
+%\def\ctikzsetbipole#1#2{%
+% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
+%}
+
+\compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
+\compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
+\compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
+\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
+\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
+\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
+\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
+\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
+\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
+\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
+\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
+\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
+\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
+\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
+\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
+\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
+\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
+\compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
+\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
+\compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
+\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
+\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
+\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
+\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
+\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
+\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
+\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
+\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
+\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
+\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
+\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
+\compattikzset{transmission line/.style = {tline = #1}}
+\compattikzset{TL/.style = {tline = #1}}
+\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+
+\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
+\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
+\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
+\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
+\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
+\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
+\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
+
+\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
+
+\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
+\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
+\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
+\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
+\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
+
+\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
+\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
+\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
+\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
+\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
+\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
+\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
+\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
+\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
+\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
+\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
+\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
+\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
+\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
+\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
+\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
+\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
+\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
+
+% % % % % %
+% % Beginn of Diodes
+% % % % % %
+
+\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
+\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
+\def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
+\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
+\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
+\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
+\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
+\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
+\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
+\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
+\def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
+\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
+\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
+\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
+\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
+\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
+
+\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
+\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
+\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
+\compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
+\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
+\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
+\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
+\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
+\compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
+\compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
+
+\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
+\compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
+%\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
+
+\compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
+\compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
+\compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
+\compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
+\compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
+\compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
+\compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
+\compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
+\compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
+\compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
+
+%% Define Shortcuts
+\compattikzset{Do/.style = {\comnpatname empty diode}}
+\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
+\compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
+\compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
+\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
+\compattikzset{pDo/.style = {\comnpatname empty photodiode}}
+\compattikzset{leDo/.style = {\comnpatname empty led}}
+\compattikzset{VCo/.style = {\comnpatname empty varcap}}
+\compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
+\compattikzset{Tro/.style = {\comnpatname empty triac}}
+
+\compattikzset{D*/.style = {\comnpatname full diode}}
+\compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
+\compattikzset{zD*/.style = {\comnpatname full Zener diode}}
+\compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
+\compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
+\compattikzset{pD*/.style = {\comnpatname full photodiode}}
+\compattikzset{leD*/.style = {\comnpatname full led}}
+\compattikzset{VC*/.style = {\comnpatname full varcap}}
+\compattikzset{Ty*/.style = {\comnpatname full thyristor}}
+\compattikzset{Tr*/.style = {\comnpatname full triac}}
+
+\compattikzset{D/.style = {\comnpatname diode}}
+\compattikzset{tD/.style = {\comnpatname tunnel diode}}
+\compattikzset{zD/.style = {\comnpatname Zener diode}}
+\compattikzset{zzD/.style = {\comnpatname ZZener diode}}
+\compattikzset{sD/.style = {\comnpatname Schottky diode}}
+\compattikzset{pD/.style = {\comnpatname photodiode}}
+\compattikzset{leD/.style = {\comnpatname led}}
+\compattikzset{VC/.style = {\comnpatname varcap}}
+\compattikzset{Ty/.style = {\comnpatname thyristor}}
+\compattikzset{Tr/.style = {\comnpatname triac}}
+
+\compattikzset{D-/.style = {\comnpatname stroke diode}}
+\compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
+\compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
+\compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
+\compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
+\compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
+\compattikzset{leD-/.style = {\comnpatname stroke led}}
+\compattikzset{VC-/.style = {\comnpatname stroke varcap}}
+\compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
+\compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
+
+% % % % % %
+% % End of Diodes
+% % % % % %
+
+
+\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
+\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
+\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spst@path, l=#1}}
+\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
+
+\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
+\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
+\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
+
+% short forms
+\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path}}
+\compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path}}
+
+\compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
+\compattikzset{isource/.style = {\comnpatname current source = #1}}
+\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
+\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+
+\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+
+\compattikzset{R/.style= {\comnpatname resistor = #1}}
+%\ifpgf@circuit@compat\else\compattikzset{R/.style= {resistor = #1}}\fi
+\compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
+\compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
+\compattikzset{thR/.style= {\comnpatname thermistor = #1}}
+\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
+\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
+\compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
+\compattikzset{C/.style = {\comnpatname capacitor = #1}}
+\compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
+\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
+\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
+\compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
+\compattikzset{L/.style = {\comnpatname inductor = #1}}
+\compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
+\compattikzset{V/.style = {\comnpatname voltage source = #1}}
+\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
+\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
+ \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
+ \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
+ \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+\compattikzset{I/.style = {\comnpatname current source = #1}}
+\compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
+ \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
+ \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
+ \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+
+
+\compattikzset{Mr/.style = {\comnpatname memristor}}
+
+\compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
+\compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
+\compattikzset{spst/.style = {\comnpatname switch = #1}}
+
+\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
+
+\compattikzset{vdd/.style = {\comnpatname vcc = #1}}
+\compattikzset{vss/.style = {\comnpatname vee = #1}}
+
+\def\inheritlogicport#1#2{
+ \pgfdeclareshape{#2 port}{
+ \inheritsavedanchors[from=#1 #2 port]
+ \inheritbackgroundpath[from=#1 #2 port]
+ \inheritanchor[from=#1 #2 port]{in}
+ \inheritanchor[from=#1 #2 port]{in 1}
+ \inheritanchor[from=#1 #2 port]{in 2}
+ \inheritanchor[from=#1 #2 port]{out}
+ \inheritanchor[from=#1 #2 port]{center}
+ \inheritanchor[from=#1 #2 port]{left}
+ }
+}
+
+\ifpgf@circuit@europeanlogicport
+ \inheritlogicport{european}{and}
+ \inheritlogicport{european}{or}
+ \inheritlogicport{european}{xor}
+ \inheritlogicport{european}{not}
+ \inheritlogicport{european}{nand}
+ \inheritlogicport{european}{nor}
+ \inheritlogicport{european}{xnor}
+\else
+ \inheritlogicport{american}{and}
+ \inheritlogicport{american}{or}
+ \inheritlogicport{american}{xor}
+ \inheritlogicport{american}{not}
+ \inheritlogicport{american}{nand}
+ \inheritlogicport{american}{nor}
+ \inheritlogicport{american}{xnor}
+\fi
+
+% Transistor like bipoles
+
+\def\pgf@circ@trans@path#1#2{
+ \pgfextra{
+ \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+ \def\pgf@circ@temp{#2}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
+ \fi
+ }
+ \ifpgf@circuit@bipole@reversed
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathadd{\pgfmathresult}{-90}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
+ \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
+ (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+\def\pgf@circ@definetranspath#1{
+ \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
+}
+
+\pgf@circ@definetranspath{elmech}
+\pgf@circ@definetranspath{nmos}
+\pgf@circ@definetranspath{pmos}
+\pgf@circ@definetranspath{npn}
+\pgf@circ@definetranspath{pnp}
+\pgf@circ@definetranspath{nfet}
+\pgf@circ@definetranspath{nigfete}
+\pgf@circ@definetranspath{nigfetd}
+\pgf@circ@definetranspath{nigfetebulk}
+\pgf@circ@definetranspath{pfet}
+\pgf@circ@definetranspath{pigfete}
+\pgf@circ@definetranspath{pigfetd}
+\pgf@circ@definetranspath{pigfetebulk}
+\pgf@circ@definetranspath{njfet}
+\pgf@circ@definetranspath{pjfet}
+\pgf@circ@definetranspath{pigbt}
+\pgf@circ@definetranspath{nigbt}
+\pgf@circ@definetranspath{Lpigbt}
+\pgf@circ@definetranspath{Lnigbt}%%%---------- close: tex/pgfcircpath
+
+\ifpgf@circ@siunitx
+ \RequirePackage{xstring}[2009/03/13]
+ %\expandafter\let\csname angstrom\endcsname\relax
+ \RequirePackage{siunitx}
+\fi
+
+
+
+\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
+%override (unused) circuitikz environment for compability to externalization)
+\let\circuitikz\tikzpicture
+\let\endcircuitikz\endtikzpicture
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.7.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.7.sty
new file mode 100644
index 00000000000..3b0a448ef0a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.7.sty
@@ -0,0 +1,10682 @@
+% Copyright 2007-2016 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+
+%%%%%
+%%%%%
+%%%%%
+%%%%% Se c'è l'opzione symbol, fallback to siunitx with warning
+%%%%%
+%%%%%
+
+\NeedsTeXFormat{LaTeX2e}
+
+\def\pgfcircversion{0.7}
+\def\pgfcircversiondate{2016/09/08}
+
+\ProvidesPackage{circuitikz-0.7}
+ [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
+
+%% Version 2.0 of pgf/TikZ is required
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\usepgflibrary{arrows}
+
+
+% The options are listed in the manual in this order
+
+\DeclareOption{europeanvoltage}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{straightvoltages}{
+ \pgf@circuit@bipole@voltage@straighttrue
+}
+
+\DeclareOption{americanvoltage}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrent}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrent}{
+ \ctikzset{current = american}
+}
+
+
+
+\DeclareOption{americanresistor}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistor}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductor}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductor}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductor}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanport}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{european}{
+ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
+ \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester = european}
+}
+
+\DeclareOption{american}{
+ \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester = american}
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{fulldiodes}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiodes}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{europeanvoltages}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{americanvoltages}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrents}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrents}{
+ \ctikzset{current = american}
+}
+
+\DeclareOption{americanresistors}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistors}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductors}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductors}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductors}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanports}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanports}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{americangfsurgearrester}{
+ \ctikzset{gas filled surge arrester = american}
+}
+
+\DeclareOption{europeangfsurgearrester}{
+ \ctikzset{gas filled surge arrester = european}
+}
+
+\DeclareOption{siunitx}{
+ \pgf@circ@siunitxtrue
+}
+
+\DeclareOption{nosiunitx}{
+ \pgf@circ@siunitxfalse
+}
+
+\DeclareOption{fulldiode}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiode}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{strokediode}{
+ \ctikzset{diode = stroke}
+}
+
+\DeclareOption{arrowmos}{
+ \pgf@circuit@mos@arrowstrue
+}
+
+\DeclareOption{noarrowmos}{
+ \pgf@circuit@mos@arrowsfalse
+}
+
+\DeclareOption{fetbodydiode}{
+ \pgf@circuit@fet@bodydiodetrue
+}
+
+\DeclareOption{nofetbodydiode}{
+ \pgf@circuit@fet@bodydiodefalse
+}
+
+\DeclareOption{fetsolderdot}{
+ \pgf@circuit@fet@solderdottrue
+}
+
+\DeclareOption{nofetsolderdot}{
+ \pgf@circuit@fet@solderdotfalse
+}
+
+\DeclareOption{emptypmoscircle}{
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+
+\DeclareOption{lazymos}{
+ \ctikzset{tripoles/nmos/width=.5}
+ \ctikzset{tripoles/nmos/gate height=.35}
+ \ctikzset{tripoles/nmos/base height=.35}
+ \ctikzset{tripoles/nmos/height/.initial=1.2}
+ \ctikzset{tripoles/nmos/base width=.5}
+ \ctikzset{tripoles/nmos/gate width=.65}
+
+ \ctikzset{tripoles/pmos/width=.5}
+ \ctikzset{tripoles/pmos/gate height=.35}
+ \ctikzset{tripoles/pmos/base height=.35}
+ \ctikzset{tripoles/pmos/height/.initial=1.2}
+ \ctikzset{tripoles/pmos/base width=.5}
+ \ctikzset{tripoles/pmos/gate width=.65}
+
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+\DeclareOption{straightlabels}{
+ \ctikzset{label/align = straight}
+}
+
+\DeclareOption{rotatelabels}{
+ \ctikzset{label/align = rotate}
+}
+
+\DeclareOption{smartlabels}{
+ \ctikzset{label/align = smart}
+}
+
+\DeclareOption{compatibility}{
+ \pgf@circuit@compattrue
+}
+
+\DeclareOption{oldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectiontrue
+}
+\DeclareOption{nooldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectionfalse
+}
+
+\DeclareOption{betterproportions}{
+ \ctikzset{monopoles/ground/width/.initial=.15}
+
+ \ctikzset{bipoles/resistor/height/.initial=.23}
+ \ctikzset{bipoles/resistor/width/.initial=.6}
+ \ctikzset{bipoles/capacitor/height/.initial=.4}
+ \ctikzset{bipoles/capacitor/width/.initial=.1}
+ \ctikzset{bipoles/potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
+ \ctikzset{bipoles/photoresistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistor/main/.initial=.7}
+ \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
+ \ctikzset{bipoles/thermistorptc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorptc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/main/.initial=.7}
+ \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/width/.initial=.6}
+ \ctikzset{bipoles/vresistor/height/.initial=.45}
+ \ctikzset{bipoles/vresistor/width/.initial=.6}
+ \ctikzset{bipoles/generic/height/.initial=.23}
+ \ctikzset{bipoles/generic/width/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/ageneric/height/.initial=.23}
+ \ctikzset{bipoles/ageneric/width/.initial=.6}
+ \ctikzset{bipoles/memristor/height/.initial=.23}
+ \ctikzset{bipoles/memristor/wave height/.initial=.375}
+ \ctikzset{bipoles/memristor/width/.initial=.60}
+ \ctikzset{bipoles/tgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tgeneric/width/.initial=.6}
+ \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
+ \ctikzset{bipoles/fullgeneric/height/.initial=.23}
+ \ctikzset{bipoles/fullgeneric/width/.initial=.6}
+ \ctikzset{bipoles/diode/height/.initial=.3}
+ \ctikzset{bipoles/diode/width/.initial=.25}
+
+ \ctikzset{tripoles/thyristor/height/.initial=.66}
+ \ctikzset{tripoles/thyristor/height 2/.initial=.3}
+ \ctikzset{tripoles/thyristor/width/.initial=.6}
+ \ctikzset{tripoles/thyristor/diode height/.initial=.3}
+ \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+ \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+ \ctikzset{tripoles/triac/height/.initial=.66}
+ \ctikzset{tripoles/triac/width/.initial=.6}
+ \ctikzset{tripoles/triac/diode width left/.initial=.3}
+ \ctikzset{tripoles/triac/diode width right/.initial=.3}
+}
+
+%%%%%%%%%
+%%%%%%%%%%% Springe nach tex/pgfcirc.defines
+%%%---------- open: tex/pgfcirc.defines.tex
+
+%% Options
+
+%%%%%%%%%%%%
+%% Dimensions
+
+% coordinates
+\newdimen\pgf@circ@res@up
+\newdimen\pgf@circ@res@down
+\newdimen\pgf@circ@res@zero
+\newdimen\pgf@circ@res@left
+\newdimen\pgf@circ@res@right
+\newdimen\pgf@circ@res@other
+\newdimen\pgf@circ@res@step
+\newdimen\pgf@circ@res@temp
+% inital thickness
+\newdimen \pgfstartlinewidth
+%% Keys
+
+\long\def\pgf@circ@comment#1{}
+
+\def\circuitikzbasekey{/tikz/circuitikz}
+
+\pgfkeys{\circuitikzbasekey/.is family}
+
+\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
+\let\ctikzset\circuitikzset
+\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
+\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circuit@compat
+\newif\ifpgf@circ@oldvoltagedirection
+
+% Option ">" for twoports
+\newif\ifpgf@circuit@inputarrow
+\ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/.is choice}
+\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
+
+% Option "boxed" for nodes and twoports
+\newif\ifpgf@circuit@boxed
+\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
+
+% Option "dashed" for nodes and twoports
+\newif\ifpgf@circuit@dashed
+\pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
+\ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
+
+% Option "t=*" for nodes
+\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
+
+
+
+\ctikzset{bipoles/.is family}
+\ctikzset{bipoles/border margin/.initial=1.1}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{bipoles/length/.initial=1.4cm}
+\ctikzset{nodes width/.initial=.04}
+\newdimen\pgf@circ@Rlen
+\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}}
+
+\ctikzset{monopoles/.is family}
+\ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/tground/thickness/.initial=3}
+\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/match/width/.initial=.4}
+\ctikzset{monopoles/chassis/width/.initial=.25}
+\ctikzset{monopoles/alternative chassis/width/.initial=.25}
+\ctikzset{monopoles/equipotentiality/width/.initial=.25}
+\ctikzset{monopoles/tlinestub/width/.initial=.25}
+\ctikzset{monopoles/antenna/width/.initial=.25}
+\ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/width/.initial=.25}
+\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/rxantenna/width/.initial=.25}
+
+\ctikzset{bipoles/resistor/height/.initial=.3}
+\ctikzset{bipoles/resistor/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/height/.initial=.8}
+\ctikzset{bipoles/potentiometer/height 2/.initial=.3}
+\ctikzset{bipoles/potentiometer/width/.initial=.8}
+\ctikzset{bipoles/photoresistor/height/.initial=.6}
+\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
+\ctikzset{bipoles/photoresistor/width/.initial=.8}
+\ctikzset{bipoles/thermistor/main/.initial=.7}
+\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/width/.initial=.8}
+\ctikzset{bipoles/thermistorntc/main/.initial=.7}
+\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistorptc/width/.initial=.8}
+\ctikzset{bipoles/thermistorptc/main/.initial=.7}
+\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistor/width/.initial=.8}
+\ctikzset{bipoles/varistor/main/.initial=.7}
+\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/varistor/width/.initial=.8}
+\ctikzset{bipoles/vresistor/height/.initial=.6}
+\ctikzset{bipoles/vresistor/width/.initial=.8}
+\ctikzset{bipoles/cuteinductor/height/.initial=.3}
+\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
+\ctikzset{bipoles/cuteinductor/width/.initial=.6}
+\ctikzset{bipoles/cuteinductor/coils/.initial=5}
+\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/americaninductor/height/.initial=.3}
+\ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+\ctikzset{bipoles/americaninductor/width/.initial=.8}
+\ctikzset{bipoles/americaninductor/coils/.initial=4}
+\ctikzset{bipoles/americaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
+\ctikzset{bipoles/vcuteinductor/width/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/coils/.initial=5}
+\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/vamericaninductor/height/.initial=.6}
+\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+\ctikzset{bipoles/vamericaninductor/width/.initial=.8}
+\ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/esource/height/.initial=.60}
+\ctikzset{bipoles/esource/width/.initial=.60}
+\ctikzset{bipoles/pvsource/height/.initial=.60}
+\ctikzset{bipoles/pvsource/width/.initial=.60}
+\ctikzset{bipoles/isource/height/.initial=.60}
+\ctikzset{bipoles/isource/width/.initial=.60}
+\ctikzset{bipoles/oosource/height/.initial=.60}
+\ctikzset{bipoles/oosource/width/.initial=.60}
+\ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/dcisource/height/.initial=.60}
+\ctikzset{bipoles/dcisource/width/.initial=.60}
+\ctikzset{bipoles/dcvsource/height/.initial=.60}
+\ctikzset{bipoles/dcvsource/width/.initial=.60}
+\ctikzset{bipoles/vsourcetri/height/.initial=.60}
+\ctikzset{bipoles/vsourcetri/width/.initial=.60}
+\ctikzset{bipoles/isourceam/height/.initial=.60}
+\ctikzset{bipoles/isourceam/width/.initial=.60}
+\ctikzset{bipoles/vsource/height/.initial=.60}
+\ctikzset{bipoles/vsource/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/height/.initial=.60}
+\ctikzset{bipoles/vsourceam/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/margin/.initial=.7}
+\ctikzset{bipoles/isourcesin/height/.initial=.60}
+\ctikzset{bipoles/isourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesin/height/.initial=.60}
+\ctikzset{bipoles/vsourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/height/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/width/.initial=.60}
+\ctikzset{bipoles/cisource/height/.initial=.7}
+\ctikzset{bipoles/cisource/width/.initial=.7}
+\ctikzset{bipoles/cisourceam/height/.initial=.7}
+\ctikzset{bipoles/cisourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsource/height/.initial=.7}
+\ctikzset{bipoles/cvsource/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/height/.initial=.7}
+\ctikzset{bipoles/cvsourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/margin/.initial=.7}
+\ctikzset{bipoles/cvsourceam/text scale/.initial=1}
+\ctikzset{bipoles/cisourcesin/width/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/height/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/width/.initial=.7}
+\ctikzset{bipoles/capacitor/height/.initial=.6}
+\ctikzset{bipoles/capacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/height/.initial=.5}
+\ctikzset{bipoles/ecapacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath}
+\ctikzset{bipoles/pcapacitor/height/.initial=.6}
+\ctikzset{bipoles/pcapacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/vcapacitor/height/.initial=.6}
+\ctikzset{bipoles/vcapacitor/width/.initial=.5}
+\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/piezoelectric/height/.initial=.7}
+\ctikzset{bipoles/piezoelectric/width/.initial=.5}
+\ctikzset{bipoles/battery/height/.initial=.6}
+\ctikzset{bipoles/battery/width/.initial=.3}
+\ctikzset{bipoles/battery1/height/.initial=.6}
+\ctikzset{bipoles/battery1/width/.initial=.3}
+\ctikzset{bipoles/diode/height/.initial=.50}
+\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/varcap/height/.initial=.50}
+\ctikzset{bipoles/varcap/width/.initial=.45}
+\ctikzset{bipoles/interr/height/.initial=.35}
+\ctikzset{bipoles/interr/width/.initial=.35}
+\ctikzset{bipoles/interr/height 2/.initial=.1}
+\ctikzset{bipoles/generic/height/.initial=.30}
+\ctikzset{bipoles/generic/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
+\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
+\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
+\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
+\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
+\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
+\ctikzset{bipoles/fuse/height/.initial=.20}
+\ctikzset{bipoles/fuse/width/.initial=.50}
+\ctikzset{bipoles/afuse/height/.initial=.20}
+\ctikzset{bipoles/afuse/width/.initial=.50}
+\ctikzset{bipoles/generic potentiometer/height/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
+\ctikzset{bipoles/generic potentiometer/width/.initial=.80}
+\ctikzset{bipoles/ageneric/height/.initial=.30}
+\ctikzset{bipoles/ageneric/width/.initial=.80}
+\ctikzset{bipoles/memristor/height/.initial=.30}
+\ctikzset{bipoles/memristor/wave height/.initial=.5}
+\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/tgeneric/height/.initial=.70}
+\ctikzset{bipoles/tgeneric/width/.initial=.80}
+\ctikzset{bipoles/tfullgeneric/height/.initial=.70}
+\ctikzset{bipoles/tfullgeneric/width/.initial=.80}
+\ctikzset{bipoles/fullgeneric/height/.initial=.30}
+\ctikzset{bipoles/fullgeneric/width/.initial=.80}
+\ctikzset{bipoles/open/height/.initial=.25}
+\ctikzset{bipoles/open/width/.initial=.8}
+\ctikzset{bipoles/ammeter/height/.initial=.60}
+\ctikzset{bipoles/ammeter/width/.initial=.60}
+\ctikzset{bipoles/ohmmeter/height/.initial=.60}
+\ctikzset{bipoles/ohmmeter/width/.initial=.60}
+\ctikzset{bipoles/voltmeter/height/.initial=.60}
+\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/buffer/height/.initial=1}
+\ctikzset{bipoles/buffer/width/.initial=1}
+\ctikzset{bipoles/not port/width/.initial=1}
+\ctikzset{bipoles/not port/height/.initial=.8}
+\ctikzset{bipoles/not port/circle width/.initial=.15}
+\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/tline/height/.initial=.3}
+\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/squid/height/.initial=.60}
+\ctikzset{bipoles/squid/width/.initial=.60}
+\ctikzset{bipoles/barrier/height/.initial=.60}
+\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/thermocouple/height/.initial=.250}
+\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
+\ctikzset{bipoles/thermocouple/width/.initial=.140}
+\ctikzset{bipoles/pushbutton/height/.initial=.5}
+\ctikzset{bipoles/pushbutton/height 2/.initial=.0}
+\ctikzset{bipoles/pushbutton/width/.initial=.50}
+
+\ctikzset{bipoles/twoport/width/.initial=.7}
+\ctikzset{bipoles/twoport/height/.initial=.7}
+\ctikzset{bipoles/twoport/text/.initial=}
+\ctikzset{bipoles/vco/width/.initial=.7}
+\ctikzset{bipoles/bandpass/width/.initial=.7}
+\ctikzset{bipoles/highpass/width/.initial=.7}
+\ctikzset{bipoles/lowpass/width/.initial=.7}
+\ctikzset{bipoles/adc/width/.initial=.7}
+\ctikzset{bipoles/dac/width/.initial=.7}
+\ctikzset{bipoles/dsp/width/.initial=.7}
+\ctikzset{bipoles/fft/width/.initial=.7}
+\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/vamp/width/.initial=.7}
+\ctikzset{bipoles/piattenuator/width/.initial=.7}
+\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
+\ctikzset{bipoles/tattenuator/width/.initial=.7}
+\ctikzset{bipoles/vtattenuator/width/.initial=.7}
+\ctikzset{bipoles/phaseshifter/width/.initial=.7}
+\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
+\ctikzset{bipoles/detector/width/.initial=.7}
+
+
+\newif\ifpgf@circuit@trans@depletiontype
+\pgf@circuit@trans@depletiontypefalse
+
+\newif\ifpgf@circuit@mos@arrows
+\ctikzset{tripoles/mos style/.is choice}
+\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
+\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
+
+% Option solderdot for fet
+\newif\ifpgf@circuit@fet@solderdot
+\pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+\ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+
+% Option bodydiode for fet
+\newif\ifpgf@circuit@fet@bodydiode
+\pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+\ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+
+% Option draw fet without gate connection
+\newif\ifpgf@circuit@bpt@drawgate
+\pgf@circuit@bpt@drawgatetrue
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+
+% Option draw bpt without base connection
+\newif\ifpgf@circuit@bpt@drawbase
+\pgf@circuit@bpt@drawbasetrue
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+
+% Option draw bpt with optical input
+\newif\ifpgf@circuit@bpt@drawphoto
+\pgf@circuit@bpt@drawphotofalse
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+
+% Option draw pmos with empty circle
+\newif\ifpgf@circuit@pmos@emptycircle
+\newif\ifpgf@circuit@pmos@emptycircle
+\pgf@circuit@pmos@emptycirclefalse
+\pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+\ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+
+
+\newif\ifpgf@circuit@trans@ntype
+\pgf@circuit@trans@ntypetrue %default true
+%\newif\ifpgf@circuit@trans@ptype
+%\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
+\ctikzset{tripoles/nmos/width/.initial=.7}
+\ctikzset{tripoles/nmos/gate height/.initial=.35}
+\ctikzset{tripoles/nmos/base height/.initial=.5}
+\ctikzset{tripoles/nmos/conn height/.initial=0}
+\ctikzset{tripoles/nmos/height/.initial=1.1}
+\ctikzset{tripoles/nmos/base width/.initial=.5}
+\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nmos/curr direction/.initial=1}
+
+\ctikzset{tripoles/pmos/width/.initial=.7}
+\ctikzset{tripoles/pmos/gate height/.initial=.35}
+\ctikzset{tripoles/pmos/base height/.initial=.5}
+\ctikzset{tripoles/pmos/conn height/.initial=0}
+\ctikzset{tripoles/pmos/height/.initial=1.1}
+\ctikzset{tripoles/pmos/base width/.initial=.5}
+\ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pmos/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nfet/width/.initial=.7}
+\ctikzset{tripoles/nfet/gate height/.initial=.35}
+\ctikzset{tripoles/nfet/base height/.initial=.5}
+\ctikzset{tripoles/nfet/conn height/.initial=0}
+\ctikzset{tripoles/nfet/height/.initial=1.1}
+\ctikzset{tripoles/nfet/base width/.initial=.5}
+\ctikzset{tripoles/nfet/gate width/.initial=.62}
+\ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pfet/width/.initial=.7}
+\ctikzset{tripoles/pfet/gate height/.initial=.35}
+\ctikzset{tripoles/pfet/base height/.initial=.5}
+\ctikzset{tripoles/pfet/conn height/.initial=0}
+\ctikzset{tripoles/pfet/height/.initial=1.1}
+\ctikzset{tripoles/pfet/base width/.initial=.5}
+\ctikzset{tripoles/pfet/gate width/.initial=.62}
+\ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigfete/width/.initial=.7}
+\ctikzset{tripoles/nigfete/gate height/.initial=.35}
+\ctikzset{tripoles/nigfete/base height/.initial=.5}
+\ctikzset{tripoles/nigfete/conn height/.initial=.35}
+\ctikzset{tripoles/nigfete/height/.initial=1.1}
+\ctikzset{tripoles/nigfete/base width/.initial=.5}
+\ctikzset{tripoles/nigfete/gate width/.initial=.62}
+\ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfete/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetd/width/.initial=.7}
+\ctikzset{tripoles/nigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetd/base height/.initial=.5}
+\ctikzset{tripoles/nigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetd/height/.initial=1.1}
+\ctikzset{tripoles/nigfetd/base width/.initial=.5}
+\ctikzset{tripoles/nigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetd/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfete/width/.initial=.7}
+\ctikzset{tripoles/pigfete/gate height/.initial=.35}
+\ctikzset{tripoles/pigfete/base height/.initial=.5}
+\ctikzset{tripoles/pigfete/conn height/.initial=.35}
+\ctikzset{tripoles/pigfete/height/.initial=1.1}
+\ctikzset{tripoles/pigfete/base width/.initial=.5}
+\ctikzset{tripoles/pigfete/gate width/.initial=.62}
+\ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfete/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetd/width/.initial=.7}
+\ctikzset{tripoles/pigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetd/base height/.initial=.5}
+\ctikzset{tripoles/pigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetd/height/.initial=1.1}
+\ctikzset{tripoles/pigfetd/base width/.initial=.5}
+\ctikzset{tripoles/pigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
+
+\ctikzset{tripoles/npn/width/.initial=.6}
+\ctikzset{tripoles/npn/base height/.initial=.45}
+\ctikzset{tripoles/npn/base height 2/.initial=.15}
+\ctikzset{tripoles/npn/base height/.initial=.4}
+\ctikzset{tripoles/npn/conn height/.initial=0}
+\ctikzset{tripoles/npn/height/.initial=1.1}
+\ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/npn/curr direction/.initial=1}
+
+\ctikzset{tripoles/pnp/width/.initial=.6}
+\ctikzset{tripoles/pnp/base height/.initial=.45}
+\ctikzset{tripoles/pnp/base height 2/.initial=.15}
+\ctikzset{tripoles/pnp/base height/.initial=.4}
+\ctikzset{tripoles/pnp/conn height/.initial=0}
+\ctikzset{tripoles/pnp/height/.initial=1.1}
+\ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pnp/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigbt/width/.initial=.6}
+\ctikzset{tripoles/pigbt/gate height/.initial=.45}
+\ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/pigbt/base height/.initial=.4}
+\ctikzset{tripoles/pigbt/conn height/.initial=0}
+\ctikzset{tripoles/pigbt/height/.initial=1.1}
+\ctikzset{tripoles/pigbt/gate width/.initial=.62}
+\ctikzset{tripoles/pigbt/base width/.initial=.5}
+\ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigbt/width/.initial=.6}
+\ctikzset{tripoles/nigbt/gate height/.initial=.45}
+\ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/nigbt/base height/.initial=.4}
+\ctikzset{tripoles/nigbt/conn height/.initial=0}
+\ctikzset{tripoles/nigbt/height/.initial=1.1}
+\ctikzset{tripoles/nigbt/gate width/.initial=.62}
+\ctikzset{tripoles/nigbt/base width/.initial=.5}
+\ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/Lpigbt/width/.initial=.6}
+\ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lpigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lpigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/Lnigbt/width/.initial=.6}
+\ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lnigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lnigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/njfet/width/.initial=.7}
+\ctikzset{tripoles/njfet/gate height/.initial=.5}
+\ctikzset{tripoles/njfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/njfet/gate width/.initial=.5}
+\ctikzset{tripoles/njfet/conn height/.initial=.35}
+\ctikzset{tripoles/njfet/height/.initial=1.1}
+\ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/njfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pjfet/width/.initial=.7}
+\ctikzset{tripoles/pjfet/gate height/.initial=.5}
+\ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/pjfet/gate width/.initial=.5}
+\ctikzset{tripoles/pjfet/conn height/.initial=.35}
+\ctikzset{tripoles/pjfet/height/.initial=1.1}
+\ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pjfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/isfet/width/.initial=1}
+\ctikzset{tripoles/isfet/gate height/.initial=.35}
+\ctikzset{tripoles/isfet/base height/.initial=.5}
+\ctikzset{tripoles/isfet/height/.initial=1.1}
+\ctikzset{tripoles/isfet/base width/.initial=.3}
+\ctikzset{tripoles/isfet/gate width/.initial=.5}
+\ctikzset{tripoles/isfet/conn height/.initial=0}
+\ctikzset{tripoles/isfet/wave width/.initial=.16}
+\ctikzset{tripoles/isfet/wave amp/.initial=.06}
+\ctikzset{tripoles/isfet/waves y sep/.initial=.22}
+\ctikzset{tripoles/isfet/waves x sep/.initial=.8}
+\ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/isfet/curr direction/.initial=1}
+
+\newif\ifpgf@circuit@europeanlogicport
+\ctikzset{logic ports/.is choice}
+\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue } }
+\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse } }
+
+
+\ctikzset{tripoles/american and port/width/.initial=1.1}
+\ctikzset{tripoles/american and port/height/.initial=.8}
+\ctikzset{tripoles/american and port/port width/.initial=.7}
+\ctikzset{tripoles/american and port/input height/.initial=.5}
+\ctikzset{tripoles/american nand port/width/.initial=1.1}
+\ctikzset{tripoles/american nand port/height/.initial=.8}
+\ctikzset{tripoles/american nand port/port width/.initial=.7}
+\ctikzset{tripoles/american nand port/circle width/.initial=.15}
+\ctikzset{tripoles/american nand port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/width/.initial=1.1}
+\ctikzset{tripoles/american or port/height/.initial=.8}
+\ctikzset{tripoles/american or port/port width/.initial=.7}
+\ctikzset{tripoles/american or port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/input skip/.initial=.25}
+\ctikzset{tripoles/american or port/aaa/.initial=.6}
+\ctikzset{tripoles/american or port/bbb/.initial=.4}
+\ctikzset{tripoles/american or port/ccc/.initial=.5}
+\ctikzset{tripoles/american or port/ddd/.initial=.0}
+\ctikzset{tripoles/american nor port/width/.initial=1.1}
+\ctikzset{tripoles/american nor port/height/.initial=.8}
+\ctikzset{tripoles/american nor port/port width/.initial=.7}
+\ctikzset{tripoles/american nor port/input height/.initial=.5}
+\ctikzset{tripoles/american nor port/input skip/.initial=.25}
+\ctikzset{tripoles/american nor port/circle width/.initial=.15}
+\ctikzset{tripoles/american nor port/aaa/.initial=.6}
+\ctikzset{tripoles/american nor port/bbb/.initial=.4}
+\ctikzset{tripoles/american nor port/ccc/.initial=.5}
+\ctikzset{tripoles/american nor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xor port/width/.initial=1.1}
+\ctikzset{tripoles/american xor port/height/.initial=.8}
+\ctikzset{tripoles/american xor port/port width/.initial=.7}
+\ctikzset{tripoles/american xor port/input height/.initial=.5}
+\ctikzset{tripoles/american xor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xor port/distance/.initial=.1}
+\ctikzset{tripoles/american xor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/width/.initial=1.1}
+\ctikzset{tripoles/american xnor port/height/.initial=.8}
+\ctikzset{tripoles/american xnor port/port width/.initial=.7}
+\ctikzset{tripoles/american xnor port/input height/.initial=.5}
+\ctikzset{tripoles/american xnor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xnor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xnor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xnor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xnor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/european and port/width/.initial=1.4}
+\ctikzset{tripoles/european and port/height/.initial=.65}
+\ctikzset{tripoles/european and port/reserved/.initial=.6}
+\ctikzset{tripoles/european and port/input height/.initial=.6}
+\ctikzset{tripoles/european or port/width/.initial=1.4}
+\ctikzset{tripoles/european or port/height/.initial=.65}
+\ctikzset{tripoles/european or port/reserved/.initial=.6}
+\ctikzset{tripoles/european or port/input height/.initial=.6}
+\ctikzset{tripoles/european xor port/width/.initial=1.4}
+\ctikzset{tripoles/european xor port/height/.initial=.65}
+\ctikzset{tripoles/european xor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xor port/input height/.initial=.6}
+\ctikzset{tripoles/european nand port/width/.initial=1.4}
+\ctikzset{tripoles/european nand port/not height/.initial=.3}
+\ctikzset{tripoles/european nand port/not width/.initial=.8}
+\ctikzset{tripoles/european nand port/height/.initial=.65}
+\ctikzset{tripoles/european nand port/reserved/.initial=.6}
+\ctikzset{tripoles/european nand port/input height/.initial=.6}
+\ctikzset{tripoles/european not port/width/.initial=1.4}
+\ctikzset{tripoles/european not port/not height/.initial=.3}
+\ctikzset{tripoles/european not port/not width/.initial=.8}
+\ctikzset{tripoles/european not port/height/.initial=.65}
+\ctikzset{tripoles/european not port/reserved/.initial=.6}
+\ctikzset{tripoles/european not port/input height/.initial=0}
+\ctikzset{tripoles/european xnor port/width/.initial=1.4}
+\ctikzset{tripoles/european xnor port/not height/.initial=.3}
+\ctikzset{tripoles/european xnor port/not width/.initial=.8}
+\ctikzset{tripoles/european xnor port/height/.initial=.65}
+\ctikzset{tripoles/european xnor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xnor port/input height/.initial=.6}
+\ctikzset{tripoles/european nor port/width/.initial=1.4}
+\ctikzset{tripoles/european nor port/not height/.initial=.3}
+\ctikzset{tripoles/european nor port/not width/.initial=.8}
+\ctikzset{tripoles/european nor port/height/.initial=.65}
+\ctikzset{tripoles/european nor port/reserved/.initial=.6}
+\ctikzset{tripoles/european nor port/input height/.initial=.6}
+\ctikzset{tripoles/op amp/width/.initial=1.7}
+\ctikzset{tripoles/op amp/port width/.initial=.7}
+\ctikzset{tripoles/op amp/height/.initial=1.4}
+\ctikzset{tripoles/op amp/input height/.initial=.5}
+\ctikzset{tripoles/op amp/up pos/.initial=.45}
+\ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolut font size needed!
+\ctikzset{tripoles/gm amp/width/.initial=1.7}
+\ctikzset{tripoles/gm amp/port width/.initial=.7}
+\ctikzset{tripoles/gm amp/height/.initial=1.4}
+\ctikzset{tripoles/gm amp/input height/.initial=.5}
+\ctikzset{tripoles/gm amp/up pos/.initial=.45}
+\ctikzset{tripoles/plain amp/width/.initial=1.7}
+\ctikzset{tripoles/plain amp/port width/.initial=.7}
+\ctikzset{tripoles/plain amp/height/.initial=1.4}
+\ctikzset{tripoles/plain amp/input height/.initial=.5}
+\ctikzset{tripoles/plain amp/up pos/.initial=.45}
+
+\ctikzset{tripoles/thyristor/height/.initial=1.10}
+\ctikzset{tripoles/thyristor/height 2/.initial=.5}
+\ctikzset{tripoles/thyristor/width/.initial=1.0}
+\ctikzset{tripoles/thyristor/diode height/.initial=.5}
+\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+\ctikzset{tripoles/triac/height/.initial=1.1}
+\ctikzset{tripoles/triac/width/.initial=1}
+\ctikzset{tripoles/triac/diode width left/.initial=.3}
+\ctikzset{tripoles/triac/diode width right/.initial=.3}
+
+\ctikzset{tripoles/spdt/width/.initial=.85}
+\ctikzset{tripoles/spdt/height/.initial=.45}
+\ctikzset{tripoles/spdt/margin/.initial=.45}
+
+\ctikzset{tripoles/toggleswitch/height/.initial=.8}
+\ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
+\ctikzset{tripoles/toggleswitch/width/.initial=.80}
+
+\ctikzset{tripoles/mixer/width/.initial=0.7}
+\ctikzset{tripoles/adder/width/.initial=0.7}
+\ctikzset{tripoles/circulator/width/.initial=.7}
+\ctikzset{tripoles/oscillator/width/.initial=.7}
+
+
+\ctikzset{tripoles/wilkinson/height/.initial=1.3}
+\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+
+\ctikzset{quadpoles/transformer/width/.initial=1.5}
+\ctikzset{quadpoles/transformer/width1/.initial=.4}
+\ctikzset{quadpoles/transformer/height/.initial=1.5}
+\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/width/.initial=1.5}
+\ctikzset{quadpoles/transformer core/height/.initial=1.5}
+\ctikzset{quadpoles/transformer core/core height/.initial=.5}
+\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/width/.initial=1.5}
+\ctikzset{quadpoles/gyrator/height/.initial=1.5}
+\ctikzset{quadpoles/fourport/width/.initial=1.3}
+\ctikzset{quadpoles/fourport/height/.initial=1.3}
+\ctikzset{quadpoles/coupler/width/.initial=1.3}
+\ctikzset{quadpoles/coupler/height/.initial=1.3}
+\ctikzset{quadpoles/coupler2/width/.initial=1.3}
+\ctikzset{quadpoles/coupler2/height/.initial=1.3}
+
+\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
+
+
+% %Mechanical section
+\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
+\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
+\ctikzset{bipoles/spring/height/.initial=.5}
+\ctikzset{bipoles/spring/width/.initial=.5}
+\ctikzset{bipoles/mass/height/.initial=.55}
+\ctikzset{bipoles/mass/box height/.initial=.4}
+\ctikzset{bipoles/mass/width/.initial=.5}
+
+\ctikzset{bipoles/damper/height/.initial=.35}
+\ctikzset{bipoles/damper/length/.initial=.3}
+\ctikzset{bipoles/damper/width/.initial=.4}
+
+
+\ctikzset{bipole/.is family}
+\ctikzset{bipole/kind/.initial = }
+\ctikzset{bipole/name/.initial = }
+\newif\ifpgf@circuit@bipole@isvoltage
+\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
+\newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
+\ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
+\newif\ifpgf@circuit@bipole@strokedsymbol
+\ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
+\newif\ifpgf@circuit@bipole@iscurrent
+\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
+
+\ctikzset{bipole/voltage/.is family}
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+\newif\ifpgf@circuit@bipole@voltage@below
+\ctikzset{bipole/voltage/position/.is choice}
+\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
+\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
+
+\ctikzset{bipole/voltage/label/unit/.initial=}
+\ctikzset{bipole/voltage/label/name/.initial=}
+
+\ctikzset{bipole/current/.is family}
+\newif\ifpgf@circuit@bipole@current@backward
+\ctikzset{bipole/current/direction/.is choice}
+\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
+\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
+\newif\ifpgf@circuit@bipole@current@before
+\ctikzset{bipole/current/x position/.is choice}
+\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
+\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
+\newif\ifpgf@circuit@bipole@current@below
+\ctikzset{bipole/current/y position/.is choice}
+\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
+\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
+
+\ctikzset{bipole/current/label/unit/.initial=}
+\ctikzset{bipole/current/label/name/.initial=}
+
+\ctikzset{bipole/label/.is family}
+\ctikzset{bipole/label/position/.initial=90}
+\ctikzset{bipole/label/unit/.initial=}
+\ctikzset{bipole/label/name/.initial=}
+\ctikzset{bipole/annotation/.is family}
+\ctikzset{bipole/annotation/position/.initial=-90}
+\ctikzset{bipole/annotation/unit/.initial=}
+\ctikzset{bipole/annotation/name/.initial=}
+\ctikzset{bipole/nodes/.is family}
+\ctikzset{bipole/nodes/left/.is choice}
+\ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}}
+\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}}
+\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}}
+\ctikzset{bipole/nodes/left/diamond/.code={\ctikzsetvalof{bipole/nodes/left}{diamond}}}
+\ctikzset{bipole/nodes/right/.is choice}
+\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}}
+\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}}
+\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}}
+\ctikzset{bipole/nodes/right/diamond/.code={\ctikzsetvalof{bipole/nodes/right}{diamond}}}
+
+
+
+
+\newif\ifpgf@circuit@europeanresistor
+\ctikzset{resistor/.is choice}
+\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
+\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
+
+\ctikzset{inductor/.is choice}
+\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
+\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
+\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+
+\newif\ifpgf@circuit@strokediode
+\newif\ifpgf@circuit@fulldiode
+\pgf@circuit@strokediodefalse
+\pgf@circuit@fulldiodefalse
+
+\ctikzset{diode/.is choice}
+\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
+\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
+\ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
+
+\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full }}
+\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty }}
+\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke }}
+
+\ctikzset{thickness/.initial=2}
+\ctikzset{color/.initial=black}
+\pgfkeys{/tikz/color/.add code={}{\ctikzset{color=#1}}}
+
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circ@siunitx@res
+
+\ctikzset{straight/.is choice}
+\ctikzset{straightvoltage value/.initial=true}
+\ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
+\ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
+\ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
+\newif\ifpgf@circuit@bipole@voltage@straight
+\ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
+
+
+\ctikzset{voltage/.is family}
+\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
+\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
+\ctikzset{voltage/bump a/.initial=1.2}
+\ctikzset{voltage/bump b/.initial=1.5}
+\ctikzset{voltage/european label distance/.initial=1.4}
+\ctikzset{voltage/american label distance/.initial=1.1}
+% special cases
+\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
+\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
+\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
+\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
+\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
+%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
+%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
+
+\ctikzset{current/.is family}
+\ctikzset{current/distance/.initial = .5}
+
+\tikzset{american currents/.style = { \circuitikzbasekey/current = american } }
+\tikzset{european currents/.style = { \circuitikzbasekey/current = european } }
+\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } }
+\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } }
+\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } }
+\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } }
+
+\newif\ifpgf@circuit@europeangfsurgearrester
+\ctikzset{gas filled surge arrester/.is choice}
+\ctikzset{gas filled surge arrester/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } }
+\ctikzset{gas filled surge arrester/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } }
+
+\tikzset{american gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = american } }
+\tikzset{european gas filled surge arrester/.style = { \circuitikzbasekey/gas filled surge arrester = european } }
+\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } }
+\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } }
+\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } }
+\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } }
+\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } }
+\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester } }
+\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester } }
+\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } }
+
+% I should try to make the tree clearer (this voltaege conflicts with the options above)
+
+\newif\ifpgf@circuit@europeanvoltage
+\ctikzset{voltage/.is choice}
+\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } }
+\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } }
+
+\newif\ifpgf@circuit@europeancurrent
+\ctikzset{current/.is choice}
+\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse }
+\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue }
+
+\ctikzset{label/align/.is choice}
+\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
+\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
+\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+
+%%%%%%%%%% new
+\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+%%%---------- close: tex/pgfcirc.defines
+%%%%%%%%%%% Springe nach tex/pgfcircutils
+%%%---------- open: tex/pgfcircutils.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%\def\pgf@circ@handleSI#1{%
+ % \pgf@circ@siunitx@resfalse
+%
+ % \edef\len{\stringlength[e]{#1}}
+ %\testmatchingchar[e]{#1}{\len}{>}%
+ %\ifmatchingchar%
+ % \ifnum\findchars{#1}{<}=0
+ % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
+ %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
+ %\pgf@circ@siunitx@restrue
+% \else
+% \fi
+ %\else
+ %\fi
+%}
+
+\def\pgf@circ@handleSI#1{
+ \noexpandarg
+ \def\pgf@temp{}
+ \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
+ \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
+
+ \ifnum\pgf@circ@handleSI@unit@len=0
+ \pgf@circ@siunitx@resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf@circ@siunitx@restrue
+ \noexpandarg
+ \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
+ %\typeout{si |#1|}
+ }{
+ \pgf@circ@siunitx@resfalse
+ %\typeout{no si |#1|}
+ }
+ \fi
+}
+
+\def\pgf@circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf@circ@temp}
+ \edef\pgf@temp{}
+ }
+ \ifx\pgf@circ@temp\pgf@temp
+}
+
+%%%---------- close: tex/pgfcircutils
+%%%%%%%%%%% Springe nach tex/pgfcircmath
+%%%---------- open: tex/pgfcircmath.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Math routines
+
+\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
+
+% angle between 0 and 360
+\def\pgf@circ@slope#1#2{%
+ \pgf@process{#1}%
+ \pgf@xa=\pgf@x%
+ \pgf@ya=\pgf@y%
+ \pgf@process{#2}%
+ \advance\pgf@x by-\pgf@xa%
+ \advance\pgf@y by-\pgf@ya%
+ \ifdim\pgf@x<0.1pt
+ \ifdim\pgf@x>-0.1pt % vertical
+ \ifdim\pgf@y<0pt
+ \def\pgfmathresult{-90.0}
+ \else
+ \def\pgfmathresult{+90.0}
+ \fi
+ \else % oblique with dx < 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0pt
+ \pgfmathsubtract{\pgfmathresult}{+180}
+ \fi
+ \fi
+ \else % oblique with dx > 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0pt
+ \pgfmathsubtract{\pgfmathresult}{+180}
+ \fi
+ \fi
+ \pgf@x=\pgfmathresult pt
+ \ifdim\pgf@x<0pt
+ \pgfmathadd{\pgfmathresult}{+360}
+ \fi
+ }
+
+
+%%%---------- close: tex/pgfcircmath
+
+%%%%%%%%%%% Springe nach tex/pgfcircshapes
+%%%---------- open: tex/pgfcircshapes.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Other shapes
+
+
+%% Nothing
+
+\pgfdeclareshape{emptyshape}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \northeast
+ \pgf@y=-\pgf@y
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \northeast
+ \pgf@y=0cm
+ \pgf@x=-\pgf@x
+ }
+ \anchor{text}{%
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+}
+
+%% Full terminal
+
+\pgfdeclareshape{circ}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}}
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Empty terminal
+
+\pgfdeclareshape{ocirc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}}
+ }
+
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Diamond terminal
+
+\pgfdeclareshape{diamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@temp}{\pgf@circ@res@up+\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up-\pgf@circ@res@temp}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% Current arrow
+
+\pgfdeclareshape{currarrow}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+
+ \endpgfscope
+ }
+
+}
+
+%% Current arrow
+
+\pgfdeclareshape{inputarrow}{
+ \savedanchor{\tip}{
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \tip
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{fill}
+
+ \endpgfscope
+ }
+
+}
+
+
+%% box
+
+\pgfdeclareshape{box}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+
+}
+
+%%%---------- close: tex/pgfcircshapes
+%%%%%%%%%%% Springe nach tex/pgfcircmonopoles
+%%%---------- open: tex/pgfcircmonopoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Monopoles
+
+%% Ground symbol
+
+\pgfdeclareshape{ground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+
+
+\pgfdeclareshape{rground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{tground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ %\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{sground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+% noiseless ground
+\pgfdeclareshape{nground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{1.3\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpatharc{0}{180}{1.3\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% protective ground
+\pgfdeclareshape{pground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathcircle{\pgfpoint{0pt}{-\pgf@circ@res@step}} {1.2\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% chassis ground
+\pgfdeclareshape{cground}{
+\anchor{center}{
+ \pgfpointorigin
+}
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/chassis/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Contributed by Leonardo Azzinnari
+\pgfdeclareshape{tlinestub}{
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+
+
+\pgfdeclareshape{antenna}{
+\anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+
+ % \pgfpathmoveto{\pgfpointorigin}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ % \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgftransformxshift{ -4\pgf@circ@res@step }
+
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{txantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{rxantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Vcc
+\pgfdeclareshape{vcc}{
+\anchor{center}{\pgfpointorigin}
+\anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=2\pgf@circ@res@step
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+}
+
+}
+
+% Vee
+\pgfdeclareshape{vee}{
+\anchor{center}{\pgfpointorigin}
+\anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=-2\pgf@circ@res@step
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+}
+
+}
+
+
+% match
+\pgfdeclareshape{match}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+ \pgf@x=1.5\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \pgf@y=-1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
+ \pgfusepath{fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+
+%%%---------- close: tex/pgfcircmonopoles
+%%%%%%%%%%% Springe nach tex/pgfcircbipoles
+%%%---------- open: tex/pgfcircbipoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%% Generic macro for defining a bipole shape
+% #1 - additional anchors
+% #2 - lower y-size of the bipole (from the center).
+% #3 - #shape is the name of the shape
+% #4 - upper y-size of the bipole (from the center)
+% #5 - width of the bipole
+% #6 - macros drawing the bipole
+
+
+\long\def\pgfcircdeclarebipole#1#2#3#4#5#6{
+ \pgfdeclareshape{#3shape}{
+
+ \savedanchor{\northeast}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\northeastborder}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwestborder}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwest}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\centerpoint}{
+ \pgf@circ@res@down=-#2\pgf@circ@Rlen
+ \pgf@circ@res@up=#4\pgf@circ@Rlen
+ \pgfpointorigin
+ \pgf@y=\pgf@circ@res@up
+ \advance\pgf@y by\pgf@circ@res@down
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{n}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{ne}{
+ \northeast
+ }
+ \anchor{nw}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{e}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{s}{%
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{se}{%
+ \southwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{sw}{%
+ \southwest
+ }
+ \anchor{w}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{right}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{above}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{left}{%
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{below}{%
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{a}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{b} {
+ \southwest
+ \pgf@y=0cm
+ }
+ \savedanchor{\textanchor}{%
+ \pgf@y=\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \anchor{text}{%
+ \textanchor
+ }
+ \anchorborder{%
+ \ifpgf@circuit@bipole@inverted
+ \pgf@circ@res@left=-\pgf@x
+ \pgf@circ@res@right=-\pgf@y
+ \else
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@right=\pgf@y
+ \fi
+ \ifdim\pgf@circ@res@right>0cm
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
+ \else
+ \southwestborder
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
+ \fi
+ }
+
+ #1
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@zero = 0cm
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@res@right = \pgf@x
+ \southwest
+ \pgf@circ@res@down = \pgf@y
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ #6
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Standard bipole shapes declarations
+
+%% Resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/resistor/height}}{resistor}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \divide \pgf@circ@res@step by 12
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+
+
+%% Variable resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vresistor/height}}{vresistor}{\ctikzvalof{bipoles/vresistor/height}}{\ctikzvalof{bipoles/vresistor/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \divide \pgf@circ@res@step by 12
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/capacitor/height}}{capacitor}{\ctikzvalof{bipoles/capacitor/height}}{\ctikzvalof{bipoles/capacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+%% Polar Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pcapacitor/height}}{polarcapacitor}{\ctikzvalof{bipoles/pcapacitor/height}}{\ctikzvalof{bipoles/pcapacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/pcapacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+}
+
+%% Electrolytic Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ecapacitor/height}}{ecapacitor}{\ctikzvalof{bipoles/ecapacitor/height}}{\ctikzvalof{bipoles/ecapacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/ecapacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+ \pgfsetrectcap
+ % % % Draw plus pole
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ % % Draw minus pole
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{black}
+ \pgfusepath{draw,fill}
+ \pgfsetfillcolor{black}
+ % % plus pole annotation
+ \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
+ {\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$}
+}
+
+%% Battery
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 6
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+%% Battery 1
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+
+
+
+ \pgfusepath{draw}
+}
+
+
+
+%% cute inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/lower coil height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% variable cute inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}{vcuteinductor}{\ctikzvalof{bipoles/vcuteinductor/height}}{\ctikzvalof{bipoles/vcuteinductor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% variable american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Independent voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+%% Independent voltage source - American style
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
+ \fi
+ \fi
+ \pgfusepath{draw}
+}
+
+
+
+%% Independent sinusoidal voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesin/height}}{vsourcesin}{\ctikzvalof{bipoles/vsourcesin/height}}{\ctikzvalof{bipoles/vsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+% contributed by Alistair Kwan
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesquare/height}}{vsourcesquare}{\ctikzvalof{bipoles/vsourcesquare/height}}{\ctikzvalof{bipoles/vsourcesquare/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Empty Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% PV Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pvsource/height}}{pvsource}{\ctikzvalof{bipoles/pvsource/height}}{\ctikzvalof{bipoles/pvsource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ %Adapted from battery1
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %Arrow Part
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% DC Current Source with open shape
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcisource/height}}{dcisource}{\ctikzvalof{bipoles/dcisource/height}}{\ctikzvalof{bipoles/dcisource/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{-90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{270}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \ifpgf@circ@oldvoltagedirection
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgftransformrotate{180}
+ \else
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \fi\fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% DC-Voltage source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcvsource/height}}{dcvsource}{\ctikzvalof{bipoles/dcvsource/height}}{\ctikzvalof{bipoles/dcvsource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
+ \pgfusepath{draw}
+}
+
+
+%% Independent current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Independent double oo source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/oosource/height}}{oosource}{\ctikzvalof{bipoles/oosource/height}}{\ctikzvalof{bipoles/oosource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
+ \pgfusepath{draw}
+}
+
+
+%% Independent current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isourceam/height}}{isourceAM}{\ctikzvalof{bipoles/isourceam/height}}{\ctikzvalof{bipoles/isourceam/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \ifpgf@circ@oldvoltagedirection
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgftransformrotate{180}
+ \else
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \fi\fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+
+
+
+%% Independent sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isourcesin}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+%% Controlled voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled voltage source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourceam/height}}{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
+ \pgfusepath{draw}
+}
+
+
+%% Controlled sinusoidal voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Controlled sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Controlled current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{draw}}
+ \endpgfscope
+}
+
+%% Black generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black alternative zigzag Zener diode
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Black tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+}
+
+%% Black photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black varcap
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfusepath{draw,fill}
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty alternative zigzag Zener diode
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Empty Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty varcap
+
+\pgfcircdeclarebipole{
+ \anchor{strokepathstart}{
+ \northeast
+ \pgf@y=0cm
+ \advance\pgf@x by -\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth
+ \advance\pgf@x by -\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth
+ }
+ \anchor{strokepathend}{
+ \northeast
+ \pgf@y=0cm
+ }
+ }{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{spst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}}
+ \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.1\pgf@circ@res@right}{-.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.14\pgf@circ@res@right}{-.35\pgf@circ@res@up}}
+ \pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+}
+
+%% Closing SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{cspst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}}
+ \pgfpatharc{65}{25}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+}
+
+%% Opening SPST
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height 2}}{ospst}{\ctikzvalof{bipoles/interr/height}}{\ctikzvalof{bipoles/interr/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@right}{.1\pgf@circ@res@down}}
+ \pgfpatharc{15}{50}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/interr/width}\pgf@circ@Rlen}
+ %\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.85\pgf@circ@res@left}{1.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.87\pgf@circ@res@left}{1.26\pgf@circ@res@up}}
+ \pgfsetarrowsend{latex'}
+ \pgfusepath{draw}
+
+
+}
+
+
+%% Push Button
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pushbutton/height 2}}{pushbutton}{\ctikzvalof{bipoles/pushbutton/height}}{\ctikzvalof{bipoles/pushbutton/width}}{
+
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+%METERINGSHAPE
+\long\def\drawmeteringcircle{
+ \def\pgf@circ@temp{right}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \def\pgf@circ@temp{below}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \pgf@circ@res@step=1.2\pgf@circ@res@up
+ \fi
+ \fi
+ %draw connections to circle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ %draw circle
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw arrow
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%AMPEREMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ammeter/height}}{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\textbf{A}}{}{}
+}
+%OHMMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ohmmeter/height}}{ohmmeter}{\ctikzvalof{bipoles/ohmmeter/height}}{\ctikzvalof{bipoles/ohmmeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
+}
+%VOLTMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/voltmeter/height}}{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\textbf{V}}{}{}
+
+}
+
+%% Short circuit
+
+\pgfcircdeclarebipole{}{0}{short}{0}{0}{ }
+
+%% Open circuit
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/open/height}}{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{
+
+}
+
+%% Generic bipole - used as resistor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/generic/height}}{generic}{\ctikzvalof{bipoles/generic/height}}{\ctikzvalof{bipoles/generic/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+%% fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+
+%% Generic bipole, filled - used as inductor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fullgeneric/height}}{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw,fill}
+}
+
+
+%% Generic asymmetric bipole
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ageneric/height}}{ageneric}{\ctikzvalof{bipoles/ageneric/height}}{\ctikzvalof{bipoles/ageneric/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+%% asymmetric fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/afuse/height}}{afuse}{\ctikzvalof{bipoles/afuse/height}}{\ctikzvalof{bipoles/afuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Memristor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/memristor/height}}{memristor}{\ctikzvalof{bipoles/memristor/height}}{\ctikzvalof{bipoles/memristor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Generic empty tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Photoresistor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/photoresistor/height 2}}{photoresistor}{\ctikzvalof{bipoles/photoresistor/height}}{\ctikzvalof{bipoles/photoresistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Thermistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistor/height}}{thermistor}{\ctikzvalof{bipoles/thermistor/height}}{\ctikzvalof{bipoles/thermistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+
+%% Thermistor PTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorptc/height 2}}{thermistorptc}{\ctikzvalof{bipoles/thermistorptc/height}}{\ctikzvalof{bipoles/thermistorptc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Thermistor NTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% thermocouple
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermocouple/height 2}}{thermocouple}{\ctikzvalof{bipoles/thermocouple/height}}{\ctikzvalof{bipoles/thermocouple/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+}
+
+%% Varistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varistor/height}}{varistor}{\ctikzvalof{bipoles/varistor/height}}{\ctikzvalof{bipoles/varistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}}
+}
+
+
+
+%% Generic full tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tfullgeneric/height}}{tfullgeneric}{\ctikzvalof{bipoles/tfullgeneric/height}}{\ctikzvalof{bipoles/tfullgeneric/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+
+
+
+%% Variable Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcapacitor/height}}{vcapacitor}{\ctikzvalof{bipoles/vcapacitor/height}}{\ctikzvalof{bipoles/vcapacitor/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfusepath{draw}
+}
+
+
+%% Piezoelectric Element
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piezoelectric/height}}{piezoelectric}{\ctikzvalof{bipoles/piezoelectric/height}}{\ctikzvalof{bipoles/piezoelectric/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ %% Outer markings
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %% Inner Box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left+4}{\pgf@circ@res@up-1}}{\pgfpoint{\pgf@circ@res@right-4}{\pgf@circ@res@down+1}}
+ \pgfusepath{draw}
+
+}
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Handling of terminals
+
+
+%% Easily usable styles
+
+\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=diamond}}
+
+\tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
+
+
+%% The output routine
+
+\def\drawpoles{
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{diamond} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[diamondpole] {} }
+ \else
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[ocirc] {} }
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztostart) node[circ] {} }
+ \fi
+ \fi
+ \fi
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{diamond} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[diamondpole] {} }
+ \else
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[ocirc] {} }
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ { (\tikztotarget) node[circ] {} }
+ \fi
+ \fi
+ \fi
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+%% Lamp
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height}
+ }{tline}{\ctikzvalof{bipoles/tline/height}
+ }{\ctikzvalof{bipoles/tline/width}
+ }
+ {
+ \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0}}
+ {\pgfpoint{\pgf@circ@res@step}{0}}
+ {\pgfpoint{0}{-\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% SQUID added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+% Generic barrier added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+}
+
+
+% Contributed by Danilo Piazzalunga
+
+\pgfdeclareshape{buffer}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+
+
+\pgfdeclareshape{plain amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+%% Generic two port box
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/twoport/height}}{twoport}{\ctikzvalof{bipoles/twoport/height}}{\ctikzvalof{bipoles/twoport/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+}
+
+%% voltage controled oscillator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vco/width}}{vco}{\ctikzvalof{bipoles/twoport/width}}{\ctikzvalof{bipoles/vco/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+}
+
+%% bandpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandpass/width}}{bandpass}{\ctikzvalof{bipoles/bandpass/width}}{\ctikzvalof{bipoles/bandpass/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% highpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/highpass/width}}{highpass}{\ctikzvalof{bipoles/highpass/width}}{\ctikzvalof{bipoles/highpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% lowpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lowpass/width}}{lowpass}{\ctikzvalof{bipoles/lowpass/width}}{\ctikzvalof{bipoles/lowpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% ADC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/adc/width}}{adc}{\ctikzvalof{bipoles/adc/width}}{\ctikzvalof{bipoles/adc/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{A}
+ \def\textii{D}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{A}
+ \def\textii{D}
+ \fi\fi
+
+ % draw inner symbol
+ \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}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DAC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dac/width}}{dac}{\ctikzvalof{bipoles/dac/width}}{\ctikzvalof{bipoles/dac/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{D}
+ \def\textii{A}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{D}
+ \def\textii{A}
+ \fi\fi
+
+ % draw inner symbol
+ \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}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DSP
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dsp/width}}{dsp}{\ctikzvalof{bipoles/dsp/width}}{\ctikzvalof{bipoles/dsp/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{DSP}}
+}
+
+%% FFT
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fft/width}}{fft}{\ctikzvalof{bipoles/fft/width}}{\ctikzvalof{bipoles/fft/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{FFT}}
+}
+
+%% Amplifier
+\pgfcircdeclarebipole{}{
+ \ifpgf@circuit@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@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \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
+ \pgfusepath{draw}
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+}
+
+
+%% variable amplifier
+\pgfcircdeclarebipole{}{
+ \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@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \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
+ \pgfusepath{draw}
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+ % 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}
+}
+
+%% pi attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piattenuator/width}}{piattenuator}{\ctikzvalof{bipoles/piattenuator/width}}{\ctikzvalof{bipoles/piattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vpiattenuator/width}}{vpiattenuator}{\ctikzvalof{bipoles/vpiattenuator/width}}{\ctikzvalof{bipoles/vpiattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% T attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tattenuator/width}}{tattenuator}{\ctikzvalof{bipoles/tattenuator/width}}{\ctikzvalof{bipoles/tattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vtattenuator/width}}{vtattenuator}{\ctikzvalof{bipoles/vtattenuator/width}}{\ctikzvalof{bipoles/vtattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{phaseshifter}{\ctikzvalof{bipoles/phaseshifter/width}}{\ctikzvalof{bipoles/phaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+}
+
+%% variable phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{vphaseshifter}{\ctikzvalof{bipoles/vphaseshifter/width}}{\ctikzvalof{bipoles/vphaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% detector
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/detector/width}}{detector}{\ctikzvalof{bipoles/detector/width}}{\ctikzvalof{bipoles/detector/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % draw inner stuff
+ \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@Rlen / \ctikzvalof{bipoles/generic/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
+ \fi
+
+}
+
+
+
+
+%% european gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{european gas filled surge arrester}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{\ctikzvalof{bipoles/european gas filled surge arrester/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+
+
+
+%% american gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{american gas filled surge arrester}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
+ %\def\pgf@circ@temp{right}
+ %\ifx\tikz@res@label@pos\pgf@circ@temp
+ % \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ %\else
+% \def\pgf@circ@temp{below}
+% \ifx\tikz@res@label@pos\pgf@circ@temp
+% \pgf@circ@res@step=-1.2\pgf@circ@res@up
+% \else
+% \pgf@circ@res@step=1.2\pgf@circ@res@up
+% \fi
+% \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfnode{circle}{center}{}{}{}
+
+ \pgfscope
+ \pgfsetarrowsend{latex}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+
+ %\pgftransformshift{\pgfpoint{.25\pgf@circ@res@left}{.45\pgf@circ@res@down}}
+ %\pgfnode{circ}{center}{}{}{}
+ %\pgftransformshift{}
+ \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
+ \pgfusepath{fill}
+}
+
+% % MECHANICAL SYMBOLS
+
+%% mechanical capacitance - stiffness/spring
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spring/height}}{spring}{\ctikzvalof{bipoles/spring/height}}{\ctikzvalof{bipoles/spring/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical inductance - mass
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/mass/box height}}{mass}{\ctikzvalof{bipoles/mass/height}}{\ctikzvalof{bipoles/mass/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
+
+\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical resistor - damper
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/damper/height}}{damper}{\ctikzvalof{bipoles/damper/height}}{\ctikzvalof{bipoles/damper/width}}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {\pgf@circ@res@zero}}
+ \pgfusepath{stroke}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+
+
+%%%---------- close: tex/pgfcircbipoles
+%%%%%%%%%%% Springe nach tex/pgfcirctripoles
+%%%---------- open: tex/pgfcirctripoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Tripoles
+
+
+
+\pgfdeclareshape{spdt}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out 1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{out 2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left
+
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+ \pgfpathlineto{
+ \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
+ {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
+ }
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Logic ports
+%%
+
+
+
+
+
+
+\long\def\pgfcircdeclarelogicport#1#2{
+ \pgfdeclareshape{american #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \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
+
+ #2
+
+ }
+ }
+}
+
+
+\pgfcircdeclarelogicport{and}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+ \pgfpathcurveto
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{nand}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{nor}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+
+
+\pgfcircdeclarelogicport{or}{
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{xor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{xnor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfdeclareshape{american not port}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+\pgfdeclareshape{invschmitt}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ %draw inner shape
+
+ \pgfsetlinewidth{2\pgflinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% #1 - name
+% #2 - text inside
+% #3 - number of inputs
+% #4 - is it a not
+
+\long\def\pgfcircdeclareeurologicport#1#2#3#4{
+ \pgfdeclareshape{european #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \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
+ \def\pgf@temp{1}
+ \def\pgf@circ@temp{#3}
+ \ifx\pgftemp\pgf@circ@temp % one input
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}
+ \else % two inputs
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \fi%
+ %
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
+ %
+ \edef\pgf@temp{not}
+ \edef\pgf@circ@temp{#4}
+ \ifx\pgf@temp\pgf@circ@temp % is a not
+ \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf@circ@res@up}}
+ \fi
+ %
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgftext{#2}
+ %
+ %
+ %
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+%
+%
+ }
+ }
+}
+
+
+
+\pgfcircdeclareeurologicport{and}{$\&$}{2}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{2}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{2}{}
+\pgfcircdeclareeurologicport{not}{$1$}{1}{not}
+\pgfcircdeclareeurologicport{nand}{$\&$}{2}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{2}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{2}{not}
+
+\long\def\pgfcircdeclaretransistor#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northeast{% upper right
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%center left
+ \pgf@y=0pt
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@x
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@y=.7\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=0.1\pgf@x
+ }
+ \anchor{pathstart}{ % south
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{pathend}{
+ \northeast
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \northeast
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{south east}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{base}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{nobase}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x
+ }
+ \anchor{nogate}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@x
+ }
+ \anchor{E}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{emitter}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{C}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{collector}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{D}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{drain}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ #2
+ \backgroundpath{
+ \pgftransformationadjustments
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ %
+ \ifnum \pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction} > 0
+ \pgf@circuit@trans@ntypetrue
+ \else
+ \pgf@circuit@trans@ntypefalse
+ \fi
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \left
+ \pgf@circ@res@left = \pgf@x
+ %
+ #3
+ % BODY DIODE
+ \ifpgf@circuit@fet@bodydiode
+ \drawbodydiode{#1}
+ \fi
+ %
+ }
+ }
+}
+
+\long\def\drawbodydiode#1{
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgftransformrotate{90}
+ \pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}}
+ \ifpgf@circuit@fulldiode
+ \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \else
+ \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \fi
+ \endpgfscope
+ %Draw upper connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope{}
+ %Draw lower connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+}
+
+\long\def\declarebpt#1{
+ \pgfcircdeclaretransistor{#1}{}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transiytor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{.5}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \ifpgf@circuit@bpt@drawphoto
+ \pgfscope
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \else
+ \ifpgf@circuit@bpt@drawbase
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \fi
+ }
+}
+
+\declarebpt{npn}
+\declarebpt{pnp}
+
+\long\def\declareigbt#1{
+\pgfcircdeclaretransistor{#1}{}
+{
+ %draw upper connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ %draw thicker gate lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw lower connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transiytor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{.5}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ %draw gate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
+ \fi
+ \pgfusepath{draw}
+}
+}
+
+\declareigbt{pigbt}
+\declareigbt{nigbt}
+\declareigbt{Lnigbt}
+\declareigbt{Lpigbt}
+
+
+\pgfcircdeclaretransistor{nmos}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+}
+
+
+\pgfcircdeclaretransistor{pmos}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+
+
+ \pgfusepath{draw}
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \pgfpathcircle{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}}
+ \ifpgf@circuit@pmos@emptycircle
+ \pgfsetfillcolor{white}
+ \fi
+ \pgfusepath{draw,fill}
+}
+
+\long\def\drawfetcore#1{
+ \pgftransformationadjustments
+ %top connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \ifpgf@circuit@trans@depletiontype
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \else
+
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \fi
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %Bulk connection line
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ %bottom connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ %draw thick gate line
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \ifpgf@circuit@trans@ntype
+ \else
+ \pgftransformrotate{180}
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ % GATE CONNECTION
+ \ifpgf@circuit@bpt@drawgate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+ \fi
+
+}
+
+\long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
+{\pgfcircdeclaretransistor{#1}{
+ \anchor{bulk}{\left\pgf@x=0pt}
+ \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
+ #2
+ }
+ {#3}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nfet}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pfet}
+}
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfete}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+
+
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
+\pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfetebulk}
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+
+
+% N-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{nigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfete}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
+\pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfetebulk}
+}
+
+
+% P-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{pigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+\pgfcircdeclaretransistor{njfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclaretransistor{pjfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ % GATE, DEPLETION TYPE
+ \pgfscope %% added
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth} %% added
+ \pgfusepath{draw} %% added
+ \endpgfscope %% added
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ % GATE
+ %\pgfscope
+ %\pgfpathmoveto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ %\pgfpathlineto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ %\pgfusepath{draw}
+ %\endpgfscope
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfusepath{draw}
+
+ % Wavy lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+%% Black thyristor
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/thyristor/height 2}}{fullthyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty thyristor
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/thyristor/height 2}}{emptythyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty triac
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/triac/height}}{emptytriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty triac
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/triac/height}}{fulltriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+
+
+
+
+\pgfcircdeclarebipole{
+ \anchor{out 1}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{out 2}{
+ \northeast
+ \pgf@y=.8\pgf@y
+ }
+}{\ctikzvalof{tripoles/toggleswitch/height 2}}{toggleswitch}{\ctikzvalof{tripoles/toggleswitch/height}}{\ctikzvalof{tripoles/toggleswitch/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetdash{}{0cm}
+}
+
+
+
+
+
+
+
+
+
+
+\pgfdeclareshape{op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+%%Transkonduktanzverstärker
+\pgfdeclareshape{gm amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ %Umrandung:
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}} %geändert startpunkt neu am ausgangsstrich
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}%vom Ausgang nach oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}%ecke links unten nach rechts unten
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+
+ }
+ }
+
+
+
+%% Potentiometer
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+ \anchor{W}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/potentiometer/height 2}}{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}{\ctikzvalof{bipoles/potentiometer/width}}{
+\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+\pgftransformationadjustments
+\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+\divide \pgf@circ@res@step by 12
+
+\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+
+\pgf@circ@res@other = \pgf@circ@res@left
+\advance\pgf@circ@res@other by \pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by \pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+\pgfsetbeveljoin
+\pgfusepath{draw}
+
+\pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+\endpgfscope
+}
+
+
+
+
+
+%% Generic tunable
+
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/generic potentiometer/height 2}}{genericpotentiometer}{\ctikzvalof{bipoles/generic potentiometer/height}}{\ctikzvalof{bipoles/generic potentiometer/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+\pgfdeclareshape{mixer}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{adder}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{oscillator}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{text}{
+ \pgf@x=-2\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@Rlen{}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
+
+ % draw outer box
+ \ifpgf@circuit@boxed{}
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{circulator}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed{}
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % inner arrow
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
+ \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+
+% Wilkinson divider
+\pgfdeclareshape{wilkinson}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{out2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \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}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ % draw inner resisitor - european or american style is recognised
+ {
+ \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgftransformrotate{90}
+
+ % calculate size of resistor
+ \ifpgf@circuit@europeanresistor
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}}
+ \fi
+ }
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+% electromechanical device (motor/generator)
+\pgfdeclareshape{elmech}
+{
+ \savedanchor\northwest{
+ %\ifpgf@circuit@boxed
+ % \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ % \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ % \pgf@y=.5\pgf@y
+ % \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ % \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ % \pgf@x=.5\pgf@x
+ %\else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ %\fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ % draw outer box
+ % \ifpgf@circuit@boxed
+ % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ % \fi
+ % draw outer circle
+ %\ifpgf@circuit@boxed
+ % \pgf@circ@res@step=.7\pgf@circ@res@step
+ % \pgfsetdash{}{0pt} % draw solid circle if boxed
+ %\else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ %\fi
+ \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{black}
+ \pgfusepath{draw,fill}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{magnetron}
+{
+ \savedanchor\northwest{
+ %\ifpgf@circuit@boxed
+ % \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ % \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@y
+ % \pgf@y=.5\pgf@y
+ % \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ % \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@x
+ % \pgf@x=.5\pgf@x
+ %\else
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ %\fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{anode}{
+ \northwest
+ \pgf@circ@res@step= \pgf@y
+ \pgfpointorigin
+ \pgfpathmoveto{ \pgfpointpolar{-90}{\pgf@circ@res@step}}
+ }
+ \anchor{cathode1}{
+ \northwest
+ \pgf@circ@res@step= \pgf@y
+ \pgfpointorigin
+ \pgfpathmoveto{ \pgfpointpolar{105}{\pgf@circ@res@step}}
+ }
+ \anchor{cathode2}{
+ \northwest
+ \pgf@circ@res@step= \pgf@y
+ \pgfpointorigin
+ \pgfpathmoveto{ \pgfpointpolar{75}{\pgf@circ@res@step}}
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@Rlen
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ % draw outer box
+ % \ifpgf@circuit@boxed
+ % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ % \fi
+ % draw outer circle
+ %\ifpgf@circuit@boxed
+ % \pgf@circ@res@step=.7\pgf@circ@res@step
+ % \pgfsetdash{}{0pt} % draw solid circle if boxed
+ %\else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ %\fi
+ %create outer circle
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw}
+ %create chambers
+ \foreach \angle in {45,135,225,315}{
+ \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
+ \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
+ }
+ \pgfsetroundcap
+ \pgfusepath{draw}
+ \pgfscope
+ %draw connection from outside
+ %anode
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ %cathodes
+ \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ %create cathode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %create anode
+ \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%---------- close: tex/pgfcirctripoles
+%%%%%%%%%%% Springe nach tex/pgfcircquadpoles
+%%%---------- open: tex/pgfcircquadpoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Quadripoles
+
+\long\def\pgfcircdeclarequadpole#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
+ }
+ \anchor{A2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{A1}{
+ \northwest
+ }
+ \anchor{B2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{base}{
+ \northwest
+ \pgf@x=0pt
+ }
+ #3
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ %\pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+
+ #2
+
+ }
+ }
+}
+
+
+
+\def\pgf@circ@drawtransformerbasicanchor{
+ \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
+ \anchor{AA2}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{AA1}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+}
+
+\def\pgf@circ@drawtransformerbasicbody{
+ \def\stretto{.4}
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@down}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+
+ \endpgfscope
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@up}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+ % contrib Kristofer M. Monisit
+
+ \pgfdeclareshape{fd op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@x
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out +}{
+ \northwest
+ \pgf@y=.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out -}{
+ \northwest
+ \pgf@y=-.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+
+ % Negative output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ % Positive output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfsetrectcap
+ % Draw them all!
+ \pgfusepath{draw}
+
+ % Triangle
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+
+\pgfcircdeclarequadpole{transformer}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \def\stretto{.4}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
+ \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
+ \pgfusepath{draw}
+
+}{}
+
+%% four-port
+% defines a general outer box for four-ports
+% TikZ usage:
+% \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
+% (coup.port1) to[short,-o] ++(-1,0)
+%
+
+\long\def\pgfcircdeclarefourport#1#2{
+ \pgfdeclareshape{#1}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{port1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{port3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{port4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ #2
+
+ % draw inner text
+ \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ }
+ }
+}
+
+% four-port
+\pgfcircdeclarefourport{fourport}{}
+
+
+% straight coupler
+\pgfcircdeclarefourport{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarefourport{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+
+}
+%%%---------- close: tex/pgfcircquadpoles
+
+%%%%%%%%%%% Springe nach tex/pgfcirclabel
+%%%---------- open: tex/pgfcirclabel.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Bipole label positioning
+
+%% Options
+\ctikzset{label/.style = { l=#1 } }
+\ctikzset{l/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{label above/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l^/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{label below/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+\ctikzset{l_/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+%value options
+\ctikzset{annotation/.style = { a=#1 } }
+\ctikzset{a/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
+ \ctikzsetvalof{bipole/annotation/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }}
+
+
+
+\ctikzset{annotation above/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+\ctikzset{a^/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+
+\ctikzset{annotation below/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+\ctikzset{a_/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+
+
+
+\def\pgf@circ@drawlabels#1{
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{label/align}}
+ \def\pgf@circ@temp{straight}
+ }
+ \ifx\pgf@temp\pgf@circ@temp %straight
+ \pgf@circ@drawreglabels{#1}
+ \else
+ \pgfextra{\def\pgf@circ@temp{rotate}}
+ \ifx\pgf@temp\pgf@circ@temp %rotate
+ \pgf@circ@drawrotlabels{#1}
+ \else % smart
+ \pgf@circ@drawsmartlabels{#1}
+ \fi
+ \fi
+}
+
+
+\def\pgf@circ@drawsmartlabels#1{
+ \pgfextra{
+ %\pgfmathadd{\pgf@circ@direction}{360}
+ \pgfmathmod{\pgf@circ@direction}{90}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \ifnum \pgfcircmathresult > 20
+ \ifnum \pgfcircmathresult < 70 % NON quasi retto
+ \pgf@circ@drawrotlabels{#1}
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+}
+
+%% Output routing
+%% #1 - node name
+
+\def\pgf@circ@drawrotlabels#1{
+ \pgfextra{
+ % calcolo rotazione label
+ \def\pgf@circ@temp{\ctikzvalof{bipole/#1/position}} %%% àncora label
+ \edef\pgfcirclabrot{\pgf@circ@direction} % primo e quarto quadrante
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 90 \ifnum \pgfcircmathresult < 270 % terzo e secondo
+ \pgfmathsubtract{\pgf@circ@direction}{180}
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \pgfmathadd{\pgf@circ@temp}{180} %%%
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil} %%%
+ \fi\fi
+
+ }
+ \ifnum \ctikzvalof{mirror value} = -1
+ % \pgfmathadd{\pgf@circ@temp}{180}
+ % \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.south)$)
+ (labelcoor) node [rotate=\pgfcirclabrot] {\pgf@circ@finallabels{#1}} % c'era un transform shape
+ \else
+ coordinate (labelcoor) at ($(\ctikzvalof{bipole/name})!2!(\ctikzvalof{bipole/name}.north)$)
+ (labelcoor) node [rotate=\pgfcirclabrot] {\pgf@circ@finallabels{#1}} % c'era un transform shape
+ \fi
+
+}
+
+\def\pgf@circ@drawreglabels#1{
+ \pgfextra{
+ \pgfmathsubtract{\pgf@circ@direction}{90}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}} %%% àncora label
+ \ifnum \pgf@circ@temp < 0
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ \ifpgf@circuit@bipole@inverted
+ \pgfmathadd{\pgf@circ@temp}{180}
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@temp}{180}
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ }
+ node [ anchor = \pgf@circ@labanc]
+ at (\ctikzvalof{bipole/name}.\pgf@circ@temp) {\pgf@circ@finallabels{#1}}
+}
+
+\def\pgf@circ@finallabels#1{%
+ \edef\pgf@temp{}%
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \ctikzvalof{bipole/#1/name}%
+ \else%
+ $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
+ \fi%
+}
+
+
+\ctikzset{text/.style = { t=#1 } }
+\ctikzset{t/.code = {
+ \ctikzsetvalof{bipoles/twoport/text}{#1}
+}}
+
+%%%---------- close: tex/pgfcirclabel
+%%%%%%%%%%% Springe nach tex/pgfcircvoltage
+%%%---------- open: tex/pgfcircvoltage.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Voltage management
+
+
+\ctikzset{v^>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v^</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v_>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+
+% Default position varies whether the component is a voltage source
+% or not
+\ctikzset{v/.code = {
+ \ifpgf@circuit@bipole@isvoltage
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi
+ \fi
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@bipole@current@backward
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \fi\fi\fi
+ \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
+ \ctikzsetvalof{bipole/voltage/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }
+}
+
+\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
+\ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
+\ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
+\ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
+
+
+%% Output routine for generic bipoles
+
+\def\pgf@circ@drawvoltagegeneric{
+ \pgfextra{
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\eudist}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\eudist}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\eudist}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\eudist}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@voltage@angle{90}
+ \else
+ \def\pgf@circ@voltage@angle{-90}
+ \fi
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
+ { \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
+ { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
+ }
+
+
+ coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \distacefromnode ! (anchorstartnode)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
+ coordinate (pgfcirc@mid) at ($(\tikztotarget) ! \distacefromnode ! (anchorendnode)$)
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@mid) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
+
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
+ \else
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@straight
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1] {}
+ \else
+ (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1] {}
+
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vto)
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$}
+ \fi
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$}
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine for voltage sources
+
+\def\pgf@circ@drawvoltagegenerator{
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-120)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-60)$)
+ \else
+ coordinate (pgfcirc@Vcont1) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.120)$)
+ coordinate (pgfcirc@Vcont2) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.60)$)
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vcont2) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont1)
+ \else
+ (pgfcirc@Vcont1) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vcont2)
+ \fi
+
+ \else % american voltage
+
+ \ifpgf@circuit@bipole@voltageoutsideofsymbol
+ % if it is a battery, must put + and -
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vcont1) node {$-$} (pgfcirc@Vcont2) node {$+$}
+ \else
+ (pgfcirc@Vcont1) node {$+$} (pgfcirc@Vcont2) node {$-$}
+ \fi
+ \fi
+
+ \fi
+}
+
+%% Output routine
+
+\def\pgf@circ@drawvoltage{ % node name
+ \pgfextra{
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@voltage@label@where{90}
+ \fi
+
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label
+ distance}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
+ { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
+
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ } %end pgfextra
+
+ \ifpgf@circuit@bipole@isvoltage
+ \pgf@circ@drawvoltagegenerator
+ \else
+ \pgf@circ@drawvoltagegeneric
+ \fi
+
+
+
+ (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)
+ coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
+ \ifpgf@circuit@europeanvoltage\eudist\else\ctikzvalof{voltage/american label distance}\fi !
+ (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$)
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=0]
+ at (Vlab) { \pgf@circ@finallabels{voltage/label} }
+}
+
+%%%---------- close: tex/pgfcircvoltage
+%%%%%%%%%%% Springe nach tex/pgfcirccurrent
+%%%---------- open: tex/pgfcirccurrent.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Current handling
+
+%% Options
+
+
+\ctikzset{i^>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i>^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i>_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i^</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i<^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i<_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i/.code = {
+% \ifpgf@circuit@bipole@iscurrent
+% \pgfkeys{\circuitikzbasekey/bipole/current/position=above}
+% \else
+% \pgfkeys{\circuitikzbasekey/bipole/current/position=below}
+% \fi
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
+ \ctikzsetvalof{bipole/current/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+%reverse current direction for voltage sources
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@isvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below }
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \fi\fi\fi
+}
+}
+
+
+\ifpgf@circ@oldvoltagedirection
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
+\else
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
+\fi
+\ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
+\ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
+\ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
+
+
+\def\pgf@circ@drawnormalcurrent{
+ \ifpgf@circuit@bipole@current@before
+ \ifpgf@circuit@bipole@current@backward
+ { (anchorstartnode) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztostart)
+ }
+ \else
+ { (\tikztostart) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (anchorstartnode)
+ }
+ \fi
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ { (\tikztotarget) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (anchorendnode)
+ }
+ \else
+ { (anchorendnode) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztotarget)
+ }
+ \fi
+ \fi
+}
+
+%% Output routine
+%% #1 - node name
+
+\def\pgf@circ@drawcurrent{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >284 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@bipole@current@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@current@label@where{+90}
+ \fi
+ }
+
+
+ \pgfextra{ \def\pgf@temp{short} \edef\pgf@circ@temp{\ctikzvalof{bipole/kind}} }
+
+ \ifx\pgf@circ@temp\pgf@temp % caso di corrente (centrata) su un corto
+ \ifpgf@circuit@bipole@current@backward
+ { (\tikztotarget) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztostart) }
+ \else
+ { (\tikztostart) --
+ node [currarrow, pos=\ctikzvalof{current/distance}, sloped, allow upside down] (Iarrow) {}
+ (\tikztotarget) }
+ \fi
+
+ \else % altri bipoli - e quindi tra nodo e target
+
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@europeancurrent
+ \pgf@circ@drawnormalcurrent
+ \else
+ \fi
+ \else
+ \pgf@circ@drawnormalcurrent
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@iscurrent
+ node [anchor=\pgf@circ@dir] at (\ctikzvalof{bipole/name}.\pgf@circ@bipole@current@label@where)
+ { \pgf@circ@finallabels{current/label} }
+ \else
+ (Iarrow.\pgf@circ@bipole@current@label@where) node [anchor=\pgf@circ@dir]
+ { \pgf@circ@finallabels{current/label} }
+ \fi
+
+}
+
+
+
+
+%%%---------- close: tex/pgfcirccurrent
+
+\ExecuteOptions{nofetbodydiode,nofetsolderdot,nooldvoltagedirection,europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility}
+
+\ProcessOptions\relax
+
+%%%%%%%%%%% Springe nach tex/pgfcircpath
+%%%---------- open: tex/pgfcircpath.tex
+
+\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
+\def\pgf@circ@direction{0.0}
+
+% Names
+\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
+\ctikzset{n/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/name=#1}
+}}
+
+% Reflect the node along
+\ctikzset{mirrored/.is choice}
+\ctikzset{mirror value/.initial=1}
+\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
+\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
+\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
+
+% Invert node along path
+\ctikzset{inverted/.is choice}
+\ctikzset{invert value/.initial=1}
+\ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
+\ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
+\ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
+\newif\ifpgf@circuit@bipole@inverted
+\ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
+
+
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+
+
+
+% Initialize paths
+\def\pgfcircresetpath{
+ \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
+ bipole/inverted=false, bipole/kind=,
+ bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
+ bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
+ bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
+ bipole/current/y position=above, bipole/current/direction=forward,
+ mirrored=false
+ }
+}
+
+
+%% Generic bipole path
+\def\pgf@circ@bipole@path#1#2{
+ \pgfextra{
+ \ctikzset{bipole/kind = #1}
+
+ \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+ \def\pgf@circ@temp{}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = #2\pgf@circ@rand} % create it
+ \fi
+
+ \def\pgf@temp{open}
+ \def\pgf@circ@temp{#1}
+ }
+
+ (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)
+ (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
+ \pgfextra{
+ \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
+ (\ctikzvalof{bipole/name}) {}
+ \ifpgf@circuit@bipole@inverted
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
+ \fi
+ \else
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
+ \fi
+ \fi
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ \ifpgf@circuit@bipole@strokedsymbol%draw line thrue symbol(e.g. diodes)
+ \ifcsname pgf@anchor@#1shape@strokepathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.strokepathstart)
+ (\ctikzvalof{bipole/name}.strokepathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center)--(\ctikzvalof{bipole/name}end.center)
+ \fi
+ \else
+ (\ctikzvalof{bipole/name}start.center) --(anchorstartnode)
+ (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
+
+ \fi
+ \fi
+
+
+ \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
+ \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
+ \drawpoles
+ \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
+ \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
+ % reset
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+%% Path definitions
+\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
+\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
+\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
+\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
+\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
+\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
+\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
+\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
+\def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
+\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
+\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
+\def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
+\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
+\def\pgf@circ@battery1@path#1{\pgf@circ@bipole@path{battery1}{#1}}
+\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
+\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
+\def\pgf@circ@inductor@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductor@path{#1}%
+ \else%
+ \pgf@circ@americaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@vinductor@path#1{
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@veuropeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@vcuteinductor@path{#1}%
+ \else%
+ \pgf@circ@vamericaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
+\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
+\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
+\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
+\def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
+\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
+\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
+\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
+\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
+\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
+\def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
+\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
+\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
+\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
+\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
+\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
+\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
+\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
+\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
+\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
+\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
+\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
+\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
+\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
+\def\pgf@circ@spst@path#1{\pgf@circ@bipole@path{spst}{#1}}
+\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
+\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
+\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
+\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
+\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
+\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
+\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
+\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
+\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
+\def\pgf@circ@empty@path#1{}
+\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
+\def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
+\def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
+\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
+\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
+\def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
+\def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
+\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
+\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
+\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
+\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
+\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
+\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
+
+\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
+\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
+\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
+
+\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
+\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
+\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
+\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
+\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
+\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
+\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
+\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
+\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
+\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
+\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
+\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
+\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
+\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
+\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
+\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
+\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
+\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
+
+%%Mechanical
+\def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
+\def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
+\def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
+
+
+
+
+%% Styles
+
+\def\comnpatname{\ifpgf@circuit@compat *\else\fi}
+\def\compattikzset#1{\tikzset{\comnpatname#1}}
+
+%\def\ctikzsetbipole#1#2{%
+% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
+%}
+
+\compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
+\compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
+\compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
+\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
+\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
+\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
+\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
+\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
+\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
+\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
+\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
+\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
+\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
+\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
+\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
+\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
+\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
+\compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
+\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
+\compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
+\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery1@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
+\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
+\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
+\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
+\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
+\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
+\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
+\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
+\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
+\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
+\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
+\compattikzset{transmission line/.style = {tline = #1}}
+\compattikzset{TL/.style = {tline = #1}}
+\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+
+\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
+\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
+\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
+\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
+\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
+\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
+\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
+
+\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
+
+\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
+\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
+\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
+\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
+\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
+
+\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
+\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
+\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
+\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
+\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
+\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
+\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
+\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
+\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
+\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
+\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
+\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
+\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
+\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
+\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
+\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
+\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
+\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
+
+% % % % % %
+% % Beginn of Diodes
+% % % % % %
+
+\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
+\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
+\def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
+\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
+\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
+\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
+\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
+\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
+\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
+\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
+\def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
+\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
+\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
+\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
+\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
+\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
+
+\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
+\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
+\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
+\compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
+\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
+\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
+\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
+\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
+\compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
+\compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
+
+\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
+\compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
+%\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
+
+\compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
+\compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
+\compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
+\compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
+\compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
+\compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
+\compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
+\compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
+\compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
+\compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
+
+%% Define Shortcuts
+\compattikzset{Do/.style = {\comnpatname empty diode}}
+\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
+\compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
+\compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
+\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
+\compattikzset{pDo/.style = {\comnpatname empty photodiode}}
+\compattikzset{leDo/.style = {\comnpatname empty led}}
+\compattikzset{VCo/.style = {\comnpatname empty varcap}}
+\compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
+\compattikzset{Tro/.style = {\comnpatname empty triac}}
+
+\compattikzset{D*/.style = {\comnpatname full diode}}
+\compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
+\compattikzset{zD*/.style = {\comnpatname full Zener diode}}
+\compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
+\compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
+\compattikzset{pD*/.style = {\comnpatname full photodiode}}
+\compattikzset{leD*/.style = {\comnpatname full led}}
+\compattikzset{VC*/.style = {\comnpatname full varcap}}
+\compattikzset{Ty*/.style = {\comnpatname full thyristor}}
+\compattikzset{Tr*/.style = {\comnpatname full triac}}
+
+\compattikzset{D/.style = {\comnpatname diode}}
+\compattikzset{tD/.style = {\comnpatname tunnel diode}}
+\compattikzset{zD/.style = {\comnpatname Zener diode}}
+\compattikzset{zzD/.style = {\comnpatname ZZener diode}}
+\compattikzset{sD/.style = {\comnpatname Schottky diode}}
+\compattikzset{pD/.style = {\comnpatname photodiode}}
+\compattikzset{leD/.style = {\comnpatname led}}
+\compattikzset{VC/.style = {\comnpatname varcap}}
+\compattikzset{Ty/.style = {\comnpatname thyristor}}
+\compattikzset{Tr/.style = {\comnpatname triac}}
+
+\compattikzset{D-/.style = {\comnpatname stroke diode}}
+\compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
+\compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
+\compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
+\compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
+\compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
+\compattikzset{leD-/.style = {\comnpatname stroke led}}
+\compattikzset{VC-/.style = {\comnpatname stroke varcap}}
+\compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
+\compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
+
+% % % % % %
+% % End of Diodes
+% % % % % %
+
+
+\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
+\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
+\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spst@path, l=#1}}
+\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
+
+\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
+\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
+\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
+
+% short forms
+\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path}}
+\compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path}}
+
+\compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
+\compattikzset{isource/.style = {\comnpatname current source = #1}}
+\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
+\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+
+\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+
+\compattikzset{R/.style= {\comnpatname resistor = #1}}
+%\ifpgf@circuit@compat\else\compattikzset{R/.style= {resistor = #1}}\fi
+\compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
+\compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
+\compattikzset{thR/.style= {\comnpatname thermistor = #1}}
+\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
+\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
+\compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
+\compattikzset{C/.style = {\comnpatname capacitor = #1}}
+\compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
+\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
+\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
+\compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
+\compattikzset{L/.style = {\comnpatname inductor = #1}}
+\compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
+\compattikzset{V/.style = {\comnpatname voltage source = #1}}
+\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
+\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
+ \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
+ \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
+ \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+\compattikzset{I/.style = {\comnpatname current source = #1}}
+\compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
+ \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
+ \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
+ \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+
+
+\compattikzset{Mr/.style = {\comnpatname memristor}}
+
+\compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
+\compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
+\compattikzset{spst/.style = {\comnpatname switch = #1}}
+
+\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
+
+\compattikzset{vdd/.style = {\comnpatname vcc = #1}}
+\compattikzset{vss/.style = {\comnpatname vee = #1}}
+
+\def\inheritlogicport#1#2{
+ \pgfdeclareshape{#2 port}{
+ \inheritsavedanchors[from=#1 #2 port]
+ \inheritbackgroundpath[from=#1 #2 port]
+ \inheritanchor[from=#1 #2 port]{in}
+ \inheritanchor[from=#1 #2 port]{in 1}
+ \inheritanchor[from=#1 #2 port]{in 2}
+ \inheritanchor[from=#1 #2 port]{out}
+ \inheritanchor[from=#1 #2 port]{center}
+ \inheritanchor[from=#1 #2 port]{left}
+ }
+}
+
+\ifpgf@circuit@europeanlogicport
+ \inheritlogicport{european}{and}
+ \inheritlogicport{european}{or}
+ \inheritlogicport{european}{xor}
+ \inheritlogicport{european}{not}
+ \inheritlogicport{european}{nand}
+ \inheritlogicport{european}{nor}
+ \inheritlogicport{european}{xnor}
+\else
+ \inheritlogicport{american}{and}
+ \inheritlogicport{american}{or}
+ \inheritlogicport{american}{xor}
+ \inheritlogicport{american}{not}
+ \inheritlogicport{american}{nand}
+ \inheritlogicport{american}{nor}
+ \inheritlogicport{american}{xnor}
+\fi
+
+% Transistor like bipoles
+
+\def\pgf@circ@trans@path#1#2{
+ \pgfextra{
+ \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+ \def\pgf@circ@temp{#2}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
+ \fi
+ }
+ \ifpgf@circuit@bipole@inverted
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgf@circ@slope{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathadd{\pgfmathresult}{-90}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
+ node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/value/name}}
+ \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
+ (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+\def\pgf@circ@definetranspath#1{
+ \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
+}
+
+\pgf@circ@definetranspath{elmech}
+\pgf@circ@definetranspath{nmos}
+\pgf@circ@definetranspath{pmos}
+\pgf@circ@definetranspath{npn}
+\pgf@circ@definetranspath{pnp}
+\pgf@circ@definetranspath{nfet}
+\pgf@circ@definetranspath{nigfete}
+\pgf@circ@definetranspath{nigfetd}
+\pgf@circ@definetranspath{nigfetebulk}
+\pgf@circ@definetranspath{pfet}
+\pgf@circ@definetranspath{pigfete}
+\pgf@circ@definetranspath{pigfetd}
+\pgf@circ@definetranspath{pigfetebulk}
+\pgf@circ@definetranspath{njfet}
+\pgf@circ@definetranspath{pjfet}
+\pgf@circ@definetranspath{pigbt}
+\pgf@circ@definetranspath{nigbt}
+\pgf@circ@definetranspath{Lpigbt}
+\pgf@circ@definetranspath{Lnigbt}%%%---------- close: tex/pgfcircpath
+
+\ifpgf@circ@siunitx
+ \RequirePackage{xstring}[2009/03/13]
+ %\expandafter\let\csname angstrom\endcsname\relax
+ \RequirePackage{siunitx}
+\fi
+
+
+
+\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
+%override (unused) circuitikz environment for compability to externalization)
+\let\circuitikz\tikzpicture
+\let\endcircuitikz\endtikzpicture
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.8.3.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.8.3.sty
new file mode 100644
index 00000000000..22100fdfd29
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz-0.8.3.sty
@@ -0,0 +1,11141 @@
+% Copyright 2007-2016 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+
+\NeedsTeXFormat{LaTeX2e}
+
+\def\pgfcircversion{0.8.3}
+\def\pgfcircversiondate{2017/05/28}
+
+\ProvidesPackage{circuitikz-0.8.3}
+ [\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
+
+%% Version 3.0 of pgf/TikZ is required
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\usepgflibrary{arrows}
+
+
+% The options are listed in the manual in this order
+
+\DeclareOption{europeanvoltage}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{straightvoltages}{
+ \pgf@circuit@bipole@voltage@straighttrue
+}
+
+\DeclareOption{americanvoltage}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrent}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrent}{
+ \ctikzset{current = american}
+}
+
+
+
+\DeclareOption{americanresistor}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistor}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductor}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductor}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductor}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanport}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{europeanport}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{european}{
+ \ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
+ \ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}
+}
+
+\DeclareOption{american}{
+ \ctikzset{voltage=american} \ctikzset{current=american} \ctikzset{resistor=american} \ctikzset{inductor=american} \ctikzset{gas filled surge arrester choice = american}
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{fulldiodes}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiodes}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{europeanvoltages}{
+ \ctikzset{voltage=european}
+}
+
+\DeclareOption{americanvoltages}{
+ \ctikzset{voltage=american}
+}
+
+\DeclareOption{europeancurrents}{
+ \ctikzset{current = european}
+}
+
+\DeclareOption{americancurrents}{
+ \ctikzset{current = american}
+}
+
+\DeclareOption{americanresistors}{
+ \ctikzset{resistor = american}
+}
+
+\DeclareOption{europeanresistors}{
+ \ctikzset{resistor = european}
+}
+
+\DeclareOption{americaninductors}{
+ \ctikzset{inductor = american}
+}
+
+\DeclareOption{europeaninductors}{
+ \ctikzset{inductor = european}
+}
+
+\DeclareOption{cuteinductors}{
+ \ctikzset{inductor = cute}
+}
+
+\DeclareOption{americanports}{
+ \ctikzset{logic ports = american}
+}
+
+\DeclareOption{europeanports}{
+ \ctikzset{logic ports = european}
+}
+
+\DeclareOption{americangfsurgearrester}{
+ \ctikzset{gas filled surge arrester choice = american}
+}
+
+\DeclareOption{europeangfsurgearrester}{
+ \ctikzset{gas filled surge arrester choice = european}
+}
+
+\DeclareOption{siunitx}{
+ \pgf@circ@siunitxtrue
+}
+
+\DeclareOption{nosiunitx}{
+ \pgf@circ@siunitxfalse
+}
+
+\DeclareOption{fulldiode}{
+ \ctikzset{diode = full}
+}
+
+\DeclareOption{emptydiode}{
+ \ctikzset{diode = empty}
+}
+
+\DeclareOption{strokediode}{
+ \ctikzset{diode = stroke}
+}
+
+\DeclareOption{arrowmos}{
+ \pgf@circuit@mos@arrowstrue
+}
+
+\DeclareOption{noarrowmos}{
+ \pgf@circuit@mos@arrowsfalse
+}
+
+\DeclareOption{fetbodydiode}{
+ \pgf@circuit@fet@bodydiodetrue
+}
+
+\DeclareOption{nofetbodydiode}{
+ \pgf@circuit@fet@bodydiodefalse
+}
+
+\DeclareOption{fetsolderdot}{
+ \pgf@circuit@fet@solderdottrue
+}
+
+\DeclareOption{nofetsolderdot}{
+ \pgf@circuit@fet@solderdotfalse
+}
+
+\DeclareOption{emptypmoscircle}{
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+
+\DeclareOption{lazymos}{
+ \ctikzset{tripoles/nmos/width=.5}
+ \ctikzset{tripoles/nmos/gate height=.35}
+ \ctikzset{tripoles/nmos/base height=.35}
+ \ctikzset{tripoles/nmos/height/.initial=1.2}
+ \ctikzset{tripoles/nmos/base width=.5}
+ \ctikzset{tripoles/nmos/gate width=.65}
+
+ \ctikzset{tripoles/pmos/width=.5}
+ \ctikzset{tripoles/pmos/gate height=.35}
+ \ctikzset{tripoles/pmos/base height=.35}
+ \ctikzset{tripoles/pmos/height/.initial=1.2}
+ \ctikzset{tripoles/pmos/base width=.5}
+ \ctikzset{tripoles/pmos/gate width=.65}
+
+ \pgf@circuit@pmos@emptycircletrue
+}
+
+\DeclareOption{straightlabels}{
+ \ctikzset{label/align = straight}
+}
+
+\DeclareOption{rotatelabels}{
+ \ctikzset{label/align = rotate}
+}
+
+\DeclareOption{smartlabels}{
+ \ctikzset{label/align = smart}
+}
+
+\DeclareOption{compatibility}{
+ \pgf@circuit@compattrue
+}
+
+\DeclareOption{oldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectiontrue
+}
+\DeclareOption{nooldvoltagedirection}{
+ \pgf@circ@oldvoltagedirectionfalse
+}
+
+\DeclareOption{betterproportions}{
+ \ctikzset{monopoles/ground/width/.initial=.15}
+
+ \ctikzset{bipoles/resistor/height/.initial=.23}
+ \ctikzset{bipoles/resistor/width/.initial=.6}
+ \ctikzset{bipoles/capacitor/height/.initial=.4}
+ \ctikzset{bipoles/capacitor/width/.initial=.1}
+ \ctikzset{bipoles/potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height/.initial=.6}
+ \ctikzset{bipoles/photoresistor/height 2/.initial=.23}
+ \ctikzset{bipoles/photoresistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistor/main/.initial=.7}
+ \ctikzset{bipoles/thermistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistor/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorntc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorntc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.23/.7
+ \ctikzset{bipoles/thermistorptc/width/.initial=.6}
+ \ctikzset{bipoles/thermistorptc/main/.initial=.7}
+ \ctikzset{bipoles/thermistorptc/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/main/.initial=.7}
+ \ctikzset{bipoles/varistor/height/.initial=.328}%.23/.7
+ \ctikzset{bipoles/varistor/width/.initial=.6}
+ \ctikzset{bipoles/vresistor/height/.initial=.45}
+ \ctikzset{bipoles/vresistor/width/.initial=.6}
+ \ctikzset{bipoles/generic/height/.initial=.23}
+ \ctikzset{bipoles/generic/width/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height/.initial=.6}
+ \ctikzset{bipoles/generic potentiometer/height 2/.initial=.23}
+ \ctikzset{bipoles/generic potentiometer/width/.initial=.6}
+ \ctikzset{bipoles/ageneric/height/.initial=.23}
+ \ctikzset{bipoles/ageneric/width/.initial=.6}
+ \ctikzset{bipoles/memristor/height/.initial=.23}
+ \ctikzset{bipoles/memristor/wave height/.initial=.375}
+ \ctikzset{bipoles/memristor/width/.initial=.60}
+ \ctikzset{bipoles/tgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tgeneric/width/.initial=.6}
+ \ctikzset{bipoles/tfullgeneric/height/.initial=.525}
+ \ctikzset{bipoles/tfullgeneric/width/.initial=.60}
+ \ctikzset{bipoles/fullgeneric/height/.initial=.23}
+ \ctikzset{bipoles/fullgeneric/width/.initial=.6}
+ \ctikzset{bipoles/diode/height/.initial=.3}
+ \ctikzset{bipoles/diode/width/.initial=.25}
+
+ \ctikzset{tripoles/thyristor/height/.initial=.66}
+ \ctikzset{tripoles/thyristor/height 2/.initial=.3}
+ \ctikzset{tripoles/thyristor/width/.initial=.6}
+ \ctikzset{tripoles/thyristor/diode height/.initial=.3}
+ \ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+ \ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+ \ctikzset{tripoles/triac/height/.initial=.66}
+ \ctikzset{tripoles/triac/width/.initial=.6}
+ \ctikzset{tripoles/triac/diode width left/.initial=.3}
+ \ctikzset{tripoles/triac/diode width right/.initial=.3}
+}
+
+%%%%%%%%%
+%%%%%%%%%%% Springe nach tex/pgfcirc.defines
+%%%---------- open: tex/pgfcirc.defines.tex
+
+%% Options
+
+%%%%%%%%%%%%
+%% Dimensions
+
+% coordinates
+\newdimen\pgf@circ@res@up
+\newdimen\pgf@circ@res@down
+\newdimen\pgf@circ@res@zero
+\newdimen\pgf@circ@res@left
+\newdimen\pgf@circ@res@right
+\newdimen\pgf@circ@res@other
+\newdimen\pgf@circ@res@step
+\newdimen\pgf@circ@res@temp
+% inital thickness
+\newdimen \pgfstartlinewidth
+%% Keys
+
+\long\def\pgf@circ@comment#1{}
+
+\def\circuitikzbasekey{/tikz/circuitikz}
+
+\pgfkeys{\circuitikzbasekey/.is family}
+
+\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
+\let\ctikzset\circuitikzset
+\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
+\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circuit@compat
+\newif\ifpgf@circ@oldvoltagedirection
+
+% Option ">" for twoports
+\newif\ifpgf@circuit@inputarrow
+\ctikzset{>/.add code={}{\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/.is choice}
+\ctikzset{inputarrow/true/.code={\pgf@circuit@inputarrowtrue}}
+\ctikzset{inputarrow/false/.code={\pgf@circuit@inputarrowfalse}}
+
+% Option "boxed" for nodes and twoports
+\newif\ifpgf@circuit@boxed
+\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
+\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
+
+% Option "dashed" for nodes and twoports
+\newif\ifpgf@circuit@dashed
+\pgfkeys{/tikz/dashed/.add code={}{\pgf@circuit@dashedtrue}}
+\ctikzset{dashed/.add code={}{\pgf@circuit@dashedtrue}}
+
+% Option "t=*" for nodes
+\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
+
+
+
+\ctikzset{bipoles/.is family}
+\ctikzset{bipoles/border margin/.initial=1.1}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{nodes width/.initial=.04}
+\newdimen\pgf@circ@Rlen
+\ctikzset{bipoles/length/.code={\pgf@circ@Rlen = #1}}
+\pgf@circ@Rlen = 1.4cm
+
+\ctikzset{monopoles/.is family}
+\ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/tground/thickness/.initial=3}
+\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/match/width/.initial=.4}
+\ctikzset{monopoles/chassis/width/.initial=.25}
+\ctikzset{monopoles/alternative chassis/width/.initial=.25}
+\ctikzset{monopoles/equipotentiality/width/.initial=.25}
+\ctikzset{monopoles/tlinestub/width/.initial=.25}
+\ctikzset{monopoles/antenna/width/.initial=.25}
+\ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/width/.initial=.25}
+\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/rxantenna/width/.initial=.25}
+
+\ctikzset{bipoles/resistor/height/.initial=.3}
+\ctikzset{bipoles/resistor/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/height/.initial=.8}
+\ctikzset{bipoles/potentiometer/height 2/.initial=.3}
+\ctikzset{bipoles/potentiometer/width/.initial=.8}
+\ctikzset{bipoles/photoresistor/height/.initial=.6}
+\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
+\ctikzset{bipoles/photoresistor/width/.initial=.8}
+\ctikzset{bipoles/thermistor/main/.initial=.7}
+\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/width/.initial=.8}
+\ctikzset{bipoles/thermistorntc/main/.initial=.7}
+\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistorptc/width/.initial=.8}
+\ctikzset{bipoles/thermistorptc/main/.initial=.7}
+\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistor/width/.initial=.8}
+\ctikzset{bipoles/varistor/main/.initial=.7}
+\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/varistor/width/.initial=.8}
+\ctikzset{bipoles/vresistor/height/.initial=.6}
+\ctikzset{bipoles/vresistor/width/.initial=.8}
+\ctikzset{bipoles/cuteinductor/height/.initial=.3}
+\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
+\ctikzset{bipoles/cuteinductor/width/.initial=.6}
+\ctikzset{bipoles/cuteinductor/coils/.initial=5}
+\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/americaninductor/height/.initial=.3}
+\ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+\ctikzset{bipoles/americaninductor/width/.initial=.8}
+\ctikzset{bipoles/americaninductor/coils/.initial=4}
+\ctikzset{bipoles/americaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
+\ctikzset{bipoles/vcuteinductor/width/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/coils/.initial=5}
+\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/vamericaninductor/height/.initial=.6}
+\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+\ctikzset{bipoles/vamericaninductor/width/.initial=.8}
+\ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/esource/height/.initial=.60}
+\ctikzset{bipoles/esource/width/.initial=.60}
+\ctikzset{bipoles/pvsource/height/.initial=.60}
+\ctikzset{bipoles/pvsource/width/.initial=.60}
+\ctikzset{bipoles/isource/height/.initial=.60}
+\ctikzset{bipoles/isource/width/.initial=.60}
+\ctikzset{bipoles/oosource/height/.initial=.60}
+\ctikzset{bipoles/oosource/width/.initial=.60}
+\ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/dcisource/height/.initial=.60}
+\ctikzset{bipoles/dcisource/width/.initial=.60}
+\ctikzset{bipoles/dcvsource/height/.initial=.60}
+\ctikzset{bipoles/dcvsource/width/.initial=.60}
+\ctikzset{bipoles/vsourcetri/height/.initial=.60}
+\ctikzset{bipoles/vsourcetri/width/.initial=.60}
+\ctikzset{bipoles/isourceam/height/.initial=.60}
+\ctikzset{bipoles/isourceam/width/.initial=.60}
+\ctikzset{bipoles/vsource/height/.initial=.60}
+\ctikzset{bipoles/vsource/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/height/.initial=.60}
+\ctikzset{bipoles/vsourceam/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/margin/.initial=.7}
+\ctikzset{bipoles/isourcesin/height/.initial=.60}
+\ctikzset{bipoles/isourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesin/height/.initial=.60}
+\ctikzset{bipoles/vsourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/height/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/width/.initial=.60}
+\ctikzset{bipoles/cisource/height/.initial=.7}
+\ctikzset{bipoles/cisource/width/.initial=.7}
+\ctikzset{bipoles/cisourceam/height/.initial=.7}
+\ctikzset{bipoles/cisourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsource/height/.initial=.7}
+\ctikzset{bipoles/cvsource/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/height/.initial=.7}
+\ctikzset{bipoles/cvsourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/margin/.initial=.7}
+\ctikzset{bipoles/cvsourceam/text scale/.initial=1}
+\ctikzset{bipoles/cisourcesin/width/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/height/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/width/.initial=.7}
+\ctikzset{bipoles/capacitor/height/.initial=.6}
+\ctikzset{bipoles/capacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/height/.initial=.5}
+\ctikzset{bipoles/ecapacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/font/.initial= \fontsize{6}{0}\selectfont\boldmath}
+\ctikzset{bipoles/pcapacitor/height/.initial=.6}
+\ctikzset{bipoles/pcapacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/vcapacitor/height/.initial=.6}
+\ctikzset{bipoles/vcapacitor/width/.initial=.5}
+\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/piezoelectric/height/.initial=.7}
+\ctikzset{bipoles/piezoelectric/width/.initial=.5}
+\ctikzset{bipoles/battery/height/.initial=.6}
+\ctikzset{bipoles/battery/width/.initial=.3}
+\ctikzset{bipoles/battery1/height/.initial=.6}
+\ctikzset{bipoles/battery1/width/.initial=.3}
+\ctikzset{bipoles/battery2/height/.initial=.6}
+\ctikzset{bipoles/battery2/width/.initial=.3}
+\ctikzset{bipoles/diode/height/.initial=.50}
+\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/varcap/height/.initial=.50}
+\ctikzset{bipoles/varcap/width/.initial=.45}
+\ctikzset{bipoles/spst/height/.initial=.35}
+\ctikzset{bipoles/spst/width/.initial=.35}
+\ctikzset{bipoles/spst/depth/.initial=.2}
+\ctikzset{bipoles/nos/height/.initial=.3}
+\ctikzset{bipoles/nos/width/.initial=.35}
+\ctikzset{bipoles/ncs/height/.initial=.35}
+\ctikzset{bipoles/ncs/width/.initial=.35}
+\ctikzset{bipoles/generic/height/.initial=.30}
+\ctikzset{bipoles/generic/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
+\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
+\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
+\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
+\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
+\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
+\ctikzset{bipoles/fuse/height/.initial=.20}
+\ctikzset{bipoles/fuse/width/.initial=.50}
+\ctikzset{bipoles/afuse/height/.initial=.20}
+\ctikzset{bipoles/afuse/width/.initial=.50}
+\ctikzset{bipoles/generic potentiometer/height/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
+\ctikzset{bipoles/generic potentiometer/width/.initial=.80}
+\ctikzset{bipoles/ageneric/height/.initial=.30}
+\ctikzset{bipoles/ageneric/width/.initial=.80}
+\ctikzset{bipoles/memristor/height/.initial=.30}
+\ctikzset{bipoles/memristor/wave height/.initial=.5}
+\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/tgeneric/height/.initial=.70}
+\ctikzset{bipoles/tgeneric/width/.initial=.80}
+\ctikzset{bipoles/tfullgeneric/height/.initial=.70}
+\ctikzset{bipoles/tfullgeneric/width/.initial=.80}
+\ctikzset{bipoles/fullgeneric/height/.initial=.30}
+\ctikzset{bipoles/fullgeneric/width/.initial=.80}
+\ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
+\ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
+\ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
+%\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
+%\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
+\ctikzset{bipoles/ammeter/height/.initial=.60}
+\ctikzset{bipoles/ammeter/width/.initial=.60}
+\ctikzset{bipoles/ohmmeter/height/.initial=.60}
+\ctikzset{bipoles/ohmmeter/width/.initial=.60}
+\ctikzset{bipoles/voltmeter/height/.initial=.60}
+\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/buffer/height/.initial=1}
+\ctikzset{bipoles/buffer/width/.initial=1}
+\ctikzset{bipoles/not port/width/.initial=1}
+\ctikzset{bipoles/not port/height/.initial=.8}
+\ctikzset{bipoles/not port/circle width/.initial=.15}
+\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/tline/height/.initial=.3}
+\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/squid/height/.initial=.60}
+\ctikzset{bipoles/squid/width/.initial=.60}
+\ctikzset{bipoles/barrier/height/.initial=.60}
+\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/thermocouple/height/.initial=.250}
+\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
+\ctikzset{bipoles/thermocouple/width/.initial=.140}
+\ctikzset{bipoles/pushbutton/height/.initial=.5}
+\ctikzset{bipoles/pushbutton/height 2/.initial=.0}
+\ctikzset{bipoles/pushbutton/width/.initial=.50}
+
+\ctikzset{bipoles/twoport/width/.initial=.7}
+\ctikzset{bipoles/twoport/height/.initial=.7}
+\ctikzset{bipoles/twoport/text/.initial=}
+\ctikzset{bipoles/vco/width/.initial=.7}
+\ctikzset{bipoles/bandpass/width/.initial=.7}
+\ctikzset{bipoles/bandstop/width/.initial=.7}
+\ctikzset{bipoles/highpass/width/.initial=.7}
+\ctikzset{bipoles/lowpass/width/.initial=.7}
+\ctikzset{bipoles/adc/width/.initial=.7}
+\ctikzset{bipoles/dac/width/.initial=.7}
+\ctikzset{bipoles/dsp/width/.initial=.7}
+\ctikzset{bipoles/fft/width/.initial=.7}
+\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/vamp/width/.initial=.7}
+\ctikzset{bipoles/piattenuator/width/.initial=.7}
+\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
+\ctikzset{bipoles/tattenuator/width/.initial=.7}
+\ctikzset{bipoles/vtattenuator/width/.initial=.7}
+\ctikzset{bipoles/phaseshifter/width/.initial=.7}
+\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
+\ctikzset{bipoles/detector/width/.initial=.7}
+
+
+\newif\ifpgf@circuit@trans@depletiontype
+\pgf@circuit@trans@depletiontypefalse
+
+\newif\ifpgf@circuit@mos@arrows
+\ctikzset{tripoles/mos style/.is choice}
+\ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}}
+\ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}}
+
+% Option solderdot for fet
+\newif\ifpgf@circuit@fet@solderdot
+\pgfkeys{/tikz/solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\ctikzset{solderdot/.add code={}{\pgf@circuit@fet@solderdottrue}}
+\pgfkeys{/tikz/nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+\ctikzset{nosolderdot/.add code={}{\pgf@circuit@fet@solderdotfalse}}
+
+% Option bodydiode for fet
+\newif\ifpgf@circuit@fet@bodydiode
+\pgfkeys{/tikz/bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\ctikzset{bodydiode/.add code={}{\pgf@circuit@fet@bodydiodetrue}}
+\pgfkeys{/tikz/nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+\ctikzset{nobodydiode/.add code={}{\pgf@circuit@fet@bodydiodefalse}}
+
+% Option draw fet without gate connection
+\newif\ifpgf@circuit@bpt@drawgate
+\pgf@circuit@bpt@drawgatetrue
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawgatefalse}}
+
+% Option draw bpt without base connection
+\newif\ifpgf@circuit@bpt@drawbase
+\pgf@circuit@bpt@drawbasetrue
+\pgfkeys{/tikz/nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nobase/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\pgfkeys{/tikz/nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+\ctikzset{nogate/.add code={}{\pgf@circuit@bpt@drawbasefalse}}
+
+% Option draw bpt with optical input
+\newif\ifpgf@circuit@bpt@drawphoto
+\pgf@circuit@bpt@drawphotofalse
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\pgfkeys{/tikz/photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf@circuit@bpt@drawphototrue}}
+
+% Option draw pmos with empty circle
+\newif\ifpgf@circuit@pmos@emptycircle
+\newif\ifpgf@circuit@pmos@emptycircle
+\pgf@circuit@pmos@emptycirclefalse
+\pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+\ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}}
+
+
+\newif\ifpgf@circuit@trans@ntype
+\pgf@circuit@trans@ntypetrue %default true
+%\newif\ifpgf@circuit@trans@ptype
+%\ctikzset{tripoles/nmos/.add code={\pgf@circuit@trans@ntypetrue}}
+\ctikzset{tripoles/nmos/width/.initial=.7}
+\ctikzset{tripoles/nmos/gate height/.initial=.35}
+\ctikzset{tripoles/nmos/base height/.initial=.5}
+\ctikzset{tripoles/nmos/conn height/.initial=0}
+\ctikzset{tripoles/nmos/height/.initial=1.1}
+\ctikzset{tripoles/nmos/base width/.initial=.5}
+\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nmos/curr direction/.initial=1}
+
+\ctikzset{tripoles/pmos/width/.initial=.7}
+\ctikzset{tripoles/pmos/gate height/.initial=.35}
+\ctikzset{tripoles/pmos/base height/.initial=.5}
+\ctikzset{tripoles/pmos/conn height/.initial=0}
+\ctikzset{tripoles/pmos/height/.initial=1.1}
+\ctikzset{tripoles/pmos/base width/.initial=.5}
+\ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pmos/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nfet/width/.initial=.7}
+\ctikzset{tripoles/nfet/gate height/.initial=.35}
+\ctikzset{tripoles/nfet/base height/.initial=.5}
+\ctikzset{tripoles/nfet/conn height/.initial=0}
+\ctikzset{tripoles/nfet/height/.initial=1.1}
+\ctikzset{tripoles/nfet/base width/.initial=.5}
+\ctikzset{tripoles/nfet/gate width/.initial=.62}
+\ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pfet/width/.initial=.7}
+\ctikzset{tripoles/pfet/gate height/.initial=.35}
+\ctikzset{tripoles/pfet/base height/.initial=.5}
+\ctikzset{tripoles/pfet/conn height/.initial=0}
+\ctikzset{tripoles/pfet/height/.initial=1.1}
+\ctikzset{tripoles/pfet/base width/.initial=.5}
+\ctikzset{tripoles/pfet/gate width/.initial=.62}
+\ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigfete/width/.initial=.7}
+\ctikzset{tripoles/nigfete/gate height/.initial=.35}
+\ctikzset{tripoles/nigfete/base height/.initial=.5}
+\ctikzset{tripoles/nigfete/conn height/.initial=.35}
+\ctikzset{tripoles/nigfete/height/.initial=1.1}
+\ctikzset{tripoles/nigfete/base width/.initial=.5}
+\ctikzset{tripoles/nigfete/gate width/.initial=.62}
+\ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfete/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetd/width/.initial=.7}
+\ctikzset{tripoles/nigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetd/base height/.initial=.5}
+\ctikzset{tripoles/nigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetd/height/.initial=1.1}
+\ctikzset{tripoles/nigfetd/base width/.initial=.5}
+\ctikzset{tripoles/nigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetd/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfete/width/.initial=.7}
+\ctikzset{tripoles/pigfete/gate height/.initial=.35}
+\ctikzset{tripoles/pigfete/base height/.initial=.5}
+\ctikzset{tripoles/pigfete/conn height/.initial=.35}
+\ctikzset{tripoles/pigfete/height/.initial=1.1}
+\ctikzset{tripoles/pigfete/base width/.initial=.5}
+\ctikzset{tripoles/pigfete/gate width/.initial=.62}
+\ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfete/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetd/width/.initial=.7}
+\ctikzset{tripoles/pigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetd/base height/.initial=.5}
+\ctikzset{tripoles/pigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetd/height/.initial=1.1}
+\ctikzset{tripoles/pigfetd/base width/.initial=.5}
+\ctikzset{tripoles/pigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetd/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetebulk/curr direction/.initial=-1}
+
+\ctikzset{tripoles/npn/width/.initial=.6}
+\ctikzset{tripoles/npn/base height/.initial=.45}
+\ctikzset{tripoles/npn/base height 2/.initial=.15}
+\ctikzset{tripoles/npn/base height/.initial=.4}
+\ctikzset{tripoles/npn/conn height/.initial=0}
+\ctikzset{tripoles/npn/height/.initial=1.1}
+\ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/npn/curr direction/.initial=1}
+
+\ctikzset{tripoles/pnp/width/.initial=.6}
+\ctikzset{tripoles/pnp/base height/.initial=.45}
+\ctikzset{tripoles/pnp/base height 2/.initial=.15}
+\ctikzset{tripoles/pnp/base height/.initial=.4}
+\ctikzset{tripoles/pnp/conn height/.initial=0}
+\ctikzset{tripoles/pnp/height/.initial=1.1}
+\ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pnp/curr direction/.initial=-1}
+
+\ctikzset{tripoles/pigbt/width/.initial=.6}
+\ctikzset{tripoles/pigbt/gate height/.initial=.45}
+\ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/pigbt/base height/.initial=.4}
+\ctikzset{tripoles/pigbt/conn height/.initial=0}
+\ctikzset{tripoles/pigbt/height/.initial=1.1}
+\ctikzset{tripoles/pigbt/gate width/.initial=.62}
+\ctikzset{tripoles/pigbt/base width/.initial=.5}
+\ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/nigbt/width/.initial=.6}
+\ctikzset{tripoles/nigbt/gate height/.initial=.45}
+\ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/nigbt/base height/.initial=.4}
+\ctikzset{tripoles/nigbt/conn height/.initial=0}
+\ctikzset{tripoles/nigbt/height/.initial=1.1}
+\ctikzset{tripoles/nigbt/gate width/.initial=.62}
+\ctikzset{tripoles/nigbt/base width/.initial=.5}
+\ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/Lpigbt/width/.initial=.6}
+\ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lpigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lpigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lpigbt/curr direction/.initial=-1}
+
+\ctikzset{tripoles/Lnigbt/width/.initial=.6}
+\ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lnigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lnigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/njfet/width/.initial=.7}
+\ctikzset{tripoles/njfet/gate height/.initial=.5}
+\ctikzset{tripoles/njfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/njfet/gate width/.initial=.5}
+\ctikzset{tripoles/njfet/conn height/.initial=.35}
+\ctikzset{tripoles/njfet/height/.initial=1.1}
+\ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/njfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pjfet/width/.initial=.7}
+\ctikzset{tripoles/pjfet/gate height/.initial=.5}
+\ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/pjfet/gate width/.initial=.5}
+\ctikzset{tripoles/pjfet/conn height/.initial=.35}
+\ctikzset{tripoles/pjfet/height/.initial=1.1}
+\ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pjfet/curr direction/.initial=-1}
+
+\ctikzset{tripoles/isfet/width/.initial=1}
+\ctikzset{tripoles/isfet/gate height/.initial=.35}
+\ctikzset{tripoles/isfet/base height/.initial=.5}
+\ctikzset{tripoles/isfet/height/.initial=1.1}
+\ctikzset{tripoles/isfet/base width/.initial=.3}
+\ctikzset{tripoles/isfet/gate width/.initial=.5}
+\ctikzset{tripoles/isfet/conn height/.initial=0}
+\ctikzset{tripoles/isfet/wave width/.initial=.16}
+\ctikzset{tripoles/isfet/wave amp/.initial=.06}
+\ctikzset{tripoles/isfet/waves y sep/.initial=.22}
+\ctikzset{tripoles/isfet/waves x sep/.initial=.8}
+\ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/isfet/curr direction/.initial=1}
+
+\newif\ifpgf@circuit@europeanlogicport
+\ctikzset{logic ports/.is choice}
+\ctikzset{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue } }
+\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse } }
+
+
+\ctikzset{tripoles/american and port/width/.initial=1.1}
+\ctikzset{tripoles/american and port/height/.initial=.8}
+\ctikzset{tripoles/american and port/port width/.initial=.7}
+\ctikzset{tripoles/american and port/input height/.initial=.5}
+\ctikzset{tripoles/american nand port/width/.initial=1.1}
+\ctikzset{tripoles/american nand port/height/.initial=.8}
+\ctikzset{tripoles/american nand port/port width/.initial=.7}
+\ctikzset{tripoles/american nand port/circle width/.initial=.15}
+\ctikzset{tripoles/american nand port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/width/.initial=1.1}
+\ctikzset{tripoles/american or port/height/.initial=.8}
+\ctikzset{tripoles/american or port/port width/.initial=.7}
+\ctikzset{tripoles/american or port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/input skip/.initial=.25}
+\ctikzset{tripoles/american or port/aaa/.initial=.6}
+\ctikzset{tripoles/american or port/bbb/.initial=.4}
+\ctikzset{tripoles/american or port/ccc/.initial=.5}
+\ctikzset{tripoles/american or port/ddd/.initial=.0}
+\ctikzset{tripoles/american nor port/width/.initial=1.1}
+\ctikzset{tripoles/american nor port/height/.initial=.8}
+\ctikzset{tripoles/american nor port/port width/.initial=.7}
+\ctikzset{tripoles/american nor port/input height/.initial=.5}
+\ctikzset{tripoles/american nor port/input skip/.initial=.25}
+\ctikzset{tripoles/american nor port/circle width/.initial=.15}
+\ctikzset{tripoles/american nor port/aaa/.initial=.6}
+\ctikzset{tripoles/american nor port/bbb/.initial=.4}
+\ctikzset{tripoles/american nor port/ccc/.initial=.5}
+\ctikzset{tripoles/american nor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xor port/width/.initial=1.1}
+\ctikzset{tripoles/american xor port/height/.initial=.8}
+\ctikzset{tripoles/american xor port/port width/.initial=.7}
+\ctikzset{tripoles/american xor port/input height/.initial=.5}
+\ctikzset{tripoles/american xor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xor port/distance/.initial=.1}
+\ctikzset{tripoles/american xor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/width/.initial=1.1}
+\ctikzset{tripoles/american xnor port/height/.initial=.8}
+\ctikzset{tripoles/american xnor port/port width/.initial=.7}
+\ctikzset{tripoles/american xnor port/input height/.initial=.5}
+\ctikzset{tripoles/american xnor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xnor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xnor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xnor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xnor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/european and port/width/.initial=1.4}
+\ctikzset{tripoles/european and port/height/.initial=.65}
+\ctikzset{tripoles/european and port/reserved/.initial=.6}
+\ctikzset{tripoles/european and port/input height/.initial=.6}
+\ctikzset{tripoles/european or port/width/.initial=1.4}
+\ctikzset{tripoles/european or port/height/.initial=.65}
+\ctikzset{tripoles/european or port/reserved/.initial=.6}
+\ctikzset{tripoles/european or port/input height/.initial=.6}
+\ctikzset{tripoles/european xor port/width/.initial=1.4}
+\ctikzset{tripoles/european xor port/height/.initial=.65}
+\ctikzset{tripoles/european xor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xor port/input height/.initial=.6}
+\ctikzset{tripoles/european nand port/width/.initial=1.4}
+\ctikzset{tripoles/european nand port/not height/.initial=.3}
+\ctikzset{tripoles/european nand port/not width/.initial=.8}
+\ctikzset{tripoles/european nand port/height/.initial=.65}
+\ctikzset{tripoles/european nand port/reserved/.initial=.6}
+\ctikzset{tripoles/european nand port/input height/.initial=.6}
+\ctikzset{tripoles/european not port/width/.initial=1.4}
+\ctikzset{tripoles/european not port/not height/.initial=.3}
+\ctikzset{tripoles/european not port/not width/.initial=.8}
+\ctikzset{tripoles/european not port/height/.initial=.65}
+\ctikzset{tripoles/european not port/reserved/.initial=.6}
+\ctikzset{tripoles/european not port/input height/.initial=0}
+\ctikzset{tripoles/european xnor port/width/.initial=1.4}
+\ctikzset{tripoles/european xnor port/not height/.initial=.3}
+\ctikzset{tripoles/european xnor port/not width/.initial=.8}
+\ctikzset{tripoles/european xnor port/height/.initial=.65}
+\ctikzset{tripoles/european xnor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xnor port/input height/.initial=.6}
+\ctikzset{tripoles/european nor port/width/.initial=1.4}
+\ctikzset{tripoles/european nor port/not height/.initial=.3}
+\ctikzset{tripoles/european nor port/not width/.initial=.8}
+\ctikzset{tripoles/european nor port/height/.initial=.65}
+\ctikzset{tripoles/european nor port/reserved/.initial=.6}
+\ctikzset{tripoles/european nor port/input height/.initial=.6}
+\ctikzset{tripoles/op amp/width/.initial=1.7}
+\ctikzset{tripoles/op amp/port width/.initial=.7}
+\ctikzset{tripoles/op amp/height/.initial=1.4}
+\ctikzset{tripoles/op amp/input height/.initial=.5}
+\ctikzset{tripoles/op amp/up pos/.initial=.45}
+\ctikzset{tripoles/op amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolut font size needed!
+\ctikzset{tripoles/en amp/width/.initial=1.7}
+\ctikzset{tripoles/en amp/port width/.initial=.7}
+\ctikzset{tripoles/en amp/height/.initial=1.6}
+\ctikzset{tripoles/en amp/input height/.initial=.3}
+\ctikzset{tripoles/en amp/up pos/.initial=.45}
+\ctikzset{tripoles/en amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolut font size needed!
+\ctikzset{tripoles/en amp/font2/.initial= \fontsize{14}{0}\selectfont\boldmath}%absolut font size needed!
+\ctikzset{tripoles/gm amp/width/.initial=1.7}
+\ctikzset{tripoles/gm amp/port width/.initial=.7}
+\ctikzset{tripoles/gm amp/height/.initial=1.4}
+\ctikzset{tripoles/gm amp/input height/.initial=.5}
+\ctikzset{tripoles/gm amp/up pos/.initial=.45}
+\ctikzset{tripoles/plain amp/width/.initial=1.7}
+\ctikzset{tripoles/plain amp/port width/.initial=.7}
+\ctikzset{tripoles/plain amp/height/.initial=1.4}
+\ctikzset{tripoles/plain amp/input height/.initial=.5}
+\ctikzset{tripoles/plain amp/up pos/.initial=.45}
+
+\ctikzset{tripoles/thyristor/height/.initial=1.10}
+\ctikzset{tripoles/thyristor/height 2/.initial=.5}
+\ctikzset{tripoles/thyristor/width/.initial=1.0}
+\ctikzset{tripoles/thyristor/diode height/.initial=.5}
+\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+\ctikzset{tripoles/triac/height/.initial=1.1}
+\ctikzset{tripoles/triac/width/.initial=1}
+\ctikzset{tripoles/triac/diode width left/.initial=.3}
+\ctikzset{tripoles/triac/diode width right/.initial=.3}
+
+\ctikzset{tripoles/spdt/width/.initial=.85}
+\ctikzset{tripoles/spdt/height/.initial=.45}
+\ctikzset{tripoles/spdt/margin/.initial=.45}
+
+\ctikzset{tripoles/toggleswitch/height/.initial=.8}
+\ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
+\ctikzset{tripoles/toggleswitch/width/.initial=.80}
+
+\ctikzset{tripoles/mixer/width/.initial=0.7}
+\ctikzset{tripoles/adder/width/.initial=0.7}
+\ctikzset{tripoles/circulator/width/.initial=.7}
+\ctikzset{tripoles/oscillator/width/.initial=.7}
+
+
+\ctikzset{tripoles/wilkinson/height/.initial=1.3}
+\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+
+\ctikzset{quadpoles/transformer/width/.initial=1.5}
+\ctikzset{quadpoles/transformer/width1/.initial=.4}
+\ctikzset{quadpoles/transformer/height/.initial=1.5}
+\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/width/.initial=1.5}
+\ctikzset{quadpoles/transformer core/height/.initial=1.5}
+\ctikzset{quadpoles/transformer core/core height/.initial=.5}
+\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/width/.initial=1.5}
+\ctikzset{quadpoles/gyrator/height/.initial=1.5}
+\ctikzset{quadpoles/fourport/width/.initial=1.3}
+\ctikzset{quadpoles/fourport/height/.initial=1.3}
+\ctikzset{quadpoles/coupler/width/.initial=1.3}
+\ctikzset{quadpoles/coupler/height/.initial=1.3}
+\ctikzset{quadpoles/coupler2/width/.initial=1.3}
+\ctikzset{quadpoles/coupler2/height/.initial=1.3}
+
+\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
+
+
+% %Mechanical section
+\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
+\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
+\ctikzset{bipoles/spring/height/.initial=.5}
+\ctikzset{bipoles/spring/width/.initial=.5}
+\ctikzset{bipoles/mass/height/.initial=.55}
+\ctikzset{bipoles/mass/box height/.initial=.4}
+\ctikzset{bipoles/mass/width/.initial=.5}
+
+\ctikzset{bipoles/damper/height/.initial=.35}
+\ctikzset{bipoles/damper/length/.initial=.3}
+\ctikzset{bipoles/damper/width/.initial=.4}
+
+
+\ctikzset{bipole/.is family}
+\ctikzset{bipole/kind/.initial = }
+\ctikzset{bipole/name/.initial = }
+\newif\ifpgf@circuit@bipole@isvoltage
+\ctikzset{bipole/is voltage/.is if=pgf@circuit@bipole@isvoltage}
+\newif\ifpgf@circuit@bipole@voltageoutsideofsymbol
+\ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf@circuit@bipole@voltageoutsideofsymbol}
+\newif\ifpgf@circuit@bipole@strokedsymbol
+\ctikzset{bipole/is strokedsymbol/.is if=pgf@circuit@bipole@strokedsymbol}
+\newif\ifpgf@circuit@bipole@iscurrent
+\ctikzset{bipole/is current/.is if=pgf@circuit@bipole@iscurrent}
+
+\ctikzset{bipole/voltage/.is family}
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+\newif\ifpgf@circuit@bipole@voltage@below
+\ctikzset{bipole/voltage/position/.is choice}
+\ctikzset{bipole/voltage/position/above/.code={\pgf@circuit@bipole@voltage@belowfalse}}
+\ctikzset{bipole/voltage/position/below/.code={\pgf@circuit@bipole@voltage@belowtrue}}
+
+\ctikzset{bipole/voltage/label/unit/.initial=}
+\ctikzset{bipole/voltage/label/name/.initial=}
+
+\ctikzset{bipole/current/.is family}
+\newif\ifpgf@circuit@bipole@current@backward
+\ctikzset{bipole/current/direction/.is choice}
+\ctikzset{bipole/current/direction/forward/.code={\pgf@circuit@bipole@current@backwardfalse}}
+\ctikzset{bipole/current/direction/backward/.code={\pgf@circuit@bipole@current@backwardtrue}}
+\newif\ifpgf@circuit@bipole@current@before
+\ctikzset{bipole/current/x position/.is choice}
+\ctikzset{bipole/current/x position/after/.code={\pgf@circuit@bipole@current@beforefalse}}
+\ctikzset{bipole/current/x position/before/.code={\pgf@circuit@bipole@current@beforetrue}}
+\newif\ifpgf@circuit@bipole@current@below
+\ctikzset{bipole/current/y position/.is choice}
+\ctikzset{bipole/current/y position/above/.code={\pgf@circuit@bipole@current@belowfalse}}
+\ctikzset{bipole/current/y position/below/.code={\pgf@circuit@bipole@current@belowtrue}}
+\ctikzset{bipole/current/label/unit/.initial=}
+\ctikzset{bipole/current/label/name/.initial=}
+
+\ctikzset{bipole/flow/.is family}
+\newif\ifpgf@circuit@bipole@flow@backward
+\ctikzset{bipole/flow/direction/.is choice}
+\ctikzset{bipole/flow/direction/forward/.code={\pgf@circuit@bipole@flow@backwardfalse}}
+\ctikzset{bipole/flow/direction/backward/.code={\pgf@circuit@bipole@flow@backwardtrue}}
+\newif\ifpgf@circuit@bipole@flow@before
+\ctikzset{bipole/flow/x position/.is choice}
+\ctikzset{bipole/flow/x position/after/.code={\pgf@circuit@bipole@flow@beforefalse}}
+\ctikzset{bipole/flow/x position/before/.code={\pgf@circuit@bipole@flow@beforetrue}}
+\newif\ifpgf@circuit@bipole@flow@below
+\ctikzset{bipole/flow/y position/.is choice}
+\ctikzset{bipole/flow/y position/above/.code={\pgf@circuit@bipole@flow@belowfalse}}
+\ctikzset{bipole/flow/y position/below/.code={\pgf@circuit@bipole@flow@belowtrue}}
+\ctikzset{bipole/flow/label/unit/.initial=}
+\ctikzset{bipole/flow/label/name/.initial=}
+\ctikzset{flow/distance/.initial = .5}
+\ctikzset{flow/offset/.initial = .2}%distance between flow-arrow and conductor
+
+
+\ctikzset{bipole/label/.is family}
+\ctikzset{bipole/label/position/.initial=90}
+\ctikzset{bipole/label/unit/.initial=}
+\ctikzset{bipole/label/name/.initial=}
+\ctikzset{bipole/annotation/.is family}
+\ctikzset{bipole/annotation/position/.initial=-90}
+\ctikzset{bipole/annotation/unit/.initial=}
+\ctikzset{bipole/annotation/name/.initial=}
+\ctikzset{bipole/nodes/.is family}
+\ctikzset{bipole/nodes/left/.is choice}
+\ctikzset{bipole/nodes/left/none/.code={\ctikzsetvalof{bipole/nodes/left}{none}}}
+\ctikzset{bipole/nodes/left/empty/.code={\ctikzsetvalof{bipole/nodes/left}{empty}}}
+\ctikzset{bipole/nodes/left/full/.code={\ctikzsetvalof{bipole/nodes/left}{full}}}
+\ctikzset{bipole/nodes/left/diamond/.code={\ctikzsetvalof{bipole/nodes/left}{diamond}}}
+\ctikzset{bipole/nodes/left/rectjoinfill/.code={\ctikzsetvalof{bipole/nodes/left}{rectjoinfill}}}
+\ctikzset{bipole/nodes/right/.is choice}
+\ctikzset{bipole/nodes/right/none/.code={\ctikzsetvalof{bipole/nodes/right}{none}}}
+\ctikzset{bipole/nodes/right/empty/.code={\ctikzsetvalof{bipole/nodes/right}{empty}}}
+\ctikzset{bipole/nodes/right/full/.code={\ctikzsetvalof{bipole/nodes/right}{full}}}
+\ctikzset{bipole/nodes/right/diamond/.code={\ctikzsetvalof{bipole/nodes/right}{diamond}}}
+\ctikzset{bipole/nodes/right/rectjoinfill/.code={\ctikzsetvalof{bipole/nodes/right}{rectjoinfill}}}
+
+
+
+
+\newif\ifpgf@circuit@europeanresistor
+\ctikzset{resistor/.is choice}
+\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse }
+\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue }
+
+\ctikzset{inductor/.is choice}
+\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
+\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
+\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+
+\newif\ifpgf@circuit@strokediode
+\newif\ifpgf@circuit@fulldiode
+\pgf@circuit@strokediodefalse
+\pgf@circuit@fulldiodefalse
+
+\ctikzset{diode/.is choice}
+\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
+\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
+\ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
+
+\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full }}
+\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty }}
+\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke }}
+
+\ctikzset{thickness/.initial=2}
+\ctikzset{color/.initial=black}
+\pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
+
+
+\newif\ifpgf@circ@siunitx
+\newif\ifpgf@circ@siunitx@res
+
+\ctikzset{straight/.is choice}
+\ctikzset{straightvoltage value/.initial=true}
+\ctikzset{straight/true/.code = {\pgf@circuit@bipole@voltage@straighttrue}}
+\ctikzset{straight/false/.code = {\pgf@circuit@bipole@voltage@straightfalse}}
+\ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
+\newif\ifpgf@circuit@bipole@voltage@straight
+\ctikzset{bipole/straight/.is if=pgf@circuit@bipole@voltage@straight}
+
+
+\ctikzset{voltage/.is family}
+\ctikzset{voltage/distance from node/.initial=.5} %\pgf@circ@Rlen units
+\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
+\ctikzset{voltage/bump a/.initial=1.2}
+\ctikzset{voltage/bump b/.initial=1.5}
+\ctikzset{voltage/european label distance/.initial=1.4}
+\ctikzset{voltage/american label distance/.initial=1.1}
+% special cases
+\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
+\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
+\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
+\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
+\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
+%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
+%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
+
+\ctikzset{current/.is family}
+\ctikzset{current/distance/.initial = .5}
+
+
+\tikzset{american currents/.style = { \circuitikzbasekey/current = american } }
+\tikzset{european currents/.style = { \circuitikzbasekey/current = european } }
+\tikzset{american voltages/.style = { \circuitikzbasekey/voltage = american } }
+\tikzset{european voltages/.style = { \circuitikzbasekey/voltage = european } }
+\tikzset{american resistors/.style = { \circuitikzbasekey/resistor = american } }
+\tikzset{european resistors/.style = { \circuitikzbasekey/resistor = european } }
+
+\newif\ifpgf@circuit@europeangfsurgearrester
+\ctikzset{gas filled surge arrester choice/.is choice}
+\ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue } }
+\ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse } }
+
+\tikzset{american gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=american } }
+\tikzset{european gas filled surge arrester set/.style = { \circuitikzbasekey/gas filled surge arrester choice=european } }
+\tikzset{american inductors/.style = { \circuitikzbasekey/inductor = american } }
+\tikzset{european inductors/.style = { \circuitikzbasekey/inductor = european } }
+\tikzset{cute inductors/.style = { \circuitikzbasekey/inductor = cute } }
+\tikzset{american ports/.style = { \circuitikzbasekey/logic ports = american } }
+\tikzset{european ports/.style = { \circuitikzbasekey/logic ports = european } }
+\tikzset{european/.style = { european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set} }
+\tikzset{american/.style = { american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set} }
+\tikzset{cute/.style = { european currents, european voltages, american resistors, cute inductors, american ports } }
+
+% I should try to make the tree clearer (this voltaege conflicts with the options above)
+
+\newif\ifpgf@circuit@europeanvoltage
+\ctikzset{voltage/.is choice}
+\ctikzset{voltage/american/.code = {\pgf@circuit@europeanvoltagefalse } }
+\ctikzset{voltage/european/.code = {\pgf@circuit@europeanvoltagetrue } }
+
+\newif\ifpgf@circuit@europeancurrent
+\ctikzset{current/.is choice}
+\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse }
+\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue }
+
+\ctikzset{label/align/.is choice}
+\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
+\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
+\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+
+%%%%%%%%%% new
+\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+%%%---------- close: tex/pgfcirc.defines
+%%%%%%%%%%% Springe nach tex/pgfcircutils
+%%%---------- open: tex/pgfcircutils.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%\def\pgf@circ@handleSI#1{%
+ % \pgf@circ@siunitx@resfalse
+%
+ % \edef\len{\stringlength[e]{#1}}
+ %\testmatchingchar[e]{#1}{\len}{>}%
+ %\ifmatchingchar%
+ % \ifnum\findchars{#1}{<}=0
+ % \def\pgf@circ@handleSI@val{\substring{#1}{1}{\findchars{#1}{<}-1}}
+ %\def\pgf@circ@handleSI@unit{\substring{#1}{\findchars{#1}{<}-1}+1}{\stringlength{#1}}
+ %\pgf@circ@siunitx@restrue
+% \else
+% \fi
+ %\else
+ %\fi
+%}
+
+\def\pgf@circ@handleSI#1{
+ \noexpandarg
+ \def\pgf@temp{}
+ \StrBetween{#1}{<}{>}[\pgf@circ@handleSI@unit]
+ \StrLen{\pgf@circ@handleSI@unit}[\pgf@circ@handleSI@unit@len]
+
+ \ifnum\pgf@circ@handleSI@unit@len=0
+ \pgf@circ@siunitx@resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf@circ@siunitx@restrue
+ \noexpandarg
+ \StrBefore{#1}{<}[\pgf@circ@handleSI@val]
+ %\typeout{si |#1|}
+ }{
+ \pgf@circ@siunitx@resfalse
+ %\typeout{no si |#1|}
+ }
+ \fi
+}
+
+\def\pgf@circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf@circ@temp}
+ \edef\pgf@temp{}
+ }
+ \ifx\pgf@circ@temp\pgf@temp
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Math routines
+
+\def\pgf@circ@stripdecimals#1.#2\pgf@nil{#1}
+
+
+%%%---------- close: tex/pgfcircutils
+
+%%%%%%%%%%% Springe nach tex/pgfcircshapes
+%%%---------- open: tex/pgfcircshapes.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Other shapes
+
+
+%% Nothing
+
+\pgfdeclareshape{emptyshape}{
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \northeast
+ \pgf@y=-\pgf@y
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \northeast
+ \pgf@y=0cm
+ \pgf@x=-\pgf@x
+ }
+ \anchor{text}{%
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+}
+
+%% Full terminal
+
+\pgfdeclareshape{circ}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Empty terminal
+
+\pgfdeclareshape{ocirc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+}{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
+ }
+
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Diamond terminal
+
+\pgfdeclareshape{diamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@temp}{\pgf@circ@res@up+\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp}{\pgf@circ@res@up-\pgf@circ@res@temp}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% Fill for correct rectangular joins
+
+\pgfdeclareshape{rectjoinfill}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfpathrectanglecorners
+ {\pgfpoint{0}{.5\pgflinewidth}}
+ {\pgfpoint{0}{-.5\pgflinewidth}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+
+%% Current arrow
+
+\pgfdeclareshape{currarrow}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 16
+ \pgf@x =\pgf@circ@res@step
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw,fill}
+
+ \endpgfscope
+ }
+
+}
+
+%% Flow arrow
+
+\pgfdeclareshape{flowarrow}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 16
+ \pgf@x =\pgf@circ@res@step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+ }
+}
+
+%% Input arrow
+
+\pgfdeclareshape{inputarrow}{
+ \savedanchor{\tip}{
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \tip
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 16
+
+ \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{fill}
+
+ \endpgfscope
+ }
+
+}
+
+
+%% box
+
+\pgfdeclareshape{box}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+
+}
+
+%%%---------- close: tex/pgfcircshapes
+%%%%%%%%%%% Springe nach tex/pgfcircmonopoles
+%%%---------- open: tex/pgfcircmonopoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Monopoles
+
+%% Ground symbol
+
+\pgfdeclareshape{ground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+
+
+\pgfdeclareshape{rground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{tground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ %\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{sground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{draw}
+
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+% noiseless ground
+\pgfdeclareshape{nground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{1.3\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpatharc{0}{180}{1.3\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% protective ground
+\pgfdeclareshape{pground}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ %\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathcircle{\pgfpoint{0pt}{-\pgf@circ@res@step}} {1.2\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+% chassis ground
+\pgfdeclareshape{cground}{
+\anchor{center}{
+ \pgfpointorigin
+}
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/chassis/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-1.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Contributed by Leonardo Azzinnari
+\pgfdeclareshape{tlinestub}{
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfpatharc{90}{-90}{0.125\pgf@circ@res@step and 0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+
+
+\pgfdeclareshape{antenna}{
+\anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+
+ % \pgfpathmoveto{\pgfpointorigin}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ % \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ % \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgftransformxshift{ -4\pgf@circ@res@step }
+
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{txantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{5.5\pgf@circ@res@step}{6\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{30}{-30}{2\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{7\pgf@circ@res@step}}
+ \pgfpatharc{30}{-30}{4\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+ }
+
+
+\pgfdeclareshape{rxantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@Rlen
+ \pgf@x=5\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=6\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{5\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{6\pgf@circ@res@step}{7\pgf@circ@res@step}}
+% \pgfpatharc{60}{-60}{\pgf@circ@res@step and \pgf@circ@res@step}
+ \pgfpatharc{150}{210}{4\pgf@circ@res@step} \pgfpathmoveto{\pgfpoint{6.5\pgf@circ@res@step}{6.75\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7\pgf@circ@res@step}{6.5\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{3\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf@circ@res@step}{6.25\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2.5\pgf@circ@res@step}
+ \pgfpathmoveto{\pgfpoint{8\pgf@circ@res@step}{6\pgf@circ@res@step}}
+ \pgfpatharc{150}{210}{2\pgf@circ@res@step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Vcc
+\pgfdeclareshape{vcc}{
+\anchor{center}{\pgfpointorigin}
+\anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=2\pgf@circ@res@step
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+}
+
+}
+
+% Vee
+\pgfdeclareshape{vee}{
+\anchor{center}{\pgfpointorigin}
+\anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=-2\pgf@circ@res@step
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+
+\behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+}
+
+}
+
+
+% match
+\pgfdeclareshape{match}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgf@x=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+ \pgf@x=1.5\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \pgf@y=-1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
+ \pgfusepath{fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \endpgfscope
+ }
+
+}
+
+
+%%%---------- close: tex/pgfcircmonopoles
+%%%%%%%%%%% Springe nach tex/pgfcircbipoles
+%%%---------- open: tex/pgfcircbipoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%% Generic macro for defining a bipole shape
+% #1 - additional anchors
+% #2 - lower y-size of the bipole (from the center).
+% #3 - #shape is the name of the shape
+% #4 - upper y-size of the bipole (from the center)
+% #5 - width of the bipole
+% #6 - macros drawing the bipole
+
+
+\long\def\pgfcircdeclarebipole#1#2#3#4#5#6{
+ \pgfdeclareshape{#3shape}{
+
+ \savedanchor{\northeast}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\northeastborder}{
+ \pgf@y=#4\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwestborder}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{bipoles/border margin}\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=\ctikzvalof{bipoles/border margin}\pgf@x
+ }
+ \savedanchor{\southwest}{
+ \pgf@y=-#2\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-#5\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor{\centerpoint}{
+ \pgf@circ@res@down=-#2\pgf@circ@Rlen
+ \pgf@circ@res@up=#4\pgf@circ@Rlen
+ \pgfpointorigin
+ \pgf@y=\pgf@circ@res@up
+ \advance\pgf@y by\pgf@circ@res@down
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{n}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{ne}{
+ \northeast
+ }
+ \anchor{nw}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{e}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{s}{%
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{se}{%
+ \southwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{sw}{%
+ \southwest
+ }
+ \anchor{w}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{east}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{south}{%
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{west}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{right}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{above}{
+ \northeast
+ \pgf@x=0cm
+ }
+ \anchor{left}{%
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{below}{%
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{a}{%
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{b} {
+ \southwest
+ \pgf@y=0cm
+ }
+ \savedanchor{\textanchor}{%
+ \pgf@y=\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \anchor{text}{%
+ \textanchor
+ }
+ \anchorborder{%
+ \ifpgf@circuit@bipole@inverted
+ \pgf@circ@res@left=-\pgf@x
+ \pgf@circ@res@right=-\pgf@y
+ \else
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@right=\pgf@y
+ \fi
+ \ifdim\pgf@circ@res@right>0cm
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\northeastborder}
+ \else
+ \southwestborder
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@right}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
+ \fi
+ }
+
+ #1
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@zero = 0cm
+ \pgf@circ@res@left = -\pgf@x
+ \pgf@circ@res@right = \pgf@x
+ \southwest
+ \pgf@circ@res@down = \pgf@y
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ #6
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Standard bipole shapes declarations
+
+%% Resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/resistor/height}}{resistor}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \divide \pgf@circ@res@step by 12
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+
+
+%% Variable resistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vresistor/height}}{vresistor}{\ctikzvalof{bipoles/vresistor/height}}{\ctikzvalof{bipoles/vresistor/width}}{ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \divide \pgf@circ@res@step by 12
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/capacitor/height}}{capacitor}{\ctikzvalof{bipoles/capacitor/height}}{\ctikzvalof{bipoles/capacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/capacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+%% Polar Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pcapacitor/height}}{polarcapacitor}{\ctikzvalof{bipoles/pcapacitor/height}}{\ctikzvalof{bipoles/pcapacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/pcapacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgftransformrotate{-90}
+ \pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+}
+
+%% Electrolytic Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ecapacitor/height}}{ecapacitor}{\ctikzvalof{bipoles/ecapacitor/height}}{\ctikzvalof{bipoles/ecapacitor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/ecapacitor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+ \pgfsetrectcap
+ % % % Draw plus pole
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ % % Draw minus pole
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{black}
+ \pgfusepath{draw,fill}
+ \pgfsetfillcolor{black}
+ % % plus pole annotation
+ \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
+ {\pgfkeysvalueof{/tikz/circuitikz/bipoles/ecapacitor/font} $+$}
+}
+
+%% Battery
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery/height}}{battery}{\ctikzvalof{bipoles/battery/height}}{\ctikzvalof{bipoles/battery/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 6
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+%% Battery 1 % poles with equl thickness
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Battery 2 % negative pole thicker
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery2/height}}{battery2}{\ctikzvalof{bipoles/battery2/height}}{\ctikzvalof{bipoles/battery2/width}}{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+%% cute inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/lower coil height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% variable cute inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}{vcuteinductor}{\ctikzvalof{bipoles/vcuteinductor/height}}{\ctikzvalof{bipoles/vcuteinductor/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/vcuteinductor/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down}
+ }
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/americaninductor/height 2}}{americaninductor}{\ctikzvalof{bipoles/americaninductor/height}}{\ctikzvalof{bipoles/americaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@Rlen
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% variable american inductor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vamericaninductor/height 2}}{vamericaninductor}{\ctikzvalof{bipoles/vamericaninductor/height}}{\ctikzvalof{bipoles/vamericaninductor/width}}{
+ \pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@Rlen
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils}
+ \divide \pgf@circ@res@step by 2
+ \pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Independent voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsource/height}}{vsource}{\ctikzvalof{bipoles/vsource/height}}{\ctikzvalof{bipoles/vsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+%% Independent voltage source - American style
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourceam/height}}{vsourceAM}{\ctikzvalof{bipoles/vsourceam/height}}{\ctikzvalof{bipoles/vsourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{$+$}
+ \fi
+}
+
+
+
+%% Independent sinusoidal voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesin/height}}{vsourcesin}{\ctikzvalof{bipoles/vsourcesin/height}}{\ctikzvalof{bipoles/vsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+% Square Voltage source - contributed by Alistair Kwan
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcesquare/height}}{vsourcesquare}{\ctikzvalof{bipoles/vsourcesquare/height}}{\ctikzvalof{bipoles/vsourcesquare/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source - contributed by Ralf Farkas
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vsourcetri/height}}{vsourcetri}{\ctikzvalof{bipoles/vsourcetri/height}}{\ctikzvalof{bipoles/vsourcetri/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Empty Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% PV Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pvsource/height}}{pvsource}{\ctikzvalof{bipoles/pvsource/height}}{\ctikzvalof{bipoles/pvsource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %Arrow Part
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty Source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/esource/height}}{esource}{\ctikzvalof{bipoles/esource/height}}{\ctikzvalof{bipoles/esource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% DC Current Source with open shape
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcisource/height}}{dcisource}{\ctikzvalof{bipoles/dcisource/height}}{\ctikzvalof{bipoles/dcisource/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}}\pgfpatharc{0}{-90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{270}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}\pgfpatharc{180}{90}{0.85\pgf@circ@res@right and \pgf@circ@res@up}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% DC-Voltage source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dcvsource/height}}{dcvsource}{\ctikzvalof{bipoles/dcvsource/height}}{\ctikzvalof{bipoles/dcvsource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}}
+ \pgfusepath{draw}
+}
+
+
+%% Independent current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isource}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Independent double oo source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/oosource/height}}{oosource}{\ctikzvalof{bipoles/oosource/height}}{\ctikzvalof{bipoles/oosource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
+ \pgfusepath{draw}
+}
+
+
+%% Independent current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isourceam/height}}{isourceAM}{\ctikzvalof{bipoles/isourceam/height}}{\ctikzvalof{bipoles/isourceam/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+
+%% Independent sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/isource/height}}{isourcesin}{\ctikzvalof{bipoles/isource/height}}{\ctikzvalof{bipoles/isource/width}}{
+ \pgfpointorigin
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+%% Controlled voltage source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsource/height}}{cvsource}{\ctikzvalof{bipoles/cvsource/height}}{\ctikzvalof{bipoles/cvsource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled voltage source - American
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourceam/height}}{cvsourceAM}{\ctikzvalof{bipoles/cvsourceam/height}}{\ctikzvalof{bipoles/cvsourceam/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \ifpgf@circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$-$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{$-$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{$+$}
+ \fi
+}
+
+
+%% Controlled sinusoidal voltage source
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cvsourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+%% Controlled sinusoidal current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cvsourcesin/height}}{cisourcesin}{\ctikzvalof{bipoles/cvsourcesin/height}}{\ctikzvalof{bipoles/cvsourcesin/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Controlled current source
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Controlled current source - American
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% Black generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black alternative zigzag Zener diode
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullsdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Black tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulltdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulllediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+}
+
+%% Black photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fullpdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Black varcap
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varcap/height}}{fullvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfusepath{draw,fill}
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty generic diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptydiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty Zener diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty alternative zigzag Zener diode
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptyzzdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Empty Schottky diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptysdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty tunnel diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptytdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty light emitting diode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptylediode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty photodiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{emptypdiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Empty varcap
+
+\pgfcircdeclarebipole{
+ \anchor{strokepathstart}{
+ \northeast
+ \pgf@y=0cm
+ \advance\pgf@x by -\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth
+ \advance\pgf@x by -\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth
+ }
+ \anchor{strokepathend}{
+ \northeast
+ \pgf@y=0cm
+ }
+ }{\ctikzvalof{bipoles/varcap/height}}{emptyvarcap}{\ctikzvalof{bipoles/varcap/height}}{\ctikzvalof{bipoles/varcap/width}}{
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% (Closing) SPST
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spst/depth}}{cspst}{\ctikzvalof{bipoles/spst/height}}{\ctikzvalof{bipoles/spst/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0\pgf@circ@res@down}}
+ \pgfpatharcto{1.2\pgf@circ@res@right}{1.2\pgf@circ@res@right}{0}{0}{1}{\pgfpoint{.9\pgf@circ@res@left}{.9\pgf@circ@res@up}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+%% Opening SPST
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spst/depth}}{ospst}{\ctikzvalof{bipoles/spst/height}}{\ctikzvalof{bipoles/spst/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfpatharcto{1.1\pgf@circ@res@right}{1.1\pgf@circ@res@right}{0}{0}{1}{\pgfpoint{.7\pgf@circ@res@left}{.9\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@left}{1\pgf@circ@res@up}}
+ \pgfsetarrowsend{latex'}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+%% Normal open Switch
+\pgfcircdeclarebipole{}{0}{nos}{\ctikzvalof{bipoles/nos/height}}{\ctikzvalof{bipoles/nos/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+}
+
+%% Normal closed Switch
+\pgfcircdeclarebipole{}{0}{ncs}{\ctikzvalof{bipoles/ncs/height}}{\ctikzvalof{bipoles/ncs/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% Push Button
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/pushbutton/height 2}}{pushbutton}{\ctikzvalof{bipoles/pushbutton/height}}{\ctikzvalof{bipoles/pushbutton/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+% % METERINGSHAPE
+\long\def\drawmeteringcircle{
+ \def\pgf@circ@temp{right}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \def\pgf@circ@temp{below}
+ \ifx\tikz@res@label@pos\pgf@circ@temp
+ \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ \else
+ \pgf@circ@res@step=1.2\pgf@circ@res@up
+ \fi
+ \fi
+ %draw connections to circle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ %draw circle
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw arrow
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%AMPEREMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ammeter/height}}{ammeter}{\ctikzvalof{bipoles/ammeter/height}}{\ctikzvalof{bipoles/ammeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\textbf{A}}{}{}
+}
+%OHMMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ohmmeter/height}}{ohmmeter}{\ctikzvalof{bipoles/ohmmeter/height}}{\ctikzvalof{bipoles/ohmmeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
+}
+%VOLTMETER
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/voltmeter/height}}{voltmeter}{\ctikzvalof{bipoles/voltmeter/height}}{\ctikzvalof{bipoles/voltmeter/width}}{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\textbf{V}}{}{}
+
+}
+
+%% Short circuit
+
+\pgfcircdeclarebipole{}{0}{short}{0}{0}{ }
+
+%% Open circuit
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/open/height}}{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{
+
+}
+
+%% Generic bipole - used as resistor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/generic/height}}{generic}{\ctikzvalof{bipoles/generic/height}}{\ctikzvalof{bipoles/generic/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+%% fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+}
+
+
+
+%% Generic bipole, filled - used as inductor by some (bleah)
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fullgeneric/height}}{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw,fill}
+}
+
+
+%% Generic asymmetric bipole
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/ageneric/height}}{ageneric}{\ctikzvalof{bipoles/ageneric/height}}{\ctikzvalof{bipoles/ageneric/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+%% asymmetric fuse
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/afuse/height}}{afuse}{\ctikzvalof{bipoles/afuse/height}}{\ctikzvalof{bipoles/afuse/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Memristor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/memristor/height}}{memristor}{\ctikzvalof{bipoles/memristor/height}}{\ctikzvalof{bipoles/memristor/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
+}
+
+
+
+
+%% Generic empty tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tgeneric/height}}{tgeneric}{\ctikzvalof{bipoles/tgeneric/height}}{\ctikzvalof{bipoles/tgeneric/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Photoresistor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/photoresistor/height 2}}{photoresistor}{\ctikzvalof{bipoles/photoresistor/height}}{\ctikzvalof{bipoles/photoresistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+%% Thermistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistor/height}}{thermistor}{\ctikzvalof{bipoles/thermistor/height}}{\ctikzvalof{bipoles/thermistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+
+%% Thermistor PTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorptc/height 2}}{thermistorptc}{\ctikzvalof{bipoles/thermistorptc/height}}{\ctikzvalof{bipoles/thermistorptc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorptc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% Thermistor NTC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/thermistorntc/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+%% thermocouple
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermocouple/height 2}}{thermocouple}{\ctikzvalof{bipoles/thermocouple/height}}{\ctikzvalof{bipoles/thermocouple/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfusepath{draw}
+}
+
+%% Varistor
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/varistor/height}}{varistor}{\ctikzvalof{bipoles/varistor/height}}{\ctikzvalof{bipoles/varistor/width}}{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\pgfkeysvalueof{/tikz/circuitikz/bipoles/varistor/main}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\tiny\textsf{U}}}
+}
+
+
+
+%% Generic full tunable
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tfullgeneric/height}}{tfullgeneric}{\ctikzvalof{bipoles/tfullgeneric/height}}{\ctikzvalof{bipoles/tfullgeneric/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+
+
+
+
+
+%% Variable Capacitor
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vcapacitor/height}}{vcapacitor}{\ctikzvalof{bipoles/vcapacitor/height}}{\ctikzvalof{bipoles/vcapacitor/width}}{
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf@circ@res@right
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfusepath{draw}
+}
+
+
+%% Piezoelectric Element
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piezoelectric/height}}{piezoelectric}{\ctikzvalof{bipoles/piezoelectric/height}}{\ctikzvalof{bipoles/piezoelectric/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 5
+
+ %% Outer markings
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ %% Inner Box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left+4}{\pgf@circ@res@up-1}}{\pgfpoint{\pgf@circ@res@right-4}{\pgf@circ@res@down+1}}
+ \pgfusepath{draw}
+
+}
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Handling of terminals
+
+
+%% Easily usable styles
+
+\ctikzset{o-o/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{-o/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{*-o/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-*/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-o/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{o-d/.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{*-/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-*/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{-d/.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{*-*/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{d-*/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=diamond}}
+
+\ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+
+\tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
+
+
+%% The output routine
+
+\def\drawpoles{
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{diamond} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztostart) node[diamondpole] {}
+ \else
+ \pgfextra{ \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztostart) node[ocirc] {}
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztostart) node[circ] {}
+ \else
+ \pgfextra{ \def\pgf@temp{rectjoinfill} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztostart) node[rectjoinfill] {}
+ \else
+ \fi
+ \fi
+ \fi
+ \fi
+ \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{diamond} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztotarget) node[diamondpole] {}
+ \else
+ \pgfextra{ \def\pgf@temp{empty} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztotarget) node[ocirc] {}
+ \else
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztotarget) node[circ] {}
+ \else
+ \pgfextra{ \def\pgf@temp{rectjoinfill} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztotarget) node[rectjoinfill] {}
+ \else
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+
+
+%% Lamp
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tline/height}
+ }{tline}{\ctikzvalof{bipoles/tline/height}
+ }{\ctikzvalof{bipoles/tline/width}
+ }
+ {
+ \pgf@circ@res@step=.2\pgf@circ@res@right % half x axis
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0}}
+ {\pgfpoint{\pgf@circ@res@step}{0}}
+ {\pgfpoint{0}{-\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% SQUID added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/squid/height}}{squid}{\ctikzvalof{bipoles/squid/height}}{\ctikzvalof{bipoles/squid/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+% Generic barrier added by Cor Molenaar 5 March 2010
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/barrier/height}}{barrier}{\ctikzvalof{bipoles/barrier/height}}{\ctikzvalof{bipoles/barrier/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.35*\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.35*\pgf@circ@res@up}}
+
+ \pgfusepath{draw}
+}
+
+
+% Contributed by Danilo Piazzalunga
+
+\pgfdeclareshape{buffer}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/buffer/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+
+
+\pgfdeclareshape{plain amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@up}}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/plain amp/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+%% Generic two port box
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/twoport/height}}{twoport}{\ctikzvalof{bipoles/twoport/height}}{\ctikzvalof{bipoles/twoport/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+}
+
+%% voltage controled oscillator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vco/width}}{vco}{\ctikzvalof{bipoles/twoport/width}}{\ctikzvalof{bipoles/vco/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vco/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw circle
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.5\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.25\pgf@circ@res@step}{-.25\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf@circ@res@step}{.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+}
+
+%% bandpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandpass/width}}{bandpass}{\ctikzvalof{bipoles/bandpass/width}}{\ctikzvalof{bipoles/bandpass/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% bandstop filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bandstop/width}}{bandstop}{\ctikzvalof{bipoles/bandstop/width}}{\ctikzvalof{bipoles/bandstop/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bandstop/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt}% always draw solid line for inner symbol
+ \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}
+}
+
+%% highpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/highpass/width}}{highpass}{\ctikzvalof{bipoles/highpass/width}}{\ctikzvalof{bipoles/highpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/highpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% lowpass filter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lowpass/width}}{lowpass}{\ctikzvalof{bipoles/lowpass/width}}{\ctikzvalof{bipoles/lowpass/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/lowpass/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+}
+
+%% ADC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/adc/width}}{adc}{\ctikzvalof{bipoles/adc/width}}{\ctikzvalof{bipoles/adc/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/adc/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{A}
+ \def\textii{D}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{A}
+ \def\textii{D}
+ \fi\fi
+
+ % draw inner symbol
+ \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}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DAC
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dac/width}}{dac}{\ctikzvalof{bipoles/dac/width}}{\ctikzvalof{bipoles/dac/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dac/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{D}
+ \def\textii{A}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{D}
+ \def\textii{A}
+ \fi\fi
+
+ % draw inner symbol
+ \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}
+
+ \pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
+}
+
+%% DSP
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/dsp/width}}{dsp}{\ctikzvalof{bipoles/dsp/width}}{\ctikzvalof{bipoles/dsp/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/dsp/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{DSP}}
+}
+
+%% FFT
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fft/width}}{fft}{\ctikzvalof{bipoles/fft/width}}{\ctikzvalof{bipoles/fft/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/fft/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{FFT}}
+}
+
+%% Amplifier
+\pgfcircdeclarebipole{}{
+ \ifpgf@circuit@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@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \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
+ \pgfusepath{draw}
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+}
+
+
+%% variable amplifier
+\pgfcircdeclarebipole{}{
+ \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@Rlen
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{-} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \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
+ \pgfusepath{draw}
+
+ % draw inner text
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+ % 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}
+}
+
+%% pi attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/piattenuator/width}}{piattenuator}{\ctikzvalof{bipoles/piattenuator/width}}{\ctikzvalof{bipoles/piattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/piattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vpiattenuator/width}}{vpiattenuator}{\ctikzvalof{bipoles/vpiattenuator/width}}{\ctikzvalof{bipoles/vpiattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% T attenuator
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/tattenuator/width}}{tattenuator}{\ctikzvalof{bipoles/tattenuator/width}}{\ctikzvalof{bipoles/tattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/vtattenuator/width}}{vtattenuator}{\ctikzvalof{bipoles/vtattenuator/width}}{\ctikzvalof{bipoles/vtattenuator/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vtattenuator/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \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}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{phaseshifter}{\ctikzvalof{bipoles/phaseshifter/width}}{\ctikzvalof{bipoles/phaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/phaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+}
+
+%% variable phase shifter
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/phaseshifter/width}}{vphaseshifter}{\ctikzvalof{bipoles/vphaseshifter/width}}{\ctikzvalof{bipoles/vphaseshifter/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+%% detector
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/detector/width}}{detector}{\ctikzvalof{bipoles/detector/width}}{\ctikzvalof{bipoles/detector/width}}{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/detector/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+
+ \ifpgf@circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@inputarrow
+ {
+ \advance \pgf@circ@res@left by -.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % draw inner stuff
+ \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@Rlen / \ctikzvalof{bipoles/generic/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{fulldiodeshape}{center}{}{pgf@fulldiode}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{2\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{emptydiodeshape}{center}{}{pgf@emptydiode}{\pgfusepath{fill}}
+ \fi
+
+}
+
+
+
+
+%% european gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{european gas filled surge arrester}{\ctikzvalof{bipoles/european gas filled surge arrester/height}}{\ctikzvalof{bipoles/european gas filled surge arrester/width}}{
+
+ %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ %\divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+
+
+
+%% american gas filled surge arrester
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{american gas filled surge arrester}{\ctikzvalof{bipoles/american gas filled surge arrester/height}}{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
+ %\def\pgf@circ@temp{right}
+ %\ifx\tikz@res@label@pos\pgf@circ@temp
+ % \pgf@circ@res@step=-1.2\pgf@circ@res@up
+ %\else
+% \def\pgf@circ@temp{below}
+% \ifx\tikz@res@label@pos\pgf@circ@temp
+% \pgf@circ@res@step=-1.2\pgf@circ@res@up
+% \else
+% \pgf@circ@res@step=1.2\pgf@circ@res@up
+% \fi
+% \fi
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpointorigin \pgf@circ@res@other = \pgf@x \advance \pgf@circ@res@other by -\pgf@circ@res@up
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfnode{circle}{center}{}{}{}
+
+ \pgfscope
+ \pgfsetarrowsend{latex}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+
+ %\pgftransformshift{\pgfpoint{.25\pgf@circ@res@left}{.45\pgf@circ@res@down}}
+ %\pgfnode{circ}{center}{}{}{}
+ %\pgftransformshift{}
+ \pgfcircle{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/bipoles/american gas filled surge arrester/size}\pgf@circ@res@down}
+ \pgfusepath{fill}
+}
+
+% % MECHANICAL SYMBOLS
+
+%% mechanical capacitance - stiffness/spring
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spring/height}}{spring}{\ctikzvalof{bipoles/spring/height}}{\ctikzvalof{bipoles/spring/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/spring/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
+ \pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \advance\pgf@circ@res@other by 2\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@other by \pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical inductance - mass
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/mass/box height}}{mass}{\ctikzvalof{bipoles/mass/height}}{\ctikzvalof{bipoles/mass/width}}{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}}
+
+\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical resistor - damper
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/damper/height}}{damper}{\ctikzvalof{bipoles/damper/height}}{\ctikzvalof{bipoles/damper/width}}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {\pgf@circ@res@zero}}
+ \pgfusepath{stroke}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}
+ {.8\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+
+
+%%%---------- close: tex/pgfcircbipoles
+%%%%%%%%%%% Springe nach tex/pgfcirctripoles
+%%%---------- open: tex/pgfcirctripoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Tripoles
+
+
+
+\pgfdeclareshape{spdt}
+ {
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out 1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{out 2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/margin}\pgf@circ@res@left
+
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+ \pgfpathlineto{
+ \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}}
+ {\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}}
+ }
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Logic ports
+%%
+
+
+
+
+
+
+\long\def\pgfcircdeclarelogicport#1#2{
+ \pgfdeclareshape{american #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \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
+
+ #2
+
+ }
+ }
+}
+
+
+\pgfcircdeclarelogicport{and}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@down}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {0pt}}
+ \pgfpathcurveto
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@right}
+ {.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{nand}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathcurveto
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ {\pgfpoint{.0\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{nor}{
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+
+
+\pgfcircdeclarelogicport{or}{
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclarelogicport{xor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+}
+
+
+
+\pgfcircdeclarelogicport{xnor}{
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {(\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input skip})*\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/input height}\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right}
+ {0pt}}
+
+ \pgfusepath{draw}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ddd}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \def\pgf@circ@temp{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/distance}\pgf@circ@res@right+}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{\pgf@circ@res@up}}
+
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{0pt}}
+ \pgfpathcurveto
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/bbb}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/ccc}\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/aaa}\pgf@circ@res@left}{.95*\pgf@circ@res@down}}
+ {\pgfpoint{\pgf@circ@temp-\pgf@circ@res@other}{.95*\pgf@circ@res@down}}
+
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@other-.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+}
+
+
+\pgfdeclareshape{american not port}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+ }
+ }
+
+\pgfdeclareshape{invschmitt}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgfusepath{draw}
+ \pgfpathellipse
+ {\pgfpoint{\pgf@circ@res@step-.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ %draw inner shape
+
+ \pgfsetlinewidth{2\pgflinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ }
+ }
+
+\pgfdeclareshape{schmitt}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ %draw inner shape
+
+ \pgfsetlinewidth{2\pgflinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.3\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ }
+ }
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% #1 - name
+% #2 - text inside
+% #3 - number of inputs
+% #4 - is it a not
+
+\long\def\pgfcircdeclareeurologicport#1#2#3#4{
+ \pgfdeclareshape{european #1 port}
+ {
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in}{
+ \inOne
+ }
+ \anchor{in 1}{
+ \inOne
+ }
+ \anchor{in 2}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.8\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \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
+ \def\pgf@temp{1}
+ \def\pgf@circ@temp{#3}
+ \ifx\pgftemp\pgf@circ@temp % one input
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}
+ \else % two inputs
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathmoveto{
+ \pgfpoint{\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/input height}\pgf@circ@res@down}}
+ \fi%
+ %
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
+ %
+ \edef\pgf@temp{not}
+ \edef\pgf@circ@temp{#4}
+ \ifx\pgf@temp\pgf@circ@temp % is a not
+ \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not width}\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/not height}\pgf@circ@res@up}}
+ \fi
+ %
+ \pgfusepath{draw}
+ %
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgftext{#2}
+ %
+ %
+ %
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ {\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+%
+%
+ }
+ }
+}
+
+
+
+\pgfcircdeclareeurologicport{and}{$\&$}{2}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{2}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{2}{}
+\pgfcircdeclareeurologicport{not}{$1$}{1}{not}
+\pgfcircdeclareeurologicport{nand}{$\&$}{2}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{2}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{2}{not}
+
+\long\def\pgfcircdeclaretransistor#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northeast{% upper right
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%center left
+ \pgf@y=0pt
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/width}\pgf@circ@Rlen
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@y=.7\pgf@y
+ \pgf@x= \pgf@circ@Rlen
+ \pgf@x=0.1\pgf@x
+ }
+ \anchor{pathstart}{ % south
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{pathend}{
+ \northeast
+ }
+ \anchor{north}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \northeast
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=-\pgf@circ@res@step
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@circ@res@step=\pgf@y
+ \left
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{south east}{
+ \northeast
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{base}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{G}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{gate}{
+ \northeast
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@y
+ \left
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@circ@res@step
+ }
+ \anchor{nobase}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@x
+ }
+ \anchor{nogate}{
+ \left
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@x
+ }
+ \anchor{E}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{emitter}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{C}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{collector}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{S}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{source}{
+ \northeast
+ \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{D}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ \anchor{drain}{
+ \northeast
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction}\pgf@y
+ }
+ #2
+ \backgroundpath{
+ \pgftransformationadjustments
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ %
+ \ifnum \pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/curr direction} > 0
+ \pgf@circuit@trans@ntypetrue
+ \else
+ \pgf@circuit@trans@ntypefalse
+ \fi
+ \northeast
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = \pgf@x
+ \left
+ \pgf@circ@res@left = \pgf@x
+ %
+ #3
+ % BODY DIODE
+ \ifpgf@circuit@fet@bodydiode
+ \drawbodydiode{#1}
+ \fi
+ %
+ }
+ }
+}
+
+\long\def\drawbodydiode#1{
+ \pgfscope
+ \pgftransformshift{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgftransformrotate{90}
+ \pgftransformscale{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode scale}}
+ \ifpgf@circuit@fulldiode
+ \pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \else
+ \pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
+ \fi
+ \endpgfscope
+ %Draw upper connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@up}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope{}
+ %Draw lower connection to body diode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode distance}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right} {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/bodydiode conn}\pgf@circ@res@down}}
+ \pgftransformscale{0.5}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+}
+
+\long\def\declarebpt#1{
+ \pgfcircdeclaretransistor{#1}{}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transiytor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{.5}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \ifpgf@circuit@bpt@drawphoto
+ \pgfscope
+ \pgfsetarrowsstart{latex'}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.3\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.05\pgf@circ@res@left}{-0.1\pgf@circ@res@up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ {\pgfpoint{0.5\pgf@circ@res@left}{0.1\pgf@circ@res@up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \else
+ \ifpgf@circuit@bpt@drawbase
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \fi
+ }
+}
+
+\declarebpt{npn}
+\declarebpt{pnp}
+
+\long\def\declareigbt#1{
+\pgfcircdeclaretransistor{#1}{}
+{
+ %draw upper connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ %draw thicker gate lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5\pgflinewidth}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %draw lower connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+ %draw arrow depending on type of transiytor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}%
+ }
+ \else
+ \pgftransformlineattime{.5}{%
+ \pgfpoint{\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height 2}\pgf@circ@res@up}%
+ }
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ %draw gate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@up}}
+ \fi
+ \pgfusepath{draw}
+}
+}
+
+\declareigbt{pigbt}
+\declareigbt{nigbt}
+\declareigbt{Lnigbt}
+\declareigbt{Lpigbt}
+
+
+\pgfcircdeclaretransistor{nmos}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate height}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+}
+
+
+\pgfcircdeclaretransistor{pmos}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgf@circ@res@right}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \fi
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base height}\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+
+
+ \pgfusepath{draw}
+ \ifpgf@circuit@bpt@drawgate
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \fi
+ \pgfpathcircle{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ \ifpgf@circuit@pmos@emptycircle
+ \pgfsetfillcolor{white}
+ \fi
+ \pgfusepath{draw,fill}
+}
+
+\long\def\drawfetcore#1{
+ \pgftransformationadjustments
+ %top connection
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up}}
+ \ifpgf@circuit@trans@depletiontype
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \else
+
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.45}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@up*0.25}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down*0.25}}
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base height}\pgf@circ@res@down}}
+ \fi
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %Bulk connection line
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ %bottom connection
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ %draw thick gate line
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \ifpgf@circuit@trans@ntype
+ \else
+ \pgftransformrotate{180}
+ \fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ % GATE CONNECTION
+ \ifpgf@circuit@bpt@drawgate
+ \ifpgf@circuit@trans@ntype
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \else
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/gate width}\pgf@circ@res@left}
+ {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/conn height}\pgf@circ@res@down}}
+ \fi
+ \pgfusepath{draw}
+ \fi
+
+}
+
+\long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
+{\pgfcircdeclaretransistor{#1}{
+ \anchor{bulk}{\left\pgf@x=0pt}
+ \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
+ #2
+ }
+ {#3}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{nfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nfet}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pfet}
+}
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfete}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+
+
+
+% N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
+\pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{nigfetebulk}
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfetebulk/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+
+
+% N-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{nigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{nigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfete}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfete}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/pigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope
+ \fi
+}
+
+% P-CHANNEL IGFET ENHANCEMENT TYPE with bulk connector
+\pgfdeclaretransistorwrapperaddbulk{pigfetebulk}{}{%
+ \pgf@circuit@trans@depletiontypefalse
+ \drawfetcore{pigfetebulk}
+}
+
+
+% P-CHANNEL IGFET DEPLETION TYPE
+\pgfdeclaretransistorwrapperaddbulk{pigfetd}{}{%
+ \pgf@circuit@trans@depletiontypetrue
+ \drawfetcore{pigfetd}
+
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@up}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+}
+
+\pgfcircdeclaretransistor{njfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/njfet/gate height 2}\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
+\pgfcircdeclaretransistor{pjfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.4}{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }{%
+ \pgfpoint{\pgf@circ@res@left}%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+}
+
+
+\pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ % DRAIN CONNECTION
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ % DRAIN
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ % GATE, DEPLETION TYPE
+ \pgfscope %% added
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth} %% added
+ \pgfusepath{draw} %% added
+ \endpgfscope %% added
+
+ % BULK
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+.5\pgflinewidth}
+ {\pgf@circ@res@up+\pgf@circ@res@down}}
+
+ % SOURCE
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ % SOURCE CONNECTION
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfusepath{draw}
+
+ % GATE
+ %\pgfscope
+ %\pgfpathmoveto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@up}}
+ %\pgfpathlineto{\pgfpoint
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate width}\pgf@circ@res@left}
+ % {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/gate height}\pgf@circ@res@down}}
+ %\pgfsetlinewidth{2\pgflinewidth}
+ %\pgfusepath{draw}
+ %\endpgfscope
+
+
+ % SOLDER DOT at source-bulk connection
+ \ifpgf@circuit@fet@solderdot
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/nigfete/gate height}\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{}
+ \endpgfscope{}
+ \fi
+ % ARROW
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{.6}{%
+ \pgfpoint
+ {\pgf@circ@res@right}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }{%
+ \pgfpoint%
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/base width}\pgf@circ@res@left}%
+ {\pgf@circ@res@up+\pgf@circ@res@down}%
+ }
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfusepath{draw}
+
+ % Wavy lines
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{0cm}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves x sep}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/waves y sep}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathsine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfpathcosine{\pgfpoint{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave width}\pgf@circ@res@up}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/isfet/wave amp}\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+
+%% Black thyristor
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/thyristor/height 2}}{fullthyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty thyristor
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/thyristor/height 2}}{emptythyristor}{\ctikzvalof{tripoles/thyristor/height}}{\ctikzvalof{tripoles/thyristor/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right
+
+ \pgfscope
+ \pgftransformxshift{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf@circ@res@step-2*\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty triac
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/triac/height}}{emptytriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty triac
+
+\pgfcircdeclarebipole{
+ \anchor{gate}{
+ \northeast
+ }
+ \anchor{G}{
+ \northeast
+ }
+ \anchor{anode}{
+ \southwest
+ \pgf@y=0cm
+ }
+ \anchor{cathode}{
+ \northeast
+ \pgf@y=0cm
+ }
+}{\ctikzvalof{tripoles/triac/height}}{fulltriac}{\ctikzvalof{tripoles/triac/height}}{\ctikzvalof{tripoles/triac/width}}{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+
+
+
+
+\pgfcircdeclarebipole{
+ \anchor{out 1}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{out 2}{
+ \northeast
+ \pgf@y=.8\pgf@y
+ }
+}{\ctikzvalof{tripoles/toggleswitch/height 2}}{toggleswitch}{\ctikzvalof{tripoles/toggleswitch/height}}{\ctikzvalof{tripoles/toggleswitch/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+
+ \pgfsetdash{{.08\pgf@circ@res@up}{.04\pgf@circ@res@up}{.7\pgf@circ@res@up}{.04\pgf@circ@res@up}{.8\pgf@circ@res@up}}{0cm}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgfsetdash{}{0cm}
+}
+
+
+
+
+
+
+
+
+
+
+\pgfdeclareshape{op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+
+
+
+ }
+ }
+
+%op amp shape as in european standard en 60617
+\pgfdeclareshape{en amp}
+{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {
+ \left
+ \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf@x
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \anchor{up}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{down}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font} $-$}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font} $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgftext[base,y=-3ex,at=\pgfpoint{.3\pgf@circ@res@left}{\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font2} $\triangleright$}
+ \pgftext[base,y=-3ex,at=\pgfpoint{.3\pgf@circ@res@right}{\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/en amp/font2} $\infty$}
+ }
+}
+
+%%Transkonduktanzverstärker
+\pgfdeclareshape{gm amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/gm amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ %Umrandung:
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0}} %geändert startpunkt neu am ausgangsstrich
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}}%vom Ausgang nach oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} %neu ecke links oben nach rechts oben
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} %bei deneigängen runter
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}%ecke links unten nach rechts unten
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+
+ }
+ }
+
+
+
+%% Potentiometer
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+ \anchor{W}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/potentiometer/height 2}}{potentiometer}{\ctikzvalof{bipoles/potentiometer/height}}{\ctikzvalof{bipoles/potentiometer/width}}{
+\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+\pgftransformationadjustments
+\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+\divide \pgf@circ@res@step by 12
+
+\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+
+\pgf@circ@res@other = \pgf@circ@res@left
+\advance\pgf@circ@res@other by \pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by 2\pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+\advance\pgf@circ@res@other by \pgf@circ@res@step
+\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+\pgfsetbeveljoin
+\pgfusepath{draw}
+
+\pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+\endpgfscope
+}
+
+
+
+
+
+%% Generic tunable
+
+\pgfcircdeclarebipole{
+ \anchor{wiper}{
+ \northeast
+ \pgfpoint{0pt}{\pgf@y}
+ }
+}{\ctikzvalof{bipoles/generic potentiometer/height 2}}{genericpotentiometer}{\ctikzvalof{bipoles/generic potentiometer/height}}{\ctikzvalof{bipoles/generic potentiometer/width}}{
+
+ \pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex'}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+\pgfdeclareshape{mixer}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/mixer/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{135}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-45}{0.5\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{adder}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/adder/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in 1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{in 2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{in2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathmoveto{\pgfpointpolar{90}{0.3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{oscillator}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \else
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/oscillator/width}\pgf@circ@Rlen
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=.5\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{text}{
+ \pgf@x=-2\pgf@x
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@Rlen{}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
+
+ % draw outer box
+ \ifpgf@circuit@boxed{}
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ \pgfpathmoveto{\pgfpoint{-0.3\pgf@circ@res@step}{0\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
+ \pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
+
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{circulator}
+{
+ \savedanchor\northwest{
+ \ifpgf@circuit@boxed
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \else
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/circulator/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \fi
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{1}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@y=-\pgf@y
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+
+ % draw outer circle
+ \ifpgf@circuit@boxed{}
+ \pgf@circ@res@step=.7\pgf@circ@res@step{}
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \fi
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfusepath{draw}
+
+ % inner arrow
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
+ \pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \endpgfscope
+ }
+}
+
+
+% Wilkinson divider
+\pgfdeclareshape{wilkinson}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x= \pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/wilkinson/width}\pgf@x
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{out2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ \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}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ % draw inner resisitor - european or american style is recognised
+ {
+ \pgftransformshift{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgftransformrotate{90}
+
+ % calculate size of resistor
+ \ifpgf@circuit@europeanresistor
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/generic/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{genericshape}{center}{}{pgf@generic}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{\pgf@circ@res@up / \pgf@circ@Rlen / \ctikzvalof{bipoles/resistor/width} / 2}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{resistorshape}{center}{}{pgf@resistor}{\pgfusepath{fill}}
+ \fi
+ }
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+% electromechanical device (motor/generator)
+\pgfdeclareshape{elmech}
+{
+ \savedanchor\northwest{
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/elmech/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ % draw outer box
+ % \ifpgf@circuit@boxed
+ % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ % \fi
+ % draw outer circle
+ %\ifpgf@circuit@boxed
+ % \pgf@circ@res@step=.7\pgf@circ@res@step
+ % \pgfsetdash{}{0pt} % draw solid circle if boxed
+ %\else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ %\fi
+ \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfsetfillcolor{black}
+ \pgfusepath{draw,fill}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{magnetron}
+{
+ \savedanchor\northwest{
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/magnetron/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{anode}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{cathode1}{
+ \northwest
+ \pgf@circ@res@step=\pgf@y
+ \pgfmathparse{cos(105)}
+ \pgf@x=\pgfmathresult\pgf@circ@res@step
+ \pgfmathparse{sin(105)}
+ \pgf@y=\pgfmathresult\pgf@circ@res@step
+ %\pgfpointorigin
+ %\pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
+ }
+ \anchor{cathode2}{
+ \northwest
+ \pgf@circ@res@step=\pgf@y
+ \pgfmathparse{cos(75)}
+ \pgf@x=\pgfmathresult\pgf@circ@res@step
+ \pgfmathparse{sin(75)}
+ \pgf@y=\pgfmathresult\pgf@circ@res@step
+ %\pgfpointorigin
+ %\pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@step}}%not working in a scaled tikzpicture
+ }
+ \anchor{text}{
+ \pgfpointorigin
+ \advance \pgf@x by -.5\wd\pgfnodeparttextbox
+ \advance \pgf@y by -.5\ht\pgfnodeparttextbox
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{right}{%
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{top}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathstart}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{pathend}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{bottom}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{center}{
+ \pgf@y=0pt
+ \pgf@x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@Rlen
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfmathsetlength{\pgf@circ@res@other}{sin(15)*\pgf@circ@res@up}
+
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ % draw outer box
+ % \ifpgf@circuit@boxed
+ % \pgfnode{box}{center}{}{pgf@box}{\pgfusepath{draw}}
+ % \fi
+ % draw outer circle
+ %\ifpgf@circuit@boxed
+ % \pgf@circ@res@step=.7\pgf@circ@res@step
+ % \pgfsetdash{}{0pt} % draw solid circle if boxed
+ %\else
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ %\fi
+ %create outer circle
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
+ \pgfsetfillcolor{white}
+ \pgfusepath{draw}
+ %create chambers
+ \foreach \angle in {45,135,225,315}{
+ \pgfpathmoveto{ \pgfpointpolar{\angle}{0.6\pgf@circ@res@right}}
+ \pgfpathlineto{ \pgfpointpolar{\angle}{\pgf@circ@res@right}}
+ }
+ \pgfsetroundcap
+ \pgfusepath{draw}
+ \pgfscope
+ %draw connection from outside
+ %anode
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+ %cathodes
+ \pgfpathmoveto{\pgfpointpolar{105}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{75}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ %create cathode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0}{.15\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{.5\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %create anode
+ \pgfpathmoveto{\pgfpoint{0.3\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{.5\pgf@circ@res@down}}
+
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%---------- close: tex/pgfcirctripoles
+%%%%%%%%%%% Springe nach tex/pgfcircquadpoles
+%%%---------- open: tex/pgfcircquadpoles.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Quadripoles
+
+\long\def\pgfcircdeclarequadpole#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=.5\pgf@circ@Rlen
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x
+ }
+ \anchor{A2}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{B1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{A1}{
+ \northwest
+ }
+ \anchor{B2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf@x=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=-\pgf@y
+ }
+ \anchor{west}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchor{base}{
+ \northwest
+ \pgf@x=0pt
+ }
+ #3
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ #2
+
+ }
+ }
+}
+
+
+
+\def\pgf@circ@drawtransformerbasicanchor{
+ \pgfkeysvalueof{/tikz/circuitikz/quadpoles/trans/height}
+ \anchor{AA2}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB1}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{AA1}{
+ \northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+ \anchor{BB2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/width1}\pgf@x
+ \pgf@x=.7\pgf@x
+ \pgf@y=-\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/transformer/height1}\pgf@y
+ }
+}
+
+\def\pgf@circ@drawtransformerbasicbody{
+ \def\stretto{.4}
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@up}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@left}%
+ {\pgf@circ@res@down}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+
+ \endpgfscope
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgftransformlineattime{.5}{%
+ \pgfpoint%
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@down}%
+ }{%
+ \pgfpoint
+ {\stretto\pgf@circ@res@right}%
+ {\pgf@circ@res@up}%
+ }
+
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{fullgenericshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \def\pgf@temp{cute}
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgfnode{cuteinductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \else%
+ \pgfnode{americaninductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}}
+ \fi%
+ \fi%
+
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}}
+
+ \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+}
+
+
+
+ % contrib Kristofer M. Monisit
+
+ \pgfdeclareshape{fd op amp}
+ {
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y
+ }
+ \anchor{north}{
+ \northwest
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgfpointlineattime{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out +}{
+ \northwest
+ \pgf@y=.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out -}{
+ \northwest
+ \pgf@y=-.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-\pgf@x
+ }
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ % Negative input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ % Positive input terminal
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+
+ % Negative output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $-$}
+
+
+ % Positive output terminal
+ \pgfpathmoveto{\pgfpoint
+ {0.7\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{0.3\pgf@circ@res@left}{.3\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/font} $+$}
+
+ \pgfsetrectcap
+ % Draw them all!
+ \pgfusepath{draw}
+
+ % Triangle
+ \pgfscope
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgftransformxshift{.7\pgf@circ@res@left}
+ \pgf@circ@res@step=\pgf@circ@res@right
+ \advance\pgf@circ@res@step by -\pgf@circ@res@left
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathclose
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+ }
+
+
+
+
+\pgfcircdeclarequadpole{transformer}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+}{\pgf@circ@drawtransformerbasicanchor}
+
+\pgfcircdeclarequadpole{transformer core}{
+
+ \pgf@circ@drawtransformerbasicbody
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@right}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfmoveto{\pgfpoint%
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@down}%
+ }
+ \pgflineto{
+ \pgfpoint
+ {\ctikzvalof{quadpoles/transformer core/core width}\pgf@circ@res@left}%
+ {\ctikzvalof{quadpoles/transformer core/core height}\pgf@circ@res@up}%
+ }
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+}{\pgf@circ@drawtransformerbasicanchor}
+
+
+\pgfcircdeclarequadpole{gyrator}{
+
+ \def\stretto{.4}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}}
+ \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down}
+
+ \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}}
+ \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down}
+ \pgfusepath{draw}
+
+}{}
+
+%% four-port
+% defines a general outer box for four-ports
+% TikZ usage:
+% \draw (0,0) node[coupler](coup){\SI{-3}{dB}}
+% (coup.port1) to[short,-o] ++(-1,0)
+%
+
+\long\def\pgfcircdeclarefourport#1#2{
+ \pgfdeclareshape{#1}{
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=.5\pgf@circ@Rlen
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/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{1}{
+ \northwest
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{2}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=-0.5\pgf@y
+ }
+ \anchor{3}{
+ \northwest
+ \pgf@x=-\pgf@x
+ \pgf@y=0.5\pgf@y
+ }
+ \anchor{4}{
+ \northwest
+ \pgf@y=0.5\pgf@y
+ }
+
+ \anchor{text}{
+ \northwest
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+
+ \pgfstartlinewidth=\pgflinewidth
+
+ % draw outer box
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ % draw inner stuff
+ #2
+
+ % draw inner text
+ \pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ }
+ }
+}
+
+% four-port
+\pgfcircdeclarefourport{fourport}{}
+
+
+% straight coupler
+\pgfcircdeclarefourport{coupler}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@up}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
+ \pgfsetarrows{latex-latex}
+ \pgfusepath{draw}
+}
+
+% "bended" coupler
+\pgfcircdeclarefourport{coupler2}{
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{180}{90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
+ \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up}
+ \pgfsetarrowsend{latex}
+ \pgfusepath{draw}
+
+
+}
+%%%---------- close: tex/pgfcircquadpoles
+
+%%%%%%%%%%% Springe nach tex/pgfcirclabel
+%%%---------- open: tex/pgfcirclabel.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Bipole label positioning
+
+%% Options
+\ctikzset{label/.style = { l=#1 } }
+\ctikzset{l/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=#1}
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}}
+
+\ctikzset{label above/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{l^/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+
+\ctikzset{label below/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\ctikzset{l_/.style = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\ctikzset{annotation/.style = { a=#1 } }
+\ctikzset{a/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/annotation/name=#1}
+ \ctikzsetvalof{bipole/annotation/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/annotation/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }}
+
+\ctikzset{annotation above/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+
+\ctikzset{a^/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
+}
+
+\ctikzset{annotation below/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+\ctikzset{a_/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
+}
+
+
+
+\def\pgf@circ@drawlabels#1{
+ \pgfextra{
+ \pgfmathsubtract{\pgf@circ@direction}{90}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/position}}
+ \ifnum \pgf@circ@temp < 0
+ \pgfmathadd{\pgf@circ@labanc}{180}
+ \edef\pgf@circ@labanc{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ \ifpgf@circuit@bipole@inverted
+ \pgfmathadd{\pgf@circ@temp}{180} %If shape is inverted, use opposite anchor
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathadd{\pgf@circ@temp}{180} %If shape is mirrored, use opposite anchor
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \fi
+ }
+ %Firstly, place a coodinate directly at the edge of the shape
+ (\ctikzvalof{bipole/name}.\pgf@circ@temp) coordinate (labelcoor)
+ %now decide, which labels should be drawn
+ \pgfextra{
+ \edef\pgf@temp{\ctikzvalof{label/align}}
+ \def\pgf@circ@temp{straight}
+ }
+ \ifx\pgf@temp\pgf@circ@temp %straight
+ \pgf@circ@drawreglabels{#1}
+ \else
+ \pgfextra{\def\pgf@circ@temp{rotate}}
+ \ifx\pgf@temp\pgf@circ@temp %rotate
+ \pgf@circ@drawrotlabels{#1}
+ \else% smart
+ \pgf@circ@drawsmartlabels{#1}
+ \fi
+ \fi
+}
+
+
+\def\pgf@circ@drawsmartlabels#1{
+ \pgfextra{
+ \pgfmathmod{\pgf@circ@direction}{90}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \ifnum \pgfcircmathresult > 20
+ \ifnum \pgfcircmathresult < 70
+ \pgf@circ@drawrotlabels{#1}
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+ \else
+ \pgf@circ@drawreglabels{#1}
+ \fi
+}
+
+
+\def\pgf@circ@drawrotlabels#1{
+ \pgfextra{
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ %we need some more space for placement below, due to mid-anchor
+ \def\pgf@circ@labposdistance{1.5ex}
+ \else
+ \def\pgf@circ@labposdistance{2ex}
+ \fi
+ %Calculate rotation of the label from direction and strip decimals
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ % rotate the label at second or third quadrant:
+ \ifnum \pgfcirclabrot > 90 \ifnum \pgfcirclabrot < 270
+ \pgfmathsubtract{\pgf@circ@direction}{180}
+ \edef\pgfcirclabrot{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ %invert the space relationships due to rotatet strings
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ \def\pgf@circ@labposdistance{2ex}
+ \else
+ \def\pgf@circ@labposdistance{1.5ex}
+ \fi
+ \fi\fi
+ \pgfmathparse{\ctikzvalof{bipole/#1/position}>0?\pgf@circ@direction+90:\pgf@circ@direction-90}
+ \edef\pgf@circ@labposangle{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ (labelcoor)++(\pgf@circ@labposangle:\pgf@circ@labposdistance) coordinate(labelcoor)
+ node[anchor=mid,rotate=\pgfcirclabrot](\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
+}
+
+\def\pgf@circ@drawreglabels#1{
+
+ %Now calculate all shape positions
+ %Use mid-anchor at x-axis and base-anchor at y-axis, respectively.
+ %All points between will be addressed by angled-anchors:
+ \pgfextra{
+ \pgfmathadd{\pgf@circ@labanc}{90}
+ \edef\pgf@circ@temp{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \pgfmathparse{mod(\pgf@circ@temp,180)>135?mod(\pgf@circ@temp,180)-180:mod(\pgf@circ@temp,180)}
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ %Values between -5 and 5 are at pos /neg x-axis, values around 90 are at both y-axis
+ \ifnum \pgfcircmathresult > 84 \ifnum \pgfcircmathresult< 96
+ \pgfextra{\edef\pgf@circ@labpos{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}}
+ \ifnum \pgf@circ@labpos > 180
+ \ifnum \ctikzvalof{bipole/#1/position} > 0
+ \pgfextra{\def\pgf@circ@labanc{mid west}}
+ \else
+ \pgfextra{\def\pgf@circ@labanc{mid east}}
+ \fi
+ \else
+ \ifnum \ctikzvalof{bipole/#1/position} > 0
+ \pgfextra{\def\pgf@circ@labanc{mid east}}
+ \else
+ \pgfextra{\def\pgf@circ@labanc{mid west}}
+ \fi
+ \fi
+ \fi\fi
+ \ifnum \pgfcircmathresult <6
+ \ifnum \ctikzvalof{bipole/#1/position} < 0
+ %we need some more space for placement below, due to mid-anchor
+ (labelcoor)++(-\pgf@circ@labanc:2ex) coordinate(labelcoor)
+ \else
+ (labelcoor)++(-\pgf@circ@labanc:1.5ex) coordinate(labelcoor)
+ \fi
+ \pgfextra{\def\pgf@circ@labanc{mid}}
+ \fi
+ (labelcoor) node[anchor=\pgf@circ@labanc](\ctikzvalof{bipole/name}#1){\pgf@circ@finallabels{#1}}
+}
+
+\def\pgf@circ@finallabels#1{%
+ \edef\pgf@temp{}%
+ \edef\pgf@circ@temp{\ctikzvalof{bipole/#1/unit}}%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \ctikzvalof{bipole/#1/name}%
+ \else%
+ $\SI{\ctikzvalof{bipole/#1/name}}{\ctikzvalof{bipole/#1/unit}}$%
+ \fi%
+}
+
+\ctikzset{text/.style = { t=#1 } }
+\ctikzset{t/.code = {
+ \ctikzsetvalof{bipoles/twoport/text}{#1}
+}}
+%%%---------- close: tex/pgfcirclabel
+%%%%%%%%%%% Springe nach tex/pgfcircvoltage
+%%%---------- open: tex/pgfcircvoltage.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Voltage management
+
+
+\ctikzset{v^>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v^</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = above
+ }
+}
+
+\ctikzset{v_>/.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = forward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_</.style = {
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
+}
+
+\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
+\ctikzset{v^/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = above} }
+\ctikzset{v>/.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = forward} }
+\ctikzset{v</.style = {v = #1, \circuitikzbasekey/bipole/voltage/direction = backward} }
+
+% Default position varies whether the component is a voltage source
+% or not
+\ctikzset{v/.code = {
+ \ifpgf@circuit@bipole@isvoltage
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=above,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi
+ \fi
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@iscurrent
+ \ifpgf@circuit@bipole@current@backward
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=backward}
+ \fi\fi\fi
+ \pgfkeys{/tikz/circuitikz/bipole/voltage/label/name=#1}
+ \ctikzsetvalof{bipole/voltage/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/voltage/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+ }
+}
+
+
+
+
+%% Output routine for generic bipoles
+
+\def\pgf@circ@drawvoltagegeneric{
+ \pgfextra{
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\partheight{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/straight label distance}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen)}
+ }
+ {
+ \pgfkeysifdefined{/tikz/circuitikz/bipoles/voltage/straight label distance}
+ {
+ \edef\partheight{\ctikzvalof{bipoles/voltage/straight label distance}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen)}
+ }
+ {%calculate default value from part height
+ \edef\partheight{0.5*\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen+0.2\pgf@circ@Rlen)}
+ }
+ }
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\tmpdistfromline}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\tmpdistfromline}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{-\tmpdistfromline}
+ \else
+ \def\distfromline{-\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@straight
+ \def\distfromline{\tmpdistfromline}
+ \else
+ \def\distfromline{\ctikzvalof{voltage/distance from line}\pgf@circ@Rlen}
+ \fi
+ \fi
+ \fi
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@voltage@angle{90}
+ \else
+ \def\pgf@circ@voltage@angle{-90}
+ \fi
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\distacefromnode{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/distance from node}} }
+ { \edef\distacefromnode{\ctikzvalof{voltage/distance from node}} }
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\bumpb{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/bump b}} }
+ { \edef\bumpb{\ctikzvalof{voltage/bump b}} }
+ }
+ % %\pgf@circ@Rlen/16 is equal to the length of the currarrow
+ coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/16 ! (anchorstartnode)$) %absolute move, minimum space is length of arrowhead
+ coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorstartnode)$)
+
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
+ coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/16 ! (anchorendnode)$)%absolute move, minimum space is length of arrowhead
+ coordinate (pgfcirc@midtmp) at ($(pgfcirc@midtmp) ! \distacefromnode ! (anchorendnode)$)
+
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@midtmp) ! \distfromline ! \pgf@circ@voltage@angle : (anchorendnode)$)
+
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.-70)$)
+ \else
+ coordinate (pgfcirc@Vcont1) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.110)$)
+ coordinate (pgfcirc@Vcont2) at ($(\ctikzvalof{bipole/name}.center) ! \bumpb ! (\ctikzvalof{bipole/name}.70)$)
+ \fi
+
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@straight
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) --(pgfcirc@Vfrom) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
+ \else
+ (pgfcirc@Vfrom) --(pgfcirc@Vto) node[currarrow, sloped, allow upside down, pos=1,anchor=tip] {}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) .. controls (pgfcirc@Vcont2) and (pgfcirc@Vcont1) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) .. controls (pgfcirc@Vcont1) and (pgfcirc@Vcont2) ..
+ node[currarrow, sloped, allow upside down, pos=1] {}
+ (pgfcirc@Vto)
+ \fi
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$}
+ \fi
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$-$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$+$}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{\scriptsize$+$}
+ (pgfcirc@Vto) node[inner sep=0, anchor=\pgf@circ@bipole@voltage@label@anchor]{$-$}
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine for voltage sources
+\def\pgf@circ@drawvoltagegenerator{
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-120)$)
+ coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.-60)$)
+ \else
+ coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.120)$)
+ coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \ctikzvalof{voltage/bump a} ! (\ctikzvalof{bipole/name}.60)$)
+ \fi
+ \ifpgf@circuit@europeanvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vto) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vfrom)
+ \else
+ (pgfcirc@Vfrom) -- node[currarrow, sloped, allow upside down, pos=1] {} (pgfcirc@Vto)
+ \fi
+ \else% american voltage
+ \ifpgf@circuit@bipole@voltageoutsideofsymbol
+ % if it is a battery, must put + and -
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node {$-$} (pgfcirc@Vto) node {$+$}
+ \else
+ (pgfcirc@Vfrom) node {$+$} (pgfcirc@Vto) node {$-$}
+ \fi
+ \fi
+ \fi
+}
+
+%% Output routine
+\def\pgf@circ@drawvoltage{% node name
+%\pgf@circ@direction
+ \pgfextra{
+ \edef\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{south east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{east}
+ \else \def\pgf@circ@bipole@voltage@label@anchor{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north east}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >-1 \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >355 \ifnum\pgfcircmathresult <361
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@anchor{north}
+ \else\def\pgf@circ@bipole@voltage@label@anchor{south}
+ \fi
+ \fi\fi
+
+ \ifnum \ctikzvalof{mirror value}=-1
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@inverted
+ \ifpgf@circuit@bipole@voltage@below
+ \pgf@circuit@bipole@voltage@belowfalse
+ \else
+ \pgf@circuit@bipole@voltage@belowtrue
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@voltage@below
+ \def\pgf@circ@bipole@voltage@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@voltage@label@where{90}
+ \fi
+
+
+ \edef\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}
+ \pgfkeysifdefined{\pgf@temp}
+ { \edef\eudist{\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/voltage/european label distance}} }
+ { \edef\eudist{\ctikzvalof{voltage/european label distance}} }
+
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ }%end pgfextra
+
+ \ifpgf@circuit@bipole@isvoltage
+ \pgf@circ@drawvoltagegenerator
+ \else
+ \pgf@circ@drawvoltagegeneric
+ \fi
+
+ % (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where) %Zeile sinnlos!?
+ \ifpgf@circuit@bipole@voltage@straight
+ coordinate (Vlab) at ($(pgfcirc@Vto)!0.5!(pgfcirc@Vfrom) $)
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt]
+ at (Vlab) { \pgf@circ@finallabels{voltage/label} }
+ \else
+ coordinate (Vlab) at ($(\ctikzvalof{bipole/name}.center) !
+ \ifpgf@circuit@europeanvoltage
+ \eudist
+ \else
+ \ctikzvalof{voltage/american label distance}
+ \fi !
+ (\ctikzvalof{bipole/name}.\pgf@circ@bipole@voltage@label@where)$)
+ node [anchor=\pgf@circ@bipole@voltage@label@anchor, inner sep=2pt] at (Vlab) { \pgf@circ@finallabels{voltage/label} }
+ \fi
+}%end drawvoltages
+%%%---------- close: tex/pgfcircvoltage
+%%%%%%%%%%% Springe nach tex/pgfcirccurrent
+%%%---------- open: tex/pgfcirccurrent.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Current handling
+
+%% Options
+\ctikzset{i^>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_>/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i>^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i>_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i^</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i_</.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i<^/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above
+ }
+}
+
+\ctikzset{i<_/.style = {
+ i = #1,
+ \circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = below
+ }
+}
+
+\ctikzset{i/.code = {
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/current/label/name=#1}
+ \ctikzsetvalof{bipole/current/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/current/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+%reverse current direction for voltage sources
+ \ifpgf@circ@oldvoltagedirection\else
+ \ifpgf@circuit@bipole@isvoltage
+ \ifpgf@circuit@bipole@voltage@backward
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = forward,
+ \circuitikzbasekey/bipole/current/x position = after,
+ \circuitikzbasekey/bipole/current/y position = below }
+ \else
+ \pgfkeys{\circuitikzbasekey/bipole/current/direction = backward,
+ \circuitikzbasekey/bipole/current/x position = before,
+ \circuitikzbasekey/bipole/current/y position = above }
+ \fi\fi\fi
+}
+}
+
+
+\ifpgf@circ@oldvoltagedirection
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward } }
+\else
+ \ctikzset{i</.style = { i = #1, \circuitikzbasekey/bipole/current/direction = backward, \circuitikzbasekey/bipole/current/x position = before } }
+\fi
+\ctikzset{i_/.style = { i = #1, \circuitikzbasekey/bipole/current/y position = below } }
+\ctikzset{i>/.style = {i = #1, \circuitikzbasekey/bipole/current/direction = forward } }
+\ctikzset{i^/.style = { i= #1, \circuitikzbasekey/bipole/current/y position = above } }
+
+%% Output routine
+\def\pgf@circ@drawcurrent{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@current@below
+ \def\pgf@circ@bipole@current@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@current@label@where{+90}
+ \fi
+ }
+
+ \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
+ \ifx\pgf@circ@temp\pgf@temp%draw current at a short at middle of the line
+ (\tikztostart)--(\tikztotarget)
+ \else% normal bipole or source
+ \ifpgf@circuit@bipole@current@before
+ (\tikztostart)--(anchorstartnode)
+ \else
+ (anchorendnode)--(\tikztotarget)
+ \fi
+ \fi
+ \ifpgf@circuit@bipole@current@backward
+ \pgfextra{
+ \pgfmathsubtract{\pgf@circ@ffffff}{180}
+ \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ }
+ \fi
+ coordinate[currarrow,pos=\ctikzvalof{current/distance},rotate=\pgf@circ@ffffff](Iarrow)
+ (Iarrow.\pgf@circ@bipole@current@label@where) node[anchor=\pgf@circ@dir]{\pgf@circ@finallabels{current/label}}
+}
+
+%%%---------- close: tex/pgfcirccurrent
+%%%%%%%%%%% Springe nach tex/pgfcircflow
+%%%---------- open: tex/pgfcircflow.tex
+% Copyright 2007-2009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/LICENSE for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% flow handling
+
+%% Options
+\ctikzset{f^>/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/curflowrent/y position = above
+ }
+}
+
+\ctikzset{f_>/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f>^/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f>_/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f^</.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f_</.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f<^/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = above
+ }
+}
+
+\ctikzset{f<_/.style = {
+ f = #1,
+ \circuitikzbasekey/bipole/flow/direction = backward,
+ \circuitikzbasekey/bipole/flow/x position = before,
+ \circuitikzbasekey/bipole/flow/y position = below
+ }
+}
+
+\ctikzset{f</.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = backward} }
+\ctikzset{f_/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = below } }
+\ctikzset{f>/.style = { f = #1, \circuitikzbasekey/bipole/flow/direction = forward } }
+\ctikzset{f^/.style = { f = #1, \circuitikzbasekey/bipole/flow/y position = above } }
+
+\ctikzset{f/.code = {
+ \pgfkeys{\circuitikzbasekey/bipole/flow/direction = forward,
+ \circuitikzbasekey/bipole/flow/x position = after,
+ \circuitikzbasekey/bipole/flow/y position = above }
+ \pgfkeys{/tikz/circuitikz/bipole/flow/label/name=#1}
+ \ctikzsetvalof{bipole/flow/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#1}
+ \ifpgf@circ@siunitx@res
+ \edef\pgf@temp{\pgf@circ@handleSI@val}
+ \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/name}{\pgf@temp}
+ \edef\pgf@temp{\pgf@circ@handleSI@unit}
+ \pgfkeyslet{/tikz/circuitikz/bipole/flow/label/unit}{\pgf@temp}
+ \else
+ \fi
+ \else
+ \fi
+}
+}
+
+%% Output routine
+\def\pgf@circ@drawflow{
+ \pgfextra{
+ \edef\pgf@circ@ffffff{\pgf@circ@direction}
+ \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@ffffff\pgf@nil}
+
+ \ifnum\pgfcircmathresult >4 \ifnum\pgfcircmathresult <86
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north west} \else \def\pgf@circ@dir{south east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >85 \ifnum\pgfcircmathresult <95
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{west} \else \def\pgf@circ@dir{east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >94 \ifnum\pgfcircmathresult <176
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south west}\else \def\pgf@circ@dir{north east}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >175 \ifnum\pgfcircmathresult <185
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south}\else\def\pgf@circ@dir{north}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >184 \ifnum\pgfcircmathresult <266
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{south east}\else\def\pgf@circ@dir{north west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >265 \ifnum\pgfcircmathresult <275
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{east}\else \def\pgf@circ@dir{west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult >274 \ifnum\pgfcircmathresult <356
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north east}\else\def\pgf@circ@dir{south west}
+ \fi
+ \fi\fi
+ \ifnum\pgfcircmathresult <5
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+ \ifnum\pgfcircmathresult >355
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@dir{north}\else\def\pgf@circ@dir{south}
+ \fi
+ \fi
+
+ \ifpgf@circuit@bipole@flow@below
+ \def\pgf@circ@bipole@flow@label@where{-90}
+ \else
+ \def\pgf@circ@bipole@flow@label@where{+90}
+ \fi
+ }
+
+ \pgfextra{\def\pgf@temp{short}\edef\pgf@circ@temp{\ctikzvalof{bipole/kind}}}
+ \ifx\pgf@circ@temp\pgf@temp%draw flow at a short at middle of the line
+ (\tikztostart)--(\tikztotarget)
+ \else% normal bipole or source
+ \ifpgf@circuit@bipole@flow@before
+ (\tikztostart)--(anchorstartnode)
+ \else
+ (anchorendnode)--(\tikztotarget)
+ \fi
+ \fi
+ \pgfextra{
+ \ifpgf@circuit@bipole@flow@backward
+ \ifpgf@circuit@bipole@flow@below
+ \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \else
+ \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \fi
+ \pgfmathsubtract{\pgf@circ@ffffff}{180}
+ \edef\pgf@circ@ffffff{\expandafter\pgf@circ@stripdecimals\pgfmathresult\pgf@nil}
+ \else
+ \ifpgf@circuit@bipole@flow@below
+ \def\flow@offset{-\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \else
+ \def\flow@offset{\ctikzvalof{flow/offset}\pgf@circ@Rlen}
+ \fi
+ \fi
+ }
+ coordinate[flowarrow,pos=\ctikzvalof{flow/distance},rotate=\pgf@circ@ffffff,yshift=\flow@offset](Farrowpos)
+ (Farrowpos.\pgf@circ@bipole@flow@label@where) node[anchor=\pgf@circ@dir]{ \pgf@circ@finallabels{flow/label}}
+}
+
+%%%---------- close: tex/pgfcircflow
+
+\ExecuteOptions{nofetbodydiode,nofetsolderdot,nooldvoltagedirection,europeancurrents,europeanvoltages,americanports,americanresistors,cuteinductors,europeangfsurgearrester,nosiunitx,noarrowmos,smartlabels,nocompatibility}
+
+\ProcessOptions\relax
+
+%%%%%%%%%%% Springe nach tex/pgfcircpath
+%%%---------- open: tex/pgfcircpath.tex
+
+\def\pgf@circ@direction{0.0}
+
+% Names
+\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
+\ctikzset{n/.code = {
+ \pgfkeys{/tikz/circuitikz/bipole/name=#1}
+}}
+
+% Reflect the node along
+\ctikzset{mirrored/.is choice}
+\ctikzset{mirror value/.initial=1}
+\ctikzset{mirrored/true/.code = {\ctikzsetvalof{mirror value}{-1}} }
+\ctikzset{mirrored/false/.code = {\ctikzsetvalof{mirror value}{1}} }
+\ctikzset{mirror/.style = {/tikz/circuitikz/mirrored=true}}
+
+% Invert node along path
+\ctikzset{inverted/.is choice}
+\ctikzset{invert value/.initial=1}
+\ctikzset{inverted/true/.code = {\ctikzsetvalof{invert value}{-1}\pgf@circuit@bipole@invertedtrue}}
+\ctikzset{inverted/false/.code = {\ctikzsetvalof{invert value}{1}\pgf@circuit@bipole@invertedfalse}}
+\ctikzset{invert/.style = {/tikz/circuitikz/inverted=true}}
+\newif\ifpgf@circuit@bipole@inverted
+\ctikzset{bipole/inverted/.is if=pgf@circuit@bipole@inverted}
+
+
+\newif\ifpgf@circuit@bipole@voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf@circuit@bipole@voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf@circuit@bipole@voltage@backwardtrue}}
+
+
+
+% Initialize paths
+\def\pgfcircresetpath{
+ \ctikzset{bipole/name=, bipole/label/name=, bipole/label/position=90, ,bipole/annotation/name=, bipole/annotation/position=-90,
+ bipole/inverted=false, bipole/kind=,
+ bipole/voltage/direction=backward, bipole/voltage/label/name=, bipole/voltage/position=below,
+ bipole/nodes/left=none, bipole/nodes/right=none, bipole/is voltage=false,bipole/is voltageoutsideofsymbol=false,bipole/is strokedsymbol=false,
+ bipole/is current=false, bipole/current/label/name=, bipole/current/x position=after,
+ bipole/current/y position=above, bipole/current/direction=forward,
+ mirrored=false
+ }
+}
+
+%% Helper function for path-function to ensure using anchors between nodes
+\def\set@explicit@center@anchor#1{
+ \pgfutil@ifundefined{pgf@sh@ns@#1}
+ {
+ %This coordinate is no node(but a relative position or a coordinate), no further handling needed
+ }{
+ \pgfutil@in@.{#1}
+ \ifpgfutil@in@
+ % Anchor is used, do nothing!
+ \else%
+ \let\tikz@moveto@waiting=\relax
+ \pgfpathmoveto{\tikz@last@position}%force movement, because tikz@moveto@waiting
+ \edef#1{#1.center}%ensure using center anchor
+ \fi
+ }
+}
+
+
+%% Generic bipole path
+\def\pgf@circ@bipole@path#1#2{
+
+\pgfextra{
+ \set@explicit@center@anchor{\tikztostart}
+ \set@explicit@center@anchor{\tikztotarget}
+ \pgfsyssoftpath@getcurrentpath{\myp@th}%% save current path to extend after calculation of correct start/end coordinates
+ \ctikzset{bipole/kind = #1}
+ \edef\pgf@temp{\ctikzvalof{bipole/name}}
+ \def\pgf@circ@temp{}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = #2\pgf@circ@rand} % create it
+ \fi
+ }
+
+ (\tikztostart) coordinate (\ctikzvalof{bipole/name}start)%necessary to get correct coordinates in the case of relativ start/end or constructions like ((node1)-|(node2))
+ (\tikztotarget) coordinate (\ctikzvalof{bipole/name}end)
+ \pgfextra{
+ \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \edef\pgf@circ@direction{\pgfmathresult}%Calculate direction(angle) of path
+ \pgfsyssoftpath@setcurrentpath{\myp@th}
+ }
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ --($(\ctikzvalof{bipole/name}start) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}end)$) %ugly workaround to get correct linejoins(node breaks path?)
+ \fi
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)%%positio of middle node
+ node[#1shape, rotate=\pgf@circ@direction, yscale=\ctikzvalof{mirror value}, xscale=\ctikzvalof{invert value}]
+ (\ctikzvalof{bipole/name}) {}
+ \ifpgf@circuit@bipole@inverted
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathend)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathstart)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.right)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.left)
+ \fi
+ \else
+ \ifcsname pgf@anchor@#1shape@pathstart\endcsname%if special path-anchors are defined, use them!
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.pathstart)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.pathend)
+ \else
+ coordinate (anchorstartnode) at (\ctikzvalof{bipole/name}.left)
+ coordinate (anchorendnode) at (\ctikzvalof{bipole/name}.right)
+ \fi
+ \fi
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ \else
+ \ifpgf@circuit@bipole@strokedsymbol%draw line thrue symbol(e.g. diodes)
+ \ifcsname pgf@anchor@#1shape@strokepathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}.strokepathstart)
+ (\ctikzvalof{bipole/name}.strokepathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \else
+ (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
+ (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \fi
+
+ \drawpoles
+ \pgf@circ@ifkeyempty{bipole/label/name}\else\pgf@circ@drawlabels{label}\fi
+ \pgf@circ@ifkeyempty{bipole/annotation/name}\else\pgf@circ@drawlabels{annotation}\fi
+ \pgf@circ@ifkeyempty{bipole/voltage/label/name}\else\pgf@circ@drawvoltage\fi
+ \pgf@circ@ifkeyempty{bipole/current/label/name}\else\pgf@circ@drawcurrent\fi
+ \pgf@circ@ifkeyempty{bipole/flow/label/name}\else\pgf@circ@drawflow\fi
+ \pgfextra{\def\pgf@temp{open}\def\pgf@circ@temp{#1}}
+ \ifx\pgf@temp\pgf@circ@temp % if it is an open
+ (\ctikzvalof{bipole/name}end)%Move to end of path
+ \else
+ ($(\ctikzvalof{bipole/name}end) ! .5\pgflinewidth ! (\ctikzvalof{bipole/name}start)$) -- (\ctikzvalof{bipole/name}end)%ugly workaround to get correct linejoins(node breaks path?)
+ %tikztostart and tikztotarget could not be used, because it would break if target coordinate is something like (node1-|node2)
+
+ \fi
+ % reset
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ \tikztonodes%draw pending nodes an path
+}
+
+
+%% Path definitions
+\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi}
+\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi}
+\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi}
+\def\pgf@circ@thermistor@path#1{\pgf@circ@bipole@path{thermistor}{#1}}
+\def\pgf@circ@thermistorptc@path#1{\pgf@circ@bipole@path{thermistorptc}{#1}}
+\def\pgf@circ@thermistorntc@path#1{\pgf@circ@bipole@path{thermistorntc}{#1}}
+\def\pgf@circ@varistor@path#1{\pgf@circ@bipole@path{varistor}{#1}}
+\def\pgf@circ@capacitor@path#1{\pgf@circ@bipole@path{capacitor}{#1}}
+\def\pgf@circ@ecapacitor@path#1{\pgf@circ@bipole@path{ecapacitor}{#1}}
+\def\pgf@circ@polarcapacitor@path#1{\pgf@circ@bipole@path{polarcapacitor}{#1}}
+\def\pgf@circ@vcapacitor@path#1{\pgf@circ@bipole@path{vcapacitor}{#1}}
+\def\pgf@circ@piezoelectric@path#1{\pgf@circ@bipole@path{piezoelectric}{#1}}
+\def\pgf@circ@battery@path#1{\pgf@circ@bipole@path{battery}{#1}}
+\def\pgf@circ@batteryone@path#1{\pgf@circ@bipole@path{battery1}{#1}}
+\def\pgf@circ@batterytwo@path#1{\pgf@circ@bipole@path{battery2}{#1}}
+\def\pgf@circ@europeaninductor@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@americaninductor@path#1{\pgf@circ@bipole@path{americaninductor}{#1}}
+\def\pgf@circ@cuteinductor@path#1{\pgf@circ@bipole@path{cuteinductor}{#1}}
+\def\pgf@circ@inductor@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductor@path{#1}%
+ \else%
+ \pgf@circ@americaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@vinductor@path#1{
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@veuropeaninductor@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@vcuteinductor@path{#1}%
+ \else%
+ \pgf@circ@vamericaninductor@path{#1}%
+ \fi%
+ \fi%
+}
+\def\pgf@circ@veuropeaninductor@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@vamericaninductor@path#1{\pgf@circ@bipole@path{vamericaninductor}{#1}}
+\def\pgf@circ@vcuteinductor@path#1{\pgf@circ@bipole@path{vcuteinductor}{#1}}
+\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
+\def\pgf@circ@esource@path#1{\pgf@circ@bipole@path{esource}{#1}}
+\def\pgf@circ@pvsource@path#1{\pgf@circ@bipole@path{pvsource}{#1}}
+\def\pgf@circ@vsource@path#1{\pgf@circ@bipole@path{vsource}{#1}}
+\def\pgf@circ@dcvsource@path#1{\pgf@circ@bipole@path{dcvsource}{#1}}
+\def\pgf@circ@vsourceam@path#1{\pgf@circ@bipole@path{vsourceAM}{#1}}
+\def\pgf@circ@vsourcesin@path#1{\pgf@circ@bipole@path{vsourcesin}{#1}}
+\def\pgf@circ@isource@path#1{\pgf@circ@bipole@path{isource}{#1}}
+\def\pgf@circ@oosource@path#1{\pgf@circ@bipole@path{oosource}{#1}}
+\def\pgf@circ@dcisource@path#1{\pgf@circ@bipole@path{dcisource}{#1}}
+\def\pgf@circ@isourcesin@path#1{\pgf@circ@bipole@path{isourcesin}{#1}}
+\def\pgf@circ@vsourcesquare@path#1{\pgf@circ@bipole@path{vsourcesquare}{#1}}
+\def\pgf@circ@vsourcetri@path#1{\pgf@circ@bipole@path{vsourcetri}{#1}}
+\def\pgf@circ@isourceam@path#1{\pgf@circ@bipole@path{isourceAM}{#1}}
+\def\pgf@circ@cvsource@path#1{\pgf@circ@bipole@path{cvsource}{#1}}
+\def\pgf@circ@cvsourceam@path#1{\pgf@circ@bipole@path{cvsourceAM}{#1}}
+\def\pgf@circ@cvsourcesin@path#1{\pgf@circ@bipole@path{cvsourcesin}{#1}}
+\def\pgf@circ@cisource@path#1{\pgf@circ@bipole@path{cisource}{#1}}
+\def\pgf@circ@cisourceam@path#1{\pgf@circ@bipole@path{cisourceAM}{#1}}
+\def\pgf@circ@cisourcesin@path#1{\pgf@circ@bipole@path{cisourcesin}{#1}}
+\def\pgf@circ@short@path#1{\pgf@circ@bipole@path{short}{#1}}
+\def\pgf@circ@cspst@path#1{\pgf@circ@bipole@path{cspst}{#1}}
+\def\pgf@circ@ospst@path#1{\pgf@circ@bipole@path{ospst}{#1}}
+\def\pgf@circ@nos@path#1{\pgf@circ@bipole@path{nos}{#1}}
+\def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
+\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
+\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
+\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
+\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
+\def\pgf@circ@tgeneric@path#1{\pgf@circ@bipole@path{tgeneric}{#1}}
+\def\pgf@circ@fullgeneric@path#1{\pgf@circ@bipole@path{fullgeneric}{#1}}
+\def\pgf@circ@tfullgeneric@path#1{\pgf@circ@bipole@path{tfullgeneric}{#1}}
+\def\pgf@circ@ammeter@path#1{\pgf@circ@bipole@path{ammeter}{#1}}
+\def\pgf@circ@ohmmeter@path#1{\pgf@circ@bipole@path{ohmmeter}{#1}}
+\def\pgf@circ@voltmeter@path#1{\pgf@circ@bipole@path{voltmeter}{#1}}
+\def\pgf@circ@empty@path#1{}
+\def\pgf@circ@photoresistor@path#1{\pgf@circ@bipole@path{photoresistor}{#1}}
+\def\pgf@circ@emptythyristor@path#1{\pgf@circ@bipole@path{emptythyristor}{#1}}
+\def\pgf@circ@fullthyristor@path#1{\pgf@circ@bipole@path{fullthyristor}{#1}}
+\def\pgf@circ@toggleswitch@path#1{\pgf@circ@bipole@path{toggleswitch}{#1}}
+\def\pgf@circ@memristor@path#1{\pgf@circ@bipole@path{memristor}{#1}}
+\def\pgf@circ@emptytriac@path#1{\pgf@circ@bipole@path{emptytriac}{#1}}
+\def\pgf@circ@fulltriac@path#1{\pgf@circ@bipole@path{fulltriac}{#1}}
+\def\pgf@circ@tline@path#1{\pgf@circ@bipole@path{tline}{#1}}
+\def\pgf@circ@squid@path#1{\pgf@circ@bipole@path{squid}{#1}}
+\def\pgf@circ@barrier@path#1{\pgf@circ@bipole@path{barrier}{#1}}
+\def\pgf@circ@thermocouple@path#1{\pgf@circ@bipole@path{thermocouple}{#1}}
+\def\pgf@circ@fuse@path#1{\pgf@circ@bipole@path{fuse}{#1}}
+\def\pgf@circ@afuse@path#1{\pgf@circ@bipole@path{afuse}{#1}}
+
+\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
+\def\pgf@circ@europeangfsurgearrester@path#1{\pgf@circ@bipole@path{european gas filled surge arrester}{#1}}
+\def\pgf@circ@americangfsurgearrester@path#1{\pgf@circ@bipole@path{american gas filled surge arrester}{#1}}
+
+\def\pgf@circ@twoport@path#1{\pgf@circ@bipole@path{twoport}{#1}}
+\def\pgf@circ@vco@path#1{\pgf@circ@bipole@path{vco}{#1}}
+\def\pgf@circ@bandpass@path#1{\pgf@circ@bipole@path{bandpass}{#1}}
+\def\pgf@circ@bandstop@path#1{\pgf@circ@bipole@path{bandstop}{#1}}
+\def\pgf@circ@highpass@path#1{\pgf@circ@bipole@path{highpass}{#1}}
+\def\pgf@circ@lowpass@path#1{\pgf@circ@bipole@path{lowpass}{#1}}
+\def\pgf@circ@adc@path#1{\pgf@circ@bipole@path{adc}{#1}}
+\def\pgf@circ@dac@path#1{\pgf@circ@bipole@path{dac}{#1}}
+\def\pgf@circ@dsp@path#1{\pgf@circ@bipole@path{dsp}{#1}}
+\def\pgf@circ@fft@path#1{\pgf@circ@bipole@path{fft}{#1}}
+\def\pgf@circ@amp@path#1{\pgf@circ@bipole@path{amp}{#1}}
+\def\pgf@circ@vamp@path#1{\pgf@circ@bipole@path{vamp}{#1}}
+\def\pgf@circ@piattenuator@path#1{\pgf@circ@bipole@path{piattenuator}{#1}}
+\def\pgf@circ@vpiattenuator@path#1{\pgf@circ@bipole@path{vpiattenuator}{#1}}
+\def\pgf@circ@tattenuator@path#1{\pgf@circ@bipole@path{tattenuator}{#1}}
+\def\pgf@circ@vtattenuator@path#1{\pgf@circ@bipole@path{vtattenuator}{#1}}
+\def\pgf@circ@phaseshifter@path#1{\pgf@circ@bipole@path{phaseshifter}{#1}}
+\def\pgf@circ@vphaseshifter@path#1{\pgf@circ@bipole@path{vphaseshifter}{#1}}
+\def\pgf@circ@detector@path#1{\pgf@circ@bipole@path{detector}{#1}}
+
+%%Mechanical
+\def\pgf@circ@spring@path#1{\pgf@circ@bipole@path{spring}{#1}}
+\def\pgf@circ@mass@path#1{\pgf@circ@bipole@path{mass}{#1}}
+\def\pgf@circ@damper@path#1{\pgf@circ@bipole@path{damper}{#1}}
+
+
+
+
+%% Styles
+
+\def\comnpatname{\ifpgf@circuit@compat *\else\fi}
+\def\compattikzset#1{\tikzset{\comnpatname#1}}
+
+%\def\ctikzsetbipole#1#2{%
+% \tikzset{#1/.style= {to path=#2, \circuitikzbasekey, l=##1}}%
+%}
+
+\compattikzset{spring/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@spring@path, l=#1}}
+\compattikzset{mass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mass@path, l=#1}}
+\compattikzset{damper/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@damper@path, l=#1}}
+\compattikzset{resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistor@path, l=#1}}
+\compattikzset{american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{resistor}{#1}, l=#1}}
+\compattikzset{european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{generic}{#1}, l=#1}}
+\compattikzset{potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@potentiometer@path, l=#1}}
+\compattikzset{varistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@varistor@path, l=#1}}
+\compattikzset{photoresistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@photoresistor@path, l=#1}}
+\compattikzset{thermistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistor@path, l=#1}}
+\compattikzset{thermistor ptc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorptc@path, l=#1}}
+\compattikzset{thermistor ntc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{american potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{potentiometer}{#1}, l=#1}}
+\compattikzset{european potentiometer/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{genericpotentiometer}{#1}, l=#1}}
+\compattikzset{variable resistor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vresistor@path, l=#1}}
+\compattikzset{variable american resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{vresistor}{#1}, l=#1}}
+\compattikzset{variable european resistor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@bipole@path{tgeneric}{#1}, l=#1}}
+\compattikzset{capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitor@path, l=#1}}
+\compattikzset{elko/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{ecapacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ecapacitor@path, l=#1}}
+\compattikzset{polar capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@polarcapacitor@path, l=#1}}
+\compattikzset{variable capacitor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcapacitor@path, l=#1}}
+\compattikzset{piezoelectric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piezoelectric@path, l=#1}}
+\compattikzset{battery/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@battery@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batteryone@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{battery2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@batterytwo@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductor@path, l=#1}}
+\compattikzset{gf surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americangfsurgearrester@path, l=#1}}
+\compattikzset{european gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeangfsurgearrester@path, l=#1}}
+\compattikzset{gas filled surge arrester/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@gfsurgearrester@path, l=#1}}
+\compattikzset{american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductor@path, l=#1}}
+\compattikzset{cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductor@path, l=#1}}
+\compattikzset{european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductor@path, l=#1}}
+\compattikzset{variable inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vinductor@path, l=#1}}
+\compattikzset{variable european inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@veuropeaninductor@path, l=#1}}
+\compattikzset{variable american inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamericaninductor@path, l=#1}}
+\compattikzset{variable cute inductor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vcuteinductor@path, l=#1}}
+\compattikzset{tline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tline@path, l=#1}}
+\compattikzset{transmission line/.style = {tline = #1}}
+\compattikzset{TL/.style = {tline = #1}}
+\compattikzset{european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsource@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{american controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceam@path, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisource@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{american controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceam@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{square voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcesquare@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{triangle voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourcetri@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1 }}
+\compattikzset{sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{controlled sinusoidal voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourcesin@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{controlled sinusoidal current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourcesin@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+
+\compattikzset{voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi current source = #1, \circuitikzbasekey/bipole/is current=true}}
+\compattikzset{controlled voltage source/.style = {\comnpatname \ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source, \circuitikzbasekey/bipole/is voltage=true, v=#1}}
+\compattikzset{controlled current source/.style = {\comnpatname \ifpgf@circuit@europeancurrent european \else american \fi controlled current source = #1, \circuitikzbasekey/bipole/is current=true}}
+
+
+\compattikzset{generic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@generic@path, l=#1}}
+\compattikzset{ageneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ageneric@path, l=#1}}
+\compattikzset{tgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tgeneric@path, l=#1}}
+\compattikzset{fullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullgeneric@path, l=#1}}
+\compattikzset{tfullgeneric/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tfullgeneric@path, l=#1}}
+\compattikzset{short/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@short@path}}
+\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
+
+\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
+
+\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
+\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
+\compattikzset{thermocouple/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermocouple@path}}
+\compattikzset{fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fuse@path}}
+\compattikzset{asymmetric fuse/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@afuse@path}}
+
+\compattikzset{twoport/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@twoport@path}}
+\compattikzset{vco/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vco@path}}
+\compattikzset{bandpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandpass@path}}
+\compattikzset{bandstop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bandstop@path}}
+\compattikzset{highpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@highpass@path}}
+\compattikzset{lowpass/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lowpass@path}}
+\compattikzset{adc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@adc@path}}
+\compattikzset{dac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dac@path}}
+\compattikzset{dsp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dsp@path}}
+\compattikzset{fft/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fft@path}}
+\compattikzset{amp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@amp@path}}
+\compattikzset{vamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vamp@path}}
+\compattikzset{piattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@piattenuator@path}}
+\compattikzset{vpiattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vpiattenuator@path}}
+\compattikzset{tattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@tattenuator@path}}
+\compattikzset{vtattenuator/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vtattenuator@path}}
+\compattikzset{phaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@phaseshifter@path}}
+\compattikzset{vphaseshifter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vphaseshifter@path}}
+\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
+
+% % % % % %
+% % Beginn of Diodes
+% % % % % %
+
+\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
+\def\pgf@circ@fullzdiode@path#1{\pgf@circ@bipole@path{fullzdiode}{#1}}
+\def\pgf@circ@fullzzdiode@path#1{\pgf@circ@bipole@path{fullzzdiode}{#1}}
+\def\pgf@circ@fullsdiode@path#1{\pgf@circ@bipole@path{fullsdiode}{#1}}
+\def\pgf@circ@fulltdiode@path#1{\pgf@circ@bipole@path{fulltdiode}{#1}}
+\def\pgf@circ@fulllediode@path#1{\pgf@circ@bipole@path{fulllediode}{#1}}
+\def\pgf@circ@fullpdiode@path#1{\pgf@circ@bipole@path{fullpdiode}{#1}}
+\def\pgf@circ@fullvarcap@path#1{\pgf@circ@bipole@path{fullvarcap}{#1}}
+\def\pgf@circ@emptydiode@path#1{\pgf@circ@bipole@path{emptydiode}{#1}}
+\def\pgf@circ@emptyzdiode@path#1{\pgf@circ@bipole@path{emptyzdiode}{#1}}
+\def\pgf@circ@emptyzzdiode@path#1{\pgf@circ@bipole@path{emptyzzdiode}{#1}}
+\def\pgf@circ@emptysdiode@path#1{\pgf@circ@bipole@path{emptysdiode}{#1}}
+\def\pgf@circ@emptytdiode@path#1{\pgf@circ@bipole@path{emptytdiode}{#1}}
+\def\pgf@circ@emptylediode@path#1{\pgf@circ@bipole@path{emptylediode}{#1}}
+\def\pgf@circ@emptypdiode@path#1{\pgf@circ@bipole@path{emptypdiode}{#1}}
+\def\pgf@circ@emptyvarcap@path#1{\pgf@circ@bipole@path{emptyvarcap}{#1}}
+
+\compattikzset{full diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulldiode@path}}
+\compattikzset{full Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullsdiode@path}}
+\compattikzset{full Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzdiode@path}}
+\compattikzset{full ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullzzdiode@path}}
+\compattikzset{full tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltdiode@path}}
+\compattikzset{full photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullpdiode@path}}
+\compattikzset{full led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulllediode@path}}
+\compattikzset{full varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullvarcap@path}}
+\compattikzset{full thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullthyristor@path}}
+\compattikzset{full triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fulltriac@path}}
+
+\compattikzset{empty diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{empty Schottky diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{empty Zener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{empty ZZener diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{empty tunnel diode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{empty photodiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{empty led/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{empty varcap/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{empty thyristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptythyristor@path}}
+\compattikzset{empty triac/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\compattikzset{stroke diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptydiode@path}}
+\compattikzset{stroke Schottky diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptysdiode@path}}
+\compattikzset{stroke Zener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzdiode@path}}
+\compattikzset{stroke ZZener diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyzzdiode@path}}
+\compattikzset{stroke tunnel diode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytdiode@path}}
+\compattikzset{stroke photodiode/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptypdiode@path}}
+\compattikzset{stroke led/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptylediode@path}}
+\compattikzset{stroke varcap/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptyvarcap@path}}
+\compattikzset{stroke thyristor/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptythyristor@path}}
+%\compattikzset{stroke triac/.style = {\circuitikzbasekey,\circuitikzbasekey/bipole/is strokedsymbol=true, /tikz/to path=\pgf@circ@emptytriac@path}}
+
+\def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi}
+
+\compattikzset{Schottky diode/.style = {\comnpatname \pgfcircdiodestylemacro Schottky diode}}
+\compattikzset{Zener diode/.style = {\comnpatname \pgfcircdiodestylemacro Zener diode}}
+\compattikzset{ZZener diode/.style = {\comnpatname \pgfcircdiodestylemacro ZZener diode}}
+\compattikzset{tunnel diode/.style = {\comnpatname \pgfcircdiodestylemacro tunnel diode}}
+\compattikzset{photodiode/.style = {\comnpatname \pgfcircdiodestylemacro photodiode}}
+\compattikzset{led/.style = {\comnpatname \pgfcircdiodestylemacro led}}
+\compattikzset{varcap/.style = {\comnpatname \pgfcircdiodestylemacro varcap}}
+\compattikzset{diode/.style = {\comnpatname \pgfcircdiodestylemacro diode}}
+\compattikzset{thyristor/.style = {\comnpatname \pgfcircdiodestylemacro thyristor}}
+\compattikzset{triac/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi triac}}%no stroke triac!
+
+%% Define Shortcuts
+\compattikzset{Do/.style = {\comnpatname empty diode}}
+\compattikzset{tDo/.style = {\comnpatname empty tunnel diode}}
+\compattikzset{zDo/.style = {\comnpatname empty Zener diode}}
+\compattikzset{zzDo/.style = {\comnpatname empty ZZener diode}}
+\compattikzset{sDo/.style = {\comnpatname empty Schottky diode}}
+\compattikzset{pDo/.style = {\comnpatname empty photodiode}}
+\compattikzset{leDo/.style = {\comnpatname empty led}}
+\compattikzset{VCo/.style = {\comnpatname empty varcap}}
+\compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
+\compattikzset{Tro/.style = {\comnpatname empty triac}}
+
+\compattikzset{D*/.style = {\comnpatname full diode}}
+\compattikzset{tD*/.style = {\comnpatname full tunnel diode}}
+\compattikzset{zD*/.style = {\comnpatname full Zener diode}}
+\compattikzset{zzD*/.style = {\comnpatname full ZZener diode}}
+\compattikzset{sD*/.style = {\comnpatname full Schottky diode}}
+\compattikzset{pD*/.style = {\comnpatname full photodiode}}
+\compattikzset{leD*/.style = {\comnpatname full led}}
+\compattikzset{VC*/.style = {\comnpatname full varcap}}
+\compattikzset{Ty*/.style = {\comnpatname full thyristor}}
+\compattikzset{Tr*/.style = {\comnpatname full triac}}
+
+\compattikzset{D/.style = {\comnpatname diode}}
+\compattikzset{tD/.style = {\comnpatname tunnel diode}}
+\compattikzset{zD/.style = {\comnpatname Zener diode}}
+\compattikzset{zzD/.style = {\comnpatname ZZener diode}}
+\compattikzset{sD/.style = {\comnpatname Schottky diode}}
+\compattikzset{pD/.style = {\comnpatname photodiode}}
+\compattikzset{leD/.style = {\comnpatname led}}
+\compattikzset{VC/.style = {\comnpatname varcap}}
+\compattikzset{Ty/.style = {\comnpatname thyristor}}
+\compattikzset{Tr/.style = {\comnpatname triac}}
+
+\compattikzset{D-/.style = {\comnpatname stroke diode}}
+\compattikzset{tD-/.style = {\comnpatname stroke tunnel diode}}
+\compattikzset{zD-/.style = {\comnpatname stroke Zener diode}}
+\compattikzset{zzD-/.style = {\comnpatname stroke ZZener diode}}
+\compattikzset{sD-/.style = {\comnpatname stroke Schottky diode}}
+\compattikzset{pD-/.style = {\comnpatname stroke photodiode}}
+\compattikzset{leD-/.style = {\comnpatname stroke led}}
+\compattikzset{VC-/.style = {\comnpatname stroke varcap}}
+\compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
+\compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
+
+% % % % % %
+% % End of Diodes
+% % % % % %
+
+
+\compattikzset{memristor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@memristor@path}}
+\compattikzset{closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ospst@path, l=#1}}
+\compattikzset{ncs/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
+\compattikzset{nos/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
+\compattikzset{normal closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncs@path, l=#1}}
+\compattikzset{normal open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@nos@path, l=#1}}
+\compattikzset{switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cspst@path, l=#1}}
+\compattikzset{push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
+
+\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
+\compattikzset{voltmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@voltmeter@path}}
+\compattikzset{ohmmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ohmmeter@path}}
+
+% short forms
+\compattikzset{esource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@esource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{pvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcvsource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcvsource@path, \circuitikzbasekey/bipole/is voltage=true,\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{dcisource/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@dcisource@path, \circuitikzbasekey/bipole/is current=true, l=#1}}
+
+\compattikzset{ioosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is current=true,/tikz/to path=\pgf@circ@oosource@path, i=#1}}
+\compattikzset{voosource/.style = {\circuitikzbasekey, \circuitikzbasekey/bipole/is voltage=true,/tikz/to path=\pgf@circ@oosource@path, v=#1}}
+
+\compattikzset{vsource/.style = {\comnpatname voltage source = #1}}
+\compattikzset{isource/.style = {\comnpatname current source = #1}}
+\compattikzset{cisource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{cvsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{vsourcesin/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{vsourcesquare/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{vsourcetri/.style = {triangle voltage source = #1}}
+\compattikzset{isourcesin/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{cisourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\compattikzset{cvsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+
+\compattikzset{controlled vsource/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{controlled isource/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{controlled vsourcesin/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\compattikzset{controlled isourcesin/.style = {\comnpatname controlled sinusoidal current source = #1}}
+
+\compattikzset{R/.style= {\comnpatname resistor = #1}}
+%\ifpgf@circuit@compat\else\compattikzset{R/.style= {resistor = #1}}\fi
+\compattikzset{vR/.style= {\comnpatname variable resistor = #1}}
+\compattikzset{phR/.style= {\comnpatname photoresistor = #1}}
+\compattikzset{thR/.style= {\comnpatname thermistor = #1}}
+\compattikzset{thRp/.style= {\comnpatname thermistor ptc= #1}}
+\compattikzset{thRn/.style= {\comnpatname thermistor ntc= #1}}
+\compattikzset{pR/.style= {\comnpatname potentiometer = #1}}
+\compattikzset{C/.style = {\comnpatname capacitor = #1}}
+\compattikzset{eC/.style = {\comnpatname ecapacitor = #1}}
+\compattikzset{pC/.style = {\comnpatname polar capacitor = #1}}
+\compattikzset{vC/.style = {\comnpatname variable capacitor = #1}}
+\compattikzset{PZ/.style = {\comnpatname piezoelectric = #1}}
+\compattikzset{L/.style = {\comnpatname inductor = #1}}
+\compattikzset{vL/.style = {\comnpatname variable inductor = #1}}
+\compattikzset{V/.style = {\comnpatname voltage source = #1}}
+\compattikzset{cV/.style = {\comnpatname controlled voltage source = #1}}
+\compattikzset{sV/.style = {\comnpatname sinusoidal voltage source = #1}}
+\compattikzset{sqV/.style = {\comnpatname square voltage source = #1}}
+\compattikzset{tV/.style = {\comnpatname triangle voltage source = #1}}
+\compattikzset{csV/.style = {\comnpatname controlled sinusoidal voltage source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{V#1/.style = {\comnpatname voltage source, v#1=##1} }
+ \compattikzset{cV#1/.style = {\comnpatname controlled voltage source, v#1=##1} }
+ \compattikzset{sV#1/.style = {\comnpatname sinusoidal voltage source, v#1=##1} }
+ \compattikzset{csV#1/.style = {\comnpatname controlled sinusoidal voltage source, v#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+%current sources
+\compattikzset{I/.style = {\comnpatname current source = #1}}
+\compattikzset{cI/.style = {\comnpatname controlled current source = #1}}
+\compattikzset{sI/.style = {\comnpatname sinusoidal current source = #1}}
+\compattikzset{csI/.style = {\comnpatname controlled sinusoidal current source = #1}}
+\def\pgf@temp#1{
+ \compattikzset{I#1/.style = {\comnpatname current source, i#1=##1} }
+ \compattikzset{cI#1/.style = {\comnpatname controlled current source, i#1=##1} }
+ \compattikzset{sI#1/.style = {\comnpatname sinusoidal current source, i#1=##1} }
+ \compattikzset{csI#1/.style = {\comnpatname controlled sinusoidal current source, i#1=##1} }
+}
+\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<}
+\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^}
+\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
+
+
+
+\compattikzset{Mr/.style = {\comnpatname memristor}}
+
+\compattikzset{cspst/.style = {\comnpatname closing switch = #1}}
+\compattikzset{ospst/.style = {\comnpatname opening switch = #1}}
+\compattikzset{spst/.style = {\comnpatname switch = #1}}
+
+\compattikzset{afuse/.style = {\comnpatname asymmetric fuse=#1}}
+
+\compattikzset{vdd/.style = {\comnpatname vcc = #1}}
+\compattikzset{vss/.style = {\comnpatname vee = #1}}
+
+\def\inheritlogicport#1#2{
+ \pgfdeclareshape{#2 port}{
+ \inheritsavedanchors[from=#1 #2 port]
+ \inheritbackgroundpath[from=#1 #2 port]
+ \inheritanchor[from=#1 #2 port]{in}
+ \inheritanchor[from=#1 #2 port]{in 1}
+ \inheritanchor[from=#1 #2 port]{in 2}
+ \inheritanchor[from=#1 #2 port]{out}
+ \inheritanchor[from=#1 #2 port]{center}
+ \inheritanchor[from=#1 #2 port]{left}
+ }
+}
+
+\ifpgf@circuit@europeanlogicport
+ \inheritlogicport{european}{and}
+ \inheritlogicport{european}{or}
+ \inheritlogicport{european}{xor}
+ \inheritlogicport{european}{not}
+ \inheritlogicport{european}{nand}
+ \inheritlogicport{european}{nor}
+ \inheritlogicport{european}{xnor}
+\else
+ \inheritlogicport{american}{and}
+ \inheritlogicport{american}{or}
+ \inheritlogicport{american}{xor}
+ \inheritlogicport{american}{not}
+ \inheritlogicport{american}{nand}
+ \inheritlogicport{american}{nor}
+ \inheritlogicport{american}{xnor}
+\fi
+
+% Transistor like bipoles
+
+\def\pgf@circ@trans@path#1#2{
+ \pgfextra{
+ \edef\pgf@temp{\pgfkeysvalueof{/tikz/circuitikz/bipole/name}}
+ \def\pgf@circ@temp{#2}
+ \ifx\pgf@temp\pgf@circ@temp % if it has not a name
+ \pgfmathrandominteger{\pgf@circ@rand}{1000}{9999}
+ \ctikzset{bipole/name = trans\pgf@circ@rand} % create it
+ \fi
+ }
+ \ifpgf@circuit@bipole@inverted
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ \else
+ (\tikztostart) node[coordinate] (\ctikzvalof{bipole/name}start) {}
+ (\tikztotarget) node[coordinate] (\ctikzvalof{bipole/name}end) {}
+ \fi
+ \pgfextra{
+ \pgfmathanglebetweenpoints{\pgfpointanchor{\ctikzvalof{bipole/name}start}{center}}
+ {\pgfpointanchor{\ctikzvalof{bipole/name}end}{center}}
+ \pgfmathadd{\pgfmathresult}{-90}
+ \edef\pgf@circ@direction{\pgfmathresult}
+ }
+ ($(\tikztostart) ! .5 ! (\tikztotarget)$)
+ node[#1, /tikz/rotate=\pgf@circ@direction, xscale=\ctikzvalof{mirror value}]
+ (\ctikzvalof{bipole/name}) {} node {\ctikzvalof{bipole/label/name}}
+ \ifcsname pgf@anchor@#1@pathstart\endcsname%if special path-anchors are defined, use them!
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.pathstart)
+ (\ctikzvalof{bipole/name}.pathend) -- (\ctikzvalof{bipole/name}end.center)
+ \else
+ (\ctikzvalof{bipole/name}start.center) --(\ctikzvalof{bipole/name}.left)
+ (\ctikzvalof{bipole/name}.right) -- (\ctikzvalof{bipole/name}end.center)
+ \fi
+ \pgfextra{
+ \pgfcircresetpath
+ }
+ (\tikztotarget) \tikztonodes % e si continua
+}
+
+
+\def\pgf@circ@definetranspath#1{
+ \compattikzset{T#1/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@trans@path{#1}{}, l=##1}}
+}
+
+\pgf@circ@definetranspath{elmech}
+\pgf@circ@definetranspath{nmos}
+\pgf@circ@definetranspath{pmos}
+\pgf@circ@definetranspath{npn}
+\pgf@circ@definetranspath{pnp}
+\pgf@circ@definetranspath{nfet}
+\pgf@circ@definetranspath{nigfete}
+\pgf@circ@definetranspath{nigfetd}
+\pgf@circ@definetranspath{nigfetebulk}
+\pgf@circ@definetranspath{pfet}
+\pgf@circ@definetranspath{pigfete}
+\pgf@circ@definetranspath{pigfetd}
+\pgf@circ@definetranspath{pigfetebulk}
+\pgf@circ@definetranspath{njfet}
+\pgf@circ@definetranspath{pjfet}
+\pgf@circ@definetranspath{pigbt}
+\pgf@circ@definetranspath{nigbt}
+\pgf@circ@definetranspath{Lpigbt}
+\pgf@circ@definetranspath{Lnigbt}
+%%%---------- close: tex/pgfcircpath
+
+\ifpgf@circ@siunitx
+ \RequirePackage{xstring}[2009/03/13]
+ %\expandafter\let\csname angstrom\endcsname\relax
+ \RequirePackage{siunitx}
+\fi
+
+
+
+\newenvironment{circuitikz}{\begin{tikzpicture}}{\end{tikzpicture}}
+%override (unused) circuitikz environment for compability to externalization)
+\let\circuitikz\tikzpicture
+\let\endcircuitikz\endtikzpicture
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty
index c52499a7df2..753d5d16dbe 100644
--- a/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty
+++ b/Master/texmf-dist/tex/latex/circuitikz/circuitikz.sty
@@ -9,8 +9,8 @@
\NeedsTeXFormat{LaTeX2e}
-\def\pgfcircversion{0.9.0}
-\def\pgfcircversiondate{2019/05/10}
+\def\pgfcircversion{0.9.1}
+\def\pgfcircversiondate{2019/06/16}
\ProvidesPackage{circuitikz}%
[\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion]
@@ -78,10 +78,6 @@
\ctikzset{logic ports = european}
}
-\DeclareOption{europeanport}{
- \ctikzset{logic ports = european}
-}
-
\DeclareOption{european}{
\ctikzset{voltage=european} \ctikzset{current=european} \ctikzset{inductor=european}
\ctikzset{resistor=european} \ctikzset{logic ports=european} \ctikzset{gas filled surge arrester choice = european}
@@ -349,7 +345,7 @@
\input pgfcircflow.tex
% notice that the default is nooldvoltagedirections; it's not explicitly set to allow for the warning
-\ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages,americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels, nocompatibility}
+\ExecuteOptions{nofetbodydiode, nofetsolderdot, europeancurrents, europeanvoltages,americanports, americanresistors, cuteinductors ,europeangfsurgearrester, nosiunitx, noarrowmos, smartlabels}
\ProcessOptions\relax