summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex424
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex6905
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex299
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex288
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex458
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex1235
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex559
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex530
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex1352
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex631
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex6838
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex57
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex649
13 files changed, 12380 insertions, 7845 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
index 3d7d61c7bc6..8814c336a4f 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
@@ -15,6 +15,68 @@
\newdimen\pgf@circ@res@temp
% inital thickness
\newdimen \pgfstartlinewidth
+
+% arrow tips, ported over old arrows library (deprecated)
+% see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
+% this was the original definition of latex' tips, renamed to avoid clashes
+%
+\pgfarrowsdeclare{latexslim}{latexslim}
+{
+ \pgfutil@tempdima=0.28pt%
+ \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfarrowsleftextend{+-4\pgfutil@tempdima}
+ \pgfarrowsrightextend{+6\pgfutil@tempdima}
+}
+{
+ \pgfutil@tempdima=0.28pt%
+ \advance\pgfutil@tempdima by.3\pgflinewidth%
+ \pgfpathmoveto{\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{3.5\pgfutil@tempdima}{.5\pgfutil@tempdima}}
+ {\pgfqpoint{-1\pgfutil@tempdima}{1.5\pgfutil@tempdima}}
+ {\pgfqpoint{-4\pgfutil@tempdima}{3.75\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{-1.5\pgfutil@tempdima}{1\pgfutil@tempdima}}
+ {\pgfqpoint{-1.5\pgfutil@tempdima}{-1\pgfutil@tempdima}}
+ {\pgfqpoint{-4\pgfutil@tempdima}{-3.75\pgfutil@tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{-1\pgfutil@tempdima}{-1.5\pgfutil@tempdima}}
+ {\pgfqpoint{3.5\pgfutil@tempdima}{-.5\pgfutil@tempdima}}
+ {\pgfqpoint{6\pgfutil@tempdima}{0\pgfutil@tempdima}}
+ \pgfpathclose
+ \pgfusepathqfill
+}
+
+\pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
+
+%% Macro to fill or draw
+
+\def\pgf@circ@draworfill{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, fill}
+ \fi
+}
+
+\def\pgf@circ@draworfillandclip{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgfusepath{draw, clip}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{draw, clip, fill}
+ \fi
+}
+
+\def\pgf@circ@maybefill{%
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgfusepath{discard}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \pgfusepath{fill}
+ \fi
+}
%% Keys
\long\def\pgf@circ@comment#1{}
@@ -30,7 +92,17 @@
\newif\ifpgf@circ@siunitx
\newif\ifpgf@circuit@compat
-\newif\ifpgf@circ@oldvoltagedirection
+\newif\ifpgf@circ@oldvoltagedirection % default false
+\newif\ifpgf@circ@explicitvdir
+\newif\ifpgf@circ@fixbatteries
+
+\ctikzset{voltage dir/.is choice}
+\ctikzset{voltage dir/old/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/noold/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/RP/.code={\pgf@circ@oldvoltagedirectiontrue\pgf@circ@fixbatteriestrue}}
+\ctikzset{voltage dir/EF/.code={\pgf@circ@oldvoltagedirectionfalse\pgf@circ@fixbatteriestrue}}
+\tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
+
% Option ">" for twoports
\newif\ifpgf@circuit@inputarrow
@@ -54,34 +126,60 @@
% Option "t=*" for nodes
\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
-
+\ctikzset{current arrow scale/.initial=16}
\ctikzset{bipoles/.is family}
\ctikzset{bipoles/border margin/.initial=1.1}
-\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{tripoles/thickness/.initial=2}
+\ctikzset{quadpoles/thickness/.initial=2}
\ctikzset{nodes width/.initial=.04}
-\newdimen\pgf@circ@Rlen
+
+% Base len for all circuitikz
+\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/ground/connectionthickness/.initial=1}
+\ctikzset{monopoles/ground/thickness/.initial=2}
+\ctikzset{monopoles/rground/thickness/.initial=2}
\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/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/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
\ctikzset{monopoles/rxantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
+\ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
+\ctikzset{monopoles/waves/width/.initial=0.5}
+% microstrips
+\ctikzset{bipoles/mstline/height/.initial=0.3}
+\ctikzset{bipoles/mstline/width/.initial=1.2}
+\pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
+\ctikzset{monopoles/msport/width/.initial=.5}
+\ctikzset{monopoles/msrstub/height/.initial=1.0}
+\ctikzset{monopoles/msrstub/width/.initial=0.6}
+
+% microphone and loudspeaker
+\ctikzset{bipoles/loudspeaker/height/.initial=.8}
+\ctikzset{bipoles/loudspeaker/depth/.initial=.3}
+\ctikzset{bipoles/loudspeaker/width/.initial=.8}
+\ctikzset{bipoles/mic/height/.initial=1.2}
+\ctikzset{bipoles/mic/depth/.initial=.0}
+\ctikzset{bipoles/mic/width/.initial=.8}
\ctikzset{bipoles/resistor/height/.initial=.3}
\ctikzset{bipoles/resistor/width/.initial=.8}
@@ -108,17 +206,29 @@
\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/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
+%% Cute choke settings
+\ctikzset{bipoles/cutechoke/height/.initial=.3}
+\ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
+\ctikzset{bipoles/cutechoke/width/.initial=.6}
+\ctikzset{bipoles/cutechoke/coils/.initial=5}
+\ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
+\ctikzset{bipoles/cutechoke/cstep/.initial=.3}
+\ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
+\ctikzset{bipoles/cutechoke/cthick/.initial=1}
+\newif\ifpgf@circuit@bipole@twolines
+\pgf@circuit@bipole@twolinesfalse
+%
\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/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
@@ -190,6 +300,10 @@
\ctikzset{bipoles/battery2/width/.initial=.3}
\ctikzset{bipoles/diode/height/.initial=.50}
\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
+\ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
+\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
+\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
\ctikzset{bipoles/varcap/height/.initial=.50}
\ctikzset{bipoles/varcap/width/.initial=.45}
\ctikzset{bipoles/spst/height/.initial=.35}
@@ -197,8 +311,10 @@
\ctikzset{bipoles/spst/depth/.initial=.2}
\ctikzset{bipoles/nos/height/.initial=.3}
\ctikzset{bipoles/nos/width/.initial=.35}
+\ctikzset{bipoles/nos/depth/.initial=.2}
\ctikzset{bipoles/ncs/height/.initial=.35}
\ctikzset{bipoles/ncs/width/.initial=.35}
+\ctikzset{bipoles/ncs/depth/.initial=.2}
\ctikzset{bipoles/generic/height/.initial=.30}
\ctikzset{bipoles/generic/width/.initial=.80}
\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
@@ -242,6 +358,15 @@
\ctikzset{bipoles/ohmmeter/width/.initial=.60}
\ctikzset{bipoles/voltmeter/height/.initial=.60}
\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/smeter/height/.initial=.60}
+\ctikzset{bipoles/smeter/width/.initial=.60}
+\ctikzset{bipoles/qmeter/depth/.initial=.40}
+\ctikzset{bipoles/qmeter/height/.initial=.80}
+\ctikzset{bipoles/qmeter/width/.initial=.60}
+\ctikzset{bipoles/iloop/width/.initial=.40}
+\ctikzset{bipoles/iloop/height/.initial=.60}
+\ctikzset{bipoles/oscope/height/.initial=.60}
+\ctikzset{bipoles/oscope/width/.initial=.60}
\ctikzset{bipoles/buffer/height/.initial=1}
\ctikzset{bipoles/buffer/width/.initial=1}
\ctikzset{bipoles/not port/width/.initial=1}
@@ -249,6 +374,8 @@
\ctikzset{bipoles/not port/circle width/.initial=.15}
\ctikzset{bipoles/lamp/height/.initial=.60}
\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/bulb/height/.initial=.8}
+\ctikzset{bipoles/bulb/width/.initial=.8}
\ctikzset{bipoles/tline/height/.initial=.3}
\ctikzset{bipoles/tline/width/.initial=.8}
\ctikzset{bipoles/squid/height/.initial=.60}
@@ -259,7 +386,7 @@
\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/height 2/.initial=.2}
\ctikzset{bipoles/pushbutton/width/.initial=.50}
\ctikzset{bipoles/twoport/width/.initial=.7}
@@ -283,7 +410,12 @@
\ctikzset{bipoles/phaseshifter/width/.initial=.7}
\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
\ctikzset{bipoles/detector/width/.initial=.7}
+% resistive sensor american style
+\ctikzset{bipoles/resistivesens/height/.initial=.6}
+\ctikzset{bipoles/resistivesens/width/.initial=.8}
+% crossing wires
+\ctikzset{bipoles/crossing/size/.initial=.2}
\newif\ifpgf@circuit@trans@depletiontype
\pgf@circuit@trans@depletiontypefalse
@@ -293,14 +425,14 @@
\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
+% 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
+% 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}}
@@ -350,6 +482,7 @@
\ctikzset{tripoles/nmos/height/.initial=1.1}
\ctikzset{tripoles/nmos/base width/.initial=.5}
\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/arrow pos/.initial=.6}
\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
@@ -362,11 +495,24 @@
\ctikzset{tripoles/pmos/height/.initial=1.1}
\ctikzset{tripoles/pmos/base width/.initial=.5}
\ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/arrow pos/.initial=.4}
\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/hemt/width/.initial=.7}
+\ctikzset{tripoles/hemt/gate height/.initial=.35}
+\ctikzset{tripoles/hemt/base height/.initial=.5}
+\ctikzset{tripoles/hemt/conn height/.initial=0}
+\ctikzset{tripoles/hemt/height/.initial=1.1}
+\ctikzset{tripoles/hemt/base width/.initial=.5}
+\ctikzset{tripoles/hemt/gate width/.initial=.62}
+\ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/hemt/curr direction/.initial=1}
+
\ctikzset{tripoles/nfet/width/.initial=.7}
\ctikzset{tripoles/nfet/gate height/.initial=.35}
\ctikzset{tripoles/nfet/base height/.initial=.5}
@@ -470,6 +616,7 @@
\ctikzset{tripoles/npn/conn height/.initial=0}
\ctikzset{tripoles/npn/height/.initial=1.1}
\ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/arrow pos/.initial=.5}
\ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
\ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
\ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
@@ -482,6 +629,7 @@
\ctikzset{tripoles/pnp/conn height/.initial=0}
\ctikzset{tripoles/pnp/height/.initial=1.1}
\ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/arrow pos/.initial=.5}
\ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
\ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
\ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
@@ -579,8 +727,58 @@
\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{logic ports/european/.code= {\pgf@circuit@europeanlogicporttrue
+ \tikzset{and port/.style={shape=european and port}}
+ \tikzset{or port/.style={shape=european or port}}
+ \tikzset{xor port/.style={shape=european xor port}}
+ \tikzset{not port/.style={shape=european not port}}
+ \tikzset{nand port/.style={shape=european nand port}}
+ \tikzset{nor port/.style={shape=european nor port}}
+ \tikzset{xnor port/.style={shape=european xnor port}}
+ } }
+\ctikzset{logic ports/american/.code= {\pgf@circuit@europeanlogicportfalse
+ \tikzset{and port/.style={shape=american and port}}
+ \tikzset{or port/.style={shape=american or port}}
+ \tikzset{xor port/.style={shape=american xor port}}
+ \tikzset{not port/.style={shape=american not port}}
+ \tikzset{nand port/.style={shape=american nand port}}
+ \tikzset{nor port/.style={shape=american nor port}}
+ \tikzset{xnor port/.style={shape=american xnor port}}
+ } }
+
+\ctikzset{logic ports origin/.is choice}
+\ctikzset{logic ports origin/legacy/.code= {
+ \ctikzset{tripoles/american and port/origin/.initial=0.8}
+ \ctikzset{tripoles/american nand port/origin/.initial=0.8}
+ \ctikzset{tripoles/american nor port/origin/.initial=0.8}
+ \ctikzset{tripoles/american or port/origin/.initial=0.8}
+ \ctikzset{tripoles/american xor port/origin/.initial=0.8}
+ \ctikzset{tripoles/american xnor port/origin/.initial=0.8}
+ \ctikzset{tripoles/european and port/origin/.initial=0.8}
+ \ctikzset{tripoles/european nand port/origin/.initial=0.8}
+ \ctikzset{tripoles/european or port/origin/.initial=0.8}
+ \ctikzset{tripoles/european nor port/origin/.initial=0.8}
+ \ctikzset{tripoles/european xor port/origin/.initial=0.8}
+ \ctikzset{tripoles/european xnor port/origin/.initial=0.8}
+ \ctikzset{tripoles/european not port/origin/.initial=0.8}
+ }
+}
+\ctikzset{logic ports origin/center/.code= {
+ \ctikzset{tripoles/american and port/origin/.initial=0}
+ \ctikzset{tripoles/american nand port/origin/.initial=0}
+ \ctikzset{tripoles/american nor port/origin/.initial=0}
+ \ctikzset{tripoles/american or port/origin/.initial=0}
+ \ctikzset{tripoles/american xor port/origin/.initial=0}
+ \ctikzset{tripoles/american xnor port/origin/.initial=0}
+ \ctikzset{tripoles/european and port/origin/.initial=0}
+ \ctikzset{tripoles/european nand port/origin/.initial=0}
+ \ctikzset{tripoles/european or port/origin/.initial=0}
+ \ctikzset{tripoles/european nor port/origin/.initial=0}
+ \ctikzset{tripoles/european xor port/origin/.initial=0}
+ \ctikzset{tripoles/european xnor port/origin/.initial=0}
+ \ctikzset{tripoles/european not port/origin/.initial=0}
+ }
+}
\ctikzset{tripoles/american and port/width/.initial=1.1}
@@ -598,8 +796,8 @@
\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/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}
@@ -608,30 +806,44 @@
\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/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 xor port/distance/.initial=.1}
\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/distance/.initial=.1}
\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/american and port/origin/.initial=0.8}
+\ctikzset{tripoles/american and port/inputs/.initial=2}
+% variable number of inputs
+\ctikzset{tripoles/american nand port/origin/.initial=0.8}
+\ctikzset{tripoles/american nand port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/origin/.initial=0.8}
+\ctikzset{tripoles/american nor port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/angle/.initial=70}
+\ctikzset{tripoles/american nor port/inner/.initial=0.3}
+\ctikzset{tripoles/american or port/origin/.initial=0.8}
+\ctikzset{tripoles/american or port/inputs/.initial=2}
+\ctikzset{tripoles/american or port/angle/.initial=70}
+\ctikzset{tripoles/american or port/inner/.initial=0.3}
+\ctikzset{tripoles/american xor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xor port/inputs/.initial=2}
+\ctikzset{tripoles/american xor port/angle/.initial=70}
+\ctikzset{tripoles/american xor port/inner/.initial=0.3}
+\ctikzset{tripoles/american xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xnor port/inputs/.initial=2}
+\ctikzset{tripoles/american xnor port/angle/.initial=70}
+\ctikzset{tripoles/american xnor port/inner/.initial=0.3}
+
\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}
@@ -668,24 +880,102 @@
\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}
+% variable number of inputs
+\ctikzset{tripoles/european and port/origin/.initial=0.8}
+\ctikzset{tripoles/european and port/inputs/.initial=2}
+\ctikzset{tripoles/european nand port/origin/.initial=0.8}
+\ctikzset{tripoles/european nand port/inputs/.initial=2}
+\ctikzset{tripoles/european or port/origin/.initial=0.8}
+\ctikzset{tripoles/european or port/inputs/.initial=2}
+\ctikzset{tripoles/european nor port/origin/.initial=0.8}
+\ctikzset{tripoles/european nor port/inputs/.initial=2}
+\ctikzset{tripoles/european xor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xor port/inputs/.initial=2}
+\ctikzset{tripoles/european xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xnor port/inputs/.initial=2}
+\ctikzset{tripoles/european not port/origin/.initial=0.8}
+\ctikzset{tripoles/european not port/inputs/.initial=1}%
+%%% parameters that are not used anymore after multi-input
+%%% gates --- left for compatibility of source code.
+\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/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}
+% switches for logic gates
+%
+\pgfkeys{/tikz/number inputs/.initial=0}
+\pgfkeys{/tikz/number inputs/.default=0}
+%
+% switches for op amps
+% changing input polarity
+%
+\newif\ifpgf@circuit@oa@iplusup\pgf@circuit@oa@iplusupfalse
+\pgfkeys{/tikz/noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
+\ctikzset{noinv input up/.add code={}{\pgf@circuit@oa@iplusuptrue}}
+\pgfkeys{/tikz/input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
+\ctikzset{input noinv down/.add code={}{\pgf@circuit@oa@iplusupfalse}}
+%
+% changing output polarity (for fully diff objects)
+%
+\newif\ifpgf@circuit@oa@oplusup\pgf@circuit@oa@oplusuptrue
+\pgfkeys{/tikz/noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
+\ctikzset{noinv output up/.add code={}{\pgf@circuit@oa@oplusuptrue}}
+\pgfkeys{/tikz/noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
+\ctikzset{noinv output down/.add code={}{\pgf@circuit@oa@oplusupfalse}}
+%
\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/op amp/font/.initial= \fontsize{10}{12}\selectfont\boldmath}%absolute 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/en amp/font/.initial= \fontsize{10}{12}\selectfont}%absolute font size needed!
+\ctikzset{tripoles/en amp/font2/.initial= \fontsize{12}{14}\selectfont}%absolute font size needed!
+\ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
+\tikzset{
+ en amp text/.code = {
+ \ctikzsetvalof{tripoles/en amp/text}{#1}
+ },
+ en amp text A/.code = {
+ \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}
+ },
+}
\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/inst amp/width/.initial=1.7} % instrumentation amplifier, simple
+\ctikzset{tripoles/inst amp/port width/.initial=.7}
+\ctikzset{tripoles/inst amp/height/.initial=1.4}
+\ctikzset{tripoles/inst amp/input height/.initial=.5}
+\ctikzset{tripoles/inst amp/up pos/.initial=.4}
+\ctikzset{tripoles/inst amp/refv pos/.initial=.7}
+\ctikzset{tripoles/inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
+\ctikzset{tripoles/fd inst amp/width/.initial=1.7} % instrumentation amplifier, diff output
+\ctikzset{tripoles/fd inst amp/port width/.initial=.7}
+\ctikzset{tripoles/fd inst amp/height/.initial=1.4}
+\ctikzset{tripoles/fd inst amp/input height/.initial=.5}
+\ctikzset{tripoles/fd inst amp/up pos/.initial=.4}
+\ctikzset{tripoles/fd inst amp/refv pos/.initial=.7}
+\ctikzset{tripoles/fd inst amp/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
+\ctikzset{tripoles/inst amp ra/width/.initial=2.4} % instrumentation amplifier with ra gain resistance added
+\ctikzset{tripoles/inst amp ra/port width/.initial=.7}
+\ctikzset{tripoles/inst amp ra/height/.initial=2.9}
+\ctikzset{tripoles/inst amp ra/input height/.initial=.7}
+\ctikzset{tripoles/inst amp ra/up pos/.initial=.4}
+\ctikzset{tripoles/inst amp ra/refv pos/.initial=.7}
+\ctikzset{tripoles/inst amp ra/ra pos/.initial=.6}
+\ctikzset{tripoles/inst amp ra/font/.initial= \fontsize{10}{0}\selectfont\boldmath}%absolute font size needed!
\ctikzset{tripoles/plain amp/width/.initial=1.7}
\ctikzset{tripoles/plain amp/port width/.initial=.7}
\ctikzset{tripoles/plain amp/height/.initial=1.4}
@@ -704,6 +994,12 @@
\ctikzset{tripoles/triac/diode width left/.initial=.3}
\ctikzset{tripoles/triac/diode width right/.initial=.3}
+%% Cute switches
+\ctikzset{bipoles/cuteswitch/height/.initial=.6}
+\ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
+\ctikzset{bipoles/cuteswitch/width/.initial=.50}
+\ctikzset{bipoles/cuteswitch/thickness/.initial=1}
+
\ctikzset{tripoles/spdt/width/.initial=.85}
\ctikzset{tripoles/spdt/height/.initial=.45}
\ctikzset{tripoles/spdt/margin/.initial=.45}
@@ -740,6 +1036,45 @@
\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
+%
+% multipoles
+%
+\ctikzset{multipoles/thickness/.initial=2}
+\ctikzset{multipoles/font/.initial=\tiny}
+% DIP (dual in line package) chips
+\ctikzset{multipoles/dipchip/width/.initial=1.2}
+\ctikzset{multipoles/dipchip/num pins/.initial=8}
+\ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
+% QFP (quad flat package) chips
+\ctikzset{multipoles/qfpchip/num pins/.initial=8}
+\ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
+% chip numbers
+\newif\ifpgf@circuit@chip@shownumbers\pgf@circuit@chip@shownumberstrue
+\pgfkeys{/tikz/show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
+\ctikzset{show numbers/.add code={}{\pgf@circuit@chip@shownumberstrue}}
+\pgfkeys{/tikz/hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
+\ctikzset{hide numbers/.add code={}{\pgf@circuit@chip@shownumbersfalse}}
+\newif\ifpgf@circuit@chip@straightnumbers\pgf@circuit@chip@straightnumberstrue
+\pgfkeys{/tikz/straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
+\ctikzset{straight numbers/.add code={}{\pgf@circuit@chip@straightnumberstrue}}
+\pgfkeys{/tikz/rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
+\ctikzset{rotated numbers/.add code={}{\pgf@circuit@chip@straightnumbersfalse}}
+% external chip pins
+\ctikzset{multipoles/external pins thickness/.initial=1}
+\ctikzset{multipoles/external pins width/.initial=0.2}
+\ctikzset{multipoles/external pad fraction/.initial=0}
+\pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
+\pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
+% topmarks
+\newif\ifpgf@circuit@chip@topmark\pgf@circuit@chip@topmarktrue
+\pgfkeys{/tikz/topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
+\ctikzset{topmark/.add code={}{\pgf@circuit@chip@topmarktrue}}
+\pgfkeys{/tikz/no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
+\ctikzset{no topmark/.add code={}{\pgf@circuit@chip@topmarkfalse}}
+
+
% %Mechanical section
\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
@@ -837,9 +1172,6 @@
\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 }
@@ -868,7 +1200,6 @@
\ctikzset{color/.initial=black}
\pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
-
\newif\ifpgf@circ@siunitx
\newif\ifpgf@circ@siunitx@res
@@ -886,8 +1217,16 @@
\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/shift/.initial=0.0} % shift form the cable of voltage symbols
+\ctikzset{voltage shift/.style={voltage/shift=#1}}
+\tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
\ctikzset{voltage/european label distance/.initial=1.4}
\ctikzset{voltage/american label distance/.initial=1.1}
+% shaping the +/- sign, see pgfcircvoltage.tex
+\ctikzset{voltage/american font/.initial={}}
+\ctikzset{voltage/american plus/.initial={$+$}}
+\ctikzset{voltage/american minus/.initial={$-$}}
+
% special cases
\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
@@ -948,7 +1287,7 @@
\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)
+% I should try to make the tree clearer (this voltage conflicts with the options above)
\newif\ifpgf@circuit@europeanvoltage
\ctikzset{voltage/.is choice}
@@ -960,6 +1299,9 @@
\ctikzset{current/american/.code = \pgf@circuit@europeancurrentfalse }
\ctikzset{current/european/.code = \pgf@circuit@europeancurrenttrue }
+% noise sources
+\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
+
\ctikzset{label/align/.is choice}
\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
index 2850c146763..b69e9c47708 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
@@ -5,7 +5,7 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
%% Generic macro for defining a bipole shape
% #1 - additional anchors
@@ -17,900 +17,1475 @@
\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}
- }
- }
+ \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{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{ne}{
+ \northeast
+ }
+ \anchor{nw}{
+ \northeast
+ \pgf@x=-\pgf@x
+ }
+ \anchor{e}{
+ \northeast
+ \pgf@y=0cm
+ }
+ \anchor{s}{
+ \southwest
+ \pgf@x=0cm
+ }
+ \anchor{south east}{
+ \southwest
+ \pgf@x=-\pgf@x
+ }
+ \anchor{south west}{
+ \southwest
+ }
+ \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}
+\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
+\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{latexslim}
+ \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
+\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}}
+ \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}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfusepath{draw}
}
+%% Capacitive sensor
+\pgfcircdeclarebipole
+{\anchor{label}{%
+ \southwest
+ \pgf@x=2.6\pgf@x
+ \pgf@y=1.4\pgf@y
+ }%
+}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitivesens}
+{\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}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.4\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.4\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
%% 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}
-
+\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} $+$}
+\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}}
+ \pgf@circ@draworfill
+ % % 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
+\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}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}}
+ \ifpgf@circ@fixbatteries
+ \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}{\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}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}}
- \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \else
+ \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}}
+ \fi
+ \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}
+\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}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \else
+ \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}}
+ \fi
+ \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}
+\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}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \ifpgf@circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \else
+ \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}}
+ \fi
+ \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
+\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@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}
+ \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
+%% cute inductive sensor
+
+\pgfcircdeclarebipole
+{%
+{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf@x=0.8\pgf@x
+ \pgf@y=2.6\pgf@y
+ }%
+}}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{scuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
-\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@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/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}
+ \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}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
}
+%% cute choke
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cutechoke/lower coil height}}
+{cutechoke}
+{\ctikzvalof{bipoles/cutechoke/height}}
+{\ctikzvalof{bipoles/cutechoke/width}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf@circ@res@other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\pgf@circ@Rlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)}
+
+
+ \pgfmathsetlength{\pgf@circ@res@step}
+ {(\ctikzvalof{bipoles/cutechoke/width}*\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/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/cutechoke/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}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
+ \pgfusepath{stroke}
+
+ \ifpgf@circuit@bipole@twolines
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf@circ@res@up}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}*\ctikzvalof{bipoles/cutechoke/cthick}\pgfstartlinewidth}
+ \pgfusepath{stroke}
+ \fi
+}
+
+%% 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{latexslim}
+ \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}
+\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}
+}
+
+
+%% american inductive sensor
+
+\pgfcircdeclarebipole
+{%
+{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf@x=0.8\pgf@x
+ \pgf@y=2.6\pgf@y
+ }%
+}}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{samericaninductor}
+{\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}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\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
- \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}
+\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
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsource}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \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}}{
+\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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \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
-}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{vsourcesin}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{\ctikzvalof{bipoles/vsourcesin/width}}
+{
-% 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}}
+ \pgf@circ@draworfill
- \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
+ \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
}
-
% 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
+\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}}
+ \pgf@circ@draworfill
+ \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
-}
+\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}}
+ \pgf@circ@draworfill
-%% 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}
+ \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
}
+
%% 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}
+\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}}
+ \pgf@circ@draworfill
- \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}
+ \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}}
+ \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}
+ \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
+ %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}
+\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}}
+ \pgf@circ@draworfill
}
%% 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
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/dcisource/height}}
+{dcisource}
+{\ctikzvalof{bipoles/dcisource/height}}
+{\ctikzvalof{bipoles/dcisource/width}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}
+ \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}
+\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}}
+ \pgf@circ@draworfill
+ \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}
+\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}}
+ \pgf@circ@draworfill
}
%% 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}
+\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}
+ \pgf@circ@maybefill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@right}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@right}
+ \pgf@circ@draworfill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf@circ@res@left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf@circ@res@left}
+ \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}
+\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}}
+ \pgf@circ@draworfill
- \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
+ \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
+\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}}
+ \pgf@circ@draworfill
+
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsource}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
- \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}
+ \pgfpathmoveto{\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
+\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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cvsourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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
+ \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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \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
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cisourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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
+ \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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \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
+ \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}
-%% Controlled current source
-
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisource/height}}{cisource}{\ctikzvalof{bipoles/cisource/height}}{\ctikzvalof{bipoles/cisource/width}}{
+ \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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
- \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}
+ \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}
-%% Controlled current source - American
+ \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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \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
+}
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cisourceam/height}}{cisourceAM}{\ctikzvalof{bipoles/cisourceam/height}}{\ctikzvalof{bipoles/cisourceam/width}}{
+%% Cute Independent voltage source
- \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
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceC}
+{\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}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+%% Cute Independent current source
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceC}
+{\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}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+%% Cute Controlled voltage source
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsourceC}
+{\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}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
}
+%% Cute Controlled current source
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisourceC}
+{\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}}
+ \pgf@circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Noise voltage source
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceN}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ %
+ \pgf@circ@res@step=0.125\pgf@circ@Rlen\relax
+ \edef\pgf@noise@temp{dashed}
+ \edef\pgf@noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
+ \ifx\pgf@noise@temp\pgf@noise@fill
+ % fillable in this case
+ \pgf@circ@draworfillandclip
+ \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ %
+ \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf@noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+%% Noise current source
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceN}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ %
+ \pgf@circ@res@step=0.125\pgf@circ@Rlen\relax
+ \edef\pgf@noise@temp{dashed}
+ \edef\pgf@noise@fill{\pgfkeysvalueof{/tikz/circuitikz/bipoles/noise sources/fillcolor}}
+ \ifx\pgf@noise@temp\pgf@noise@fill
+ % fillable in this case
+ \pgf@circ@draworfillandclip
+ \pgfmathsetmacro{\thinner}{.5*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ %
+ \advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf@noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
%% Black generic diode
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/diode/height}}{fulldiode}{\ctikzvalof{bipoles/diode/height}}{\ctikzvalof{bipoles/diode/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulldiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
@@ -931,175 +1506,227 @@
%% 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
+\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
+\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}
+\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{latexslim}
+ \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}}{
+\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}
+ \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{latexslim}
+ \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}
+\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}}{
+%% Code for the diode triangle
+\def\pgf@circ@basicdiodeshape{
+ % \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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ % \endpgfscope
+}
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+%% Empty generic diode
- \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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptydiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \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}}{
+\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}
+ \pgf@circ@basicdiodeshape
\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}}
@@ -1109,337 +1736,688 @@
}
%% 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
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptysdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \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
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptytdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptylediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \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{latexslim}
+ \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}}{
+\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}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope
+ \pgf@circ@basicdiodeshape
+ \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{latexslim}
+ \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}
+\pgfcircdeclarebipole
+{}
+{\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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ %
+ \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}}{
+%% Empty bidirectionaldiode
+
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{emptybidirectionaldiode}{\ctikzvalof{bipoles/bidirectionaldiode/height}}{\ctikzvalof{bipoles/bidirectionaldiode/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
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/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)}}
+
+ \pgf@circ@draworfill
+ % \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}
+
+}
+
+
+%% Full bidirectionaldiode
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{fullbidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+
+ \pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left
+ \pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/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@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}
+
+}
+
+%% (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}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
}
%% Opening SPST
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/spst/depth}}{ospst}{\ctikzvalof{bipoles/spst/height}}{\ctikzvalof{bipoles/spst/width}}{
+\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}
+ \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}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
}
%% Normal open Switch
-\pgfcircdeclarebipole{}{0}{nos}{\ctikzvalof{bipoles/nos/height}}{\ctikzvalof{bipoles/nos/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/nos/depth}}
+{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}
+ \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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/ncs/depth}}
+{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}}
+\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
+%% Normally closed Push Button
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{ncpushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
+ \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}}
+ \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}}
}
+% cute switch "to" shapes help function
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutesw#1#2#3{
+ \pgfcircdeclarebipole
+ {
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgf@circ@res@down = -.5\pgf@y
+ \pgf@circ@res@up = .5\pgf@y
+ \pgfextracty{\pgf@circ@res@other}{#2}
+ \pgf@x=0pt
+ \pgf@y=.5\pgf@circ@res@other
+ }
+ % mid of the lever, to stack switches
+ \anchor{mid}{\midlever}
+ \anchor{out}{\northeast \pgf@y=0cm}
+ \anchor{in}{\southwest\pgf@y=0cm}
+ }
+ {\ctikzvalof{bipoles/cuteswitch/height 2}}
+ {#1}
+ {\ctikzvalof{bipoles/cuteswitch/height}}
+ {\ctikzvalof{bipoles/cuteswitch/width}}{
+ \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=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ \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}}
+ }
+}
+
+%% closed cute switch
+\pgfcircdeclarecutesw{cuteclosedswitch}
+ {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
+ {}
+
+%% open cute switch
+\pgfcircdeclarecutesw{cuteopenswitch}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ {}
+
+%% closing cute switch
+\pgfcircdeclarecutesw{cuteclosingswitch}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ {
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+ }
+
+%% opening cute switch
+\pgfcircdeclarecutesw{cuteopeningswitch}
+ {\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}}
+ {
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
+ \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \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}
+ \pgf@circ@draworfill
+ \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}}{}{}
+\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$}{}{}
+\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}}{}{}
-
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{voltmeter}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{\ctikzvalof{bipoles/voltmeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\textbf{V}}{}{}
+
}
+% oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
+\pgfcircdeclarebipole
+{
+ \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
+ \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/oscope/height}}
+{oscope}
+{\ctikzvalof{bipoles/oscope/height}}
+{\ctikzvalof{bipoles/oscope/width}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ % this would create a round (analog?) scope...
+ % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % grid
+ \pgfscope
+ \pgfsetlinewidth{0.5\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathgrid[stepx=\pgf@circ@res@step, stepy=\pgf@circ@res@step]%
+ {\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}}
+ {\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}}
+ \pgfsetstrokeopacity{0.5}
+ \pgfusepath{draw}
+ \endpgfscope
+ % function displayed, thanks to
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf@circ@res@left}{0.25\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf@circ@res@right}{0.25\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
%% Short circuit
-\pgfcircdeclarebipole{}{0}{short}{0}{0}{ }
+%%% NOTICE that the short is really NOT drawn; we trust the fact that its
+%%% natural length is zero.
+\pgfcircdeclarebipole
+{}
+{0}
+{short}
+{0}
+{0}
+{ }
%% Open circuit
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/open/height}}{open}{\ctikzvalof{bipoles/open/height}}{\ctikzvalof{bipoles/open/width}}{
-
-}
+\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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/generic/height}}
+{generic}
+{\ctikzvalof{bipoles/generic/height}}
+{\ctikzvalof{bipoles/generic/width}}
+{
+ \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}
+ \pgf@circ@draworfill
}
%% fuse
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fuse/height}}{fuse}{\ctikzvalof{bipoles/fuse/height}}{\ctikzvalof{bipoles/fuse/width}}{
+\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}
-}
+ \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}
+
+ \pgf@circ@draworfill
+}
-%% Generic bipole, filled - used as inductor by some (bleah)
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/fullgeneric/height}}{fullgeneric}{\ctikzvalof{bipoles/fullgeneric/height}}{\ctikzvalof{bipoles/fullgeneric/width}}{
+%% Generic bipole, filled - used as inductor by some
- %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
- %\divide \pgf@circ@res@step by 14
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{fullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+ \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}
- \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}
+ \pgfusepath{draw,fill}
}
+%% Generic sensor, filled - used as inductive sensor by some
+
+\pgfcircdeclarebipole
+{{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf@x=0.4\pgf@x
+ \pgf@y=2\pgf@y
+ }%
+}}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{sfullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+
+ \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}
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
-%% 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
+%% Generic asymmetric bipole
- \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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/ageneric/height}}
+{ageneric}
+{\ctikzvalof{bipoles/ageneric/height}}
+{\ctikzvalof{bipoles/ageneric/width}}
+{
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
- \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfusepath{stroke,fill}
+ \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}}{
+\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}
- \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}
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{stroke,fill}
}
@@ -1447,28 +2425,36 @@
%% 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}
+\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{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfusepath{stroke,fill}
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \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}
}
@@ -1476,148 +2462,210 @@
%% 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
+\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}
+ \pgf@circ@draworfill
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \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
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/photoresistor/height 2}}
+{photoresistor}
+{\ctikzvalof{bipoles/photoresistor/height}}
+{\ctikzvalof{bipoles/photoresistor/width}}
+{
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \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
+\pgfcircdeclarebipole
+{{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf@x=0.4\pgf@x
+ \pgf@y=1.2\pgf@y
+ }%
+}}
+{\ctikzvalof{bipoles/thermistor/height}}
+{thermistor}
+{\ctikzvalof{bipoles/thermistor/height}}
+{\ctikzvalof{bipoles/thermistor/width}}
+{
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/thermistorptc/height 2}}
+{thermistorptc}
+{\ctikzvalof{bipoles/thermistorptc/height}}
+{\ctikzvalof{bipoles/thermistorptc/width}}
+{
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \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{latexslim}
+ \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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/thermistorntc/height 2}}
+{thermistorntc}
+{\ctikzvalof{bipoles/thermistorntc/height}}
+{\ctikzvalof{bipoles/thermistorntc/width}}
+{
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \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{latexslim}
+ \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}
+\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}}}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/varistor/height}}
+{varistor}
+{\ctikzvalof{bipoles/varistor/height}}
+{\ctikzvalof{bipoles/varistor/width}}
+{
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \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
+\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}
- \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
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \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
}
@@ -1628,54 +2676,67 @@
%% 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}
-}
+\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}}
-%% Piezoelectric Element
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
-\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
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \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}
+}
- %% 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}
+%% Piezoelectric Element
- %% 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}
+\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
+ \pgfscope
+ \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}}
+ \pgf@circ@draworfill
+ \endpgfscope
}
@@ -1721,41 +2782,41 @@
\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
+ \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
+ \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
+ \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
+ \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
+ \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
+ \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
+ \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
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztotarget) node[rectjoinfill] {}
+ \else
\fi
\fi
\fi
@@ -1766,1294 +2827,1456 @@
%% Lamp
-\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/lamp/height}}
+{lamp}
+{\ctikzvalof{bipoles/lamp/height}}
+{\ctikzvalof{bipoles/lamp/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \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}
+%% bulb
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/bulb/height}}
+{bulb}
+{\ctikzvalof{bipoles/bulb/height}}
+{\ctikzvalof{bipoles/bulb/width}}
+{%
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
}
+% transmission line
+
+\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
+ \begin{pgftransparencygroup}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}}
+ \pgf@circ@draworfill
+ \pgfpathellipse{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
+ {\pgfpoint{\pgf@circ@res@step}{0pt}}{\pgfpoint{0pt}{-\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \end{pgftransparencygroup}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{stroke}
+}
-
+% microstrip transmission line
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/mstline/height}}
+{mstline}
+{\ctikzvalof{bipoles/mstline/height}}
+{\ctikzvalof{bipoles/mstline/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
%% 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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/squid/height}}
+{squid}
+{\ctikzvalof{bipoles/squid/height}}
+{\ctikzvalof{bipoles/squid/width}}
+{
- \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}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
- \pgfusepath{draw}
+ \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}}{
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/barrier/height}}
+{barrier}
+{\ctikzvalof{bipoles/barrier/height}}
+{\ctikzvalof{bipoles/barrier/width}}
+{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}}
+ \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}
+ \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}
-
- }
- }
+{
+ \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{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 }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf@y=0pt
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\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
+ \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
+ \pgf@circ@draworfill
+ \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}
+{
+ \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{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 }
+ \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
+ }
+
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\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
+
+ \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
+ \pgf@circ@draworfill
+ \endpgfscope
+ \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}}
-
- \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}}
-
-}
+ \pgfusepath{draw}
-%% 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
+%% Draw the two-port fillable box
+\def\pgf@circ@twoportbox{
+ \pgfscope
+ \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}}
+ \pgf@circ@draworfill
+ \endpgfscope
+}
- \ifpgf@circuit@dashed
- \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
- \fi
+%% 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
+ \pgf@circ@twoportbox
+ \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}}
- % 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
+%% 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
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \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}
- % 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}
+%% 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
+ \pgf@circ@twoportbox
+
+ \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}
+}
- \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}
+%% 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
+ \pgf@circ@twoportbox
+
+ \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}
+\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
+ \pgf@circ@twoportbox
+
+ \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}
+\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
+ \pgf@circ@twoportbox
+
+ \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}}
+\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
+ \pgf@circ@twoportbox
+
+ \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}}
+\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
+ \pgf@circ@twoportbox
+
+ \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}}
+\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
+ \pgf@circ@twoportbox
+
+ \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}}
+\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
+ \pgf@circ@twoportbox
+
+ \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}}
+\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}}
+ \pgf@circ@draworfill
+ \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
+ \pgf@circ@draworfill
+
+ % 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}
+\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
+ \pgf@circ@draworfill
+
+ % 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}
+\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
+ \pgf@circ@twoportbox
+
+ \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}
+\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
+ \pgf@circ@twoportbox
+
+ \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}
+\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
+ \pgf@circ@twoportbox
+
+ \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}
+\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
+ \pgf@circ@twoportbox
+
+ \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$}
+\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
+ \pgf@circ@twoportbox
+
+ \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}
+\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
+ \pgf@circ@twoportbox
+
+ \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
-
+\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
+ \pgf@circ@twoportbox
+
+ \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
+
}
@@ -3061,24 +4284,30 @@
%% 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}}{
+\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}
- %\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen
- %\divide \pgf@circ@res@step by 14
+ \pgf@circ@draworfill
- \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
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \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
}
@@ -3086,57 +4315,42 @@
%% 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}
+\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}}{
- \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \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}
+
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \endpgfscope
- \pgfscope
- \pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up}
- \pgfusepath{draw}
- \endpgfscope
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
+ \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@other}{\pgf@circ@res@zero}}
- \pgfpathlineto{\pgfpoint{\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{}
- \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}
+ \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
@@ -3149,13 +4363,13 @@
\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
+ \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}}
@@ -3177,44 +4391,581 @@
}
%% 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}
+\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}}
+ \pgf@circ@draworfill
+
+ \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}
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/damper/height}}
+{damper}
+{\ctikzvalof{bipoles/damper/height}}
+{\ctikzvalof{bipoles/damper/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@maybefill
+
+ % line into the damper
+ \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}
+
+ % damper box
+ \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}
+
+ % damper vertical element
+ \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}
- \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}}
+}
+%% mechanical viscoelastic element, suggested by @alex
+%% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz
+\pgfcircdeclarebipole
+{} % extra anchors
+{\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
+{viscoe} % name
+{\ctikzvalof{bipoles/damper/height}} % height (above the path line)
+{\ctikzvalof{bipoles/damper/width}} % width
+{ % draw the bipole
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@maybefill
+
+ % spring into the damper
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
+ \pgfusepath{stroke}
+ \endpgfscope
+ % damper box
+ \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}
+
+ % damper vertical element
+ \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}
- \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}
-
}
+\pgfcircdeclarebipole
+{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf@x=0.4\pgf@x
+ }%
+}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{resistivesens}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{\ctikzvalof{bipoles/resistivesens/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
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% crossing bipole (but see also nodes)
+\pgfcircdeclarebipole
+ {}
+ {\ctikzvalof{bipoles/crossing/size}}
+ {crossing}
+ {\ctikzvalof{bipoles/crossing/size}}
+ {\ctikzvalof{bipoles/crossing/size}}{
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+
+%% loudspeaker and microphone
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/loudspeaker/depth}}
+{loudspeaker}
+{\ctikzvalof{bipoles/loudspeaker/height}}
+{\ctikzvalof{bipoles/loudspeaker/width}}{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}}
+ \pgfpathclose
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgf@circ@draworfill
+}
+
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/mic/depth}}
+{mic}
+{\ctikzvalof{bipoles/mic/height}}
+{\ctikzvalof{bipoles/mic/width}}{
+
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}}
+ % 0.25358 is 0.6-0.4*cos(30)
+ \pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, no arrow
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeter}
+{\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}}
+ \pgf@circ@draworfill
+ % draw the text label
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgftransformrotate{\rot}
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, with arrow
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeterwa}
+{\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}}
+ \pgf@circ@draworfill
+ % draw the text label
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ % arrow: create a center hole to have better visual
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next open a circle into it
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfsetarrowsend{latexslim}
+ % the arrow is better if it has a bit of breath and it's not 45º
+ \pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic square meter with always horizontal text
+\pgfcircdeclarebipole
+{
+ \anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
+ \anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/smeter/height}}
+{smeter}
+{\ctikzvalof{bipoles/smeter/height}}
+{\ctikzvalof{bipoles/smeter/width}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % the metering window
+ \pgfscope
+ \def\@starta{105}\def\@stopa{75}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}}
+ \pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{80}{2\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% probles qucs style:
+% #1 : name
+% #2 : extra code
+\long\def\pgfcirc@qucsprobe#1#2{
+ \pgfcircdeclarebipole
+ {
+ \anchor{v+}{\southwest\pgf@x=0.6\pgf@x}
+ \anchor{v-}{\southwest\pgf@x=-0.6\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ }
+ {\ctikzvalof{bipoles/qmeter/depth}}
+ {#1}
+ {\ctikzvalof{bipoles/qmeter/height}}
+ {\ctikzvalof{bipoles/qmeter/width}}
+ {
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\southwest}
+ \pgfextracty{\pgf@circ@res@down}{\southwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfscope
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \def\@starta{103}\def\@stopa{77}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}}
+ \pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \pgf@circ@draworfill
+ \endpgfscope
+ #2
+ \endpgfscope
+ }
+}
+
+\pgfcirc@qucsprobe{qiprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+}
+
+\pgfcirc@qucsprobe{qvprobe}{
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "-", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+\pgfcirc@qucsprobe{qpprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "-", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+% current loop for oscope and similar: stylized
+
+\pgfcircdeclarebipole
+{
+ \anchor{i}{\northeast\pgf@x=0pt\relax}
+ \anchor{text}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@down=-\pgf@circ@res@up
+ \pgf@circ@res@left=-\pgf@circ@res@right
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ % external ellipse
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
+ {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathellipse{\pgfpointorigin}{
+ \pgfpoint{0pt}{0.8\pgf@circ@res@up}}{
+ \pgfpoint{0.4\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % and the contact line up
+ \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+% current loop for oscope and similar: real (double connection)
+
+\pgfcircdeclarebipole
+{
+ \anchor{i+}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgf@y=\pgf@circ@res@up
+ }
+ \anchor{i-}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgf@y=\pgf@circ@res@up
+ }
+ \anchor{text}{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@left}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop2}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgf@circ@res@down=-\pgf@circ@res@up
+ \pgf@circ@res@left=-\pgf@circ@res@right
+ % must be the same than internal i+ and i- anchors definition
+ \pgf@circ@res@step=0.4\pgf@circ@res@right
+ \pgf@circ@res@other=0.8\pgf@circ@res@up
+ \def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}}
+ \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ % external ellipse
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}}
+ {\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}}
+ {\pgfpoint{0pt}{.1\pgf@circ@res@up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathmoveto{\@plus}
+ \pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % and the contact line up
+ % I use ...left and ---right as temporal lengths here to avoid defining more
+ \pgfextractx{\pgf@circ@res@left}{\@plus}
+ \pgfextractx{\pgf@circ@res@right}{\@minus}
+ \pgfpathmoveto{\@plus}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\@minus}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% end of pgfcircbipoles.tex
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex
index 34497df885c..88cd79aa5b8 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirccurrent.tex
@@ -5,195 +5,194 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
+ \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 } }
+ \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 } }
+ \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
+%% 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}}
+ \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}}
}
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex
index 217e482757a..7995725d6d6 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircflow.tex
@@ -5,74 +5,74 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ 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} }
@@ -81,113 +81,113 @@
\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
+ \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
+%% 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}}
+ \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}}
}
\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
index 29943d5d569..1d386b5480b 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirclabel.tex
@@ -5,224 +5,330 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt 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{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{label above/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=90 }
}
-\ctikzset{l^/.style = {
- 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{label below/.code = {
+ l=#1,
+ \circuitikzbasekey/bipole/label/position=-90 }
}
-\ctikzset{l_/.style = {
- 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
- }}
+ \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{annotation above/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=90 }
}
-\ctikzset{a^/.style = {
- 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{annotation below/.code = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
}
-\ctikzset{a_/.style = {
- a=#1,
- \circuitikzbasekey/bipole/annotation/position=-90 }
+\ctikzset{a_/.style = {
+ a=#1,
+ \circuitikzbasekey/bipole/annotation/position=-90 }
}
-
+% This is to adjust spacing for the labels so that they are not cramped on components
+\def\pgf@circ@ls{.75ex} % labelspace to have just one point to change
\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
+ \pgfextra{
+ % This function will be called with argument #1 equal
+ % to "label" or "annotation" form pgfcircpath.tex.
+ % pgf@circ@direction is the direction of the path,
+ % its value is set in pgfcircpath.tex
+ \pgfmathsubtract{\pgf@circ@direction}{90}
+ \pgfmathround{\pgfmathresult} % avoid precision loss errors
+ \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 coordinate 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
-}
+ \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}}
+ \pgfextra{
+ % scale the distances in function of zoom, so that they are not
+ % dependent on it but on font size. Thanks to @marmot
+ % https://tex.stackexchange.com/a/476018/38080
+ % the coeffcient is adjusted so that the distance is more or less
+ % the same for rotated labels and straight ones (although it will
+ % depend on the font, so it's not exact).
+ \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
+ \pgfmathsetlength\pgf@circ@res@temp{1.5*\pgf@circ@ls/\myscale}
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ %we need some more space for placement below, due to mid-anchor
+ \else % we do not have <= in \ifnum...
+ \pgf@circ@res@temp=1.5\pgf@circ@res@temp
+ \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 rotated strings
+ \ifnum \ctikzvalof{bipole/#1/position}>0
+ \pgf@circ@res@temp=1.5\pgf@circ@res@temp
+ \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}
+ }
+ % reset cm is not working correctly here
+ (labelcoor)++(\pgf@circ@labposangle:\the\pgf@circ@res@temp) 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}}
+ %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{
+ % scale ex-distance to make it independent on scale
+ % thanks @marmot see https://tex.stackexchange.com/a/476018/38080
+ \pgfgettransformentries{\tmp}{\tmp}{\tmp}{\myscale}{\tmp}{\tmp}
+ \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@ls/\myscale}
+ \pgfmathadd{\pgf@circ@labanc}{90}
+ \pgfmathround{\pgfmathresult}
+ \def\pgf@circ@labanctext{\pgf@circ@labanc}
+ \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 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@labanctext{mid west}}
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{mid east}}
+ \fi
+ \else
+ \ifnum \ctikzvalof{bipole/#1/position} > 0
+ \pgfextra{\def\pgf@circ@labanctext{mid east}}
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{mid west}}
+ \fi
+ \fi
+ \fi\fi
+ %Values between -5 and 5 are at pos /neg x-axis
+ \pgfextra{\def\uffa{}\newdimen\realshift\realshift=\dimexpr1pt\relax}
+ \ifnum \pgfcircmathresult <6 \ifnum \pgfcircmathresult > -6
+ \ifnum \ctikzvalof{bipole/#1/position} < 0
+ \ifnum \pgf@circ@labanc > 90
+ % using base coordinate instead of south to naturally align
+ % symbols with descendants; but this invalidate the effect of
+ % the inner sep, so recover it by shifting the anchor
+ % reset cm is not working sometime, use @marmot solution
+ % see https://tex.stackexchange.com/a/476018/38080
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{north}}%north
+ \fi
+ \else
+ \ifnum \pgf@circ@labanc < 90
+ % shift, as above
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \ifnum \pgf@circ@labanc > 180
+ % this shouldn't happen, but somehow it does (270 degree anchors)
+ % shift, as above
+ (labelcoor) ++(-\pgf@circ@labanc:\pgf@circ@res@temp) coordinate(labelcoor)
+ \pgfextra{\def\pgf@circ@labanctext{base}}%base
+ \else
+ \pgfextra{\def\pgf@circ@labanctext{north}}%north
+ \fi
+ \fi
+ \fi
+ \fi\fi
+ (labelcoor) node[anchor=\pgf@circ@labanctext,
+ inner sep=0.5\pgf@circ@res@temp, outer sep=0pt,
+ ](\ctikzvalof{bipole/name}#1){\strut\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%
+ \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}
+\ctikzset{t/.code = {
+ \ctikzsetvalof{bipoles/twoport/text}{#1}
+}}
+
+%%%% Stacked labels
+%
+% stacked labels by Romano Giannetti romano@rgtti.com
+% heavily based on Claudo Fiandrinos's https://tex.stackexchange.com/a/65792/38080
+% \expandafter trick inspired by Matthew Leingang's https://tex.stackexchange.com/a/12272/38080
+%
+% labels are in a tabular, globally aligned:
+% vertically with key l2 valign (default c)
+% c: center t: top b: bottom
+% horizontally with key l2 align (default l)
+% l: left c: centered r: right
+% you can switch sides using l2_=... and l2^=...
+% syntax is l2_ = line1 and line2 (same for l2^)
+%
+\ctikzset{%
+ l2 valign/.store in=\ltwo@valign, l2 valign=c,
+ l2 halign/.store in=\ltwo@halign, l2 halign=l,
+}
+\ctikzset{l2base/.code n args={2}{
+ \pgfkeys{/tikz/circuitikz/bipole/label/name=%
+ \bgroup
+ \setlength{\tabcolsep}{2pt}%
+ \def\ltwo@tabu{\tabular[\ltwo@valign]}%
+ \expandafter\ltwo@tabu\expandafter{\ltwo@halign}%
+ #1\\ #2%
+ \endtabular
+ \egroup
+ }%
+ \ctikzsetvalof{bipole/label/unit}{}
+ \ifpgf@circ@siunitx
+ \pgf@circ@handleSI{#2}
+ \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
}}
-\endinput \ No newline at end of file
+\ctikzset{l2/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 above/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2^/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=90 }
+}
+\ctikzset{l2 below/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+\ctikzset{l2_/.style args={#1 and #2}{
+ l2base={#1}{#2},
+ \circuitikzbasekey/bipole/label/position=-90 }
+}
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
index e8feabfc80c..66f2d8dd511 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
@@ -5,336 +5,692 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Monopoles
%% Ground symbol
+% #1 -> name
+% #2 -> width
+% #3 -> depth
+% #4 -> code
+\long\def\pgf@circ@declareground#1#2#3#4{
+ \pgfdeclareshape{#1}{
+ \savedanchor{\southeast}{
+ \pgf@x=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+ \pgf@x=#2\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+ \pgf@y=-#3\pgf@y
+ }
+ \anchor{north}{\pgfpointorigin}
+ \anchor{north east}{\southeast\pgf@y=0pt\relax}
+ \anchor{east}{\southeast\pgf@y=.5\pgf@y}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\southeast\pgf@y=.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{north west}{\southeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ #4
+ \endpgfscope
+ }
+ }
+}
-\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
- }
+\pgf@circ@declareground{ground}{0.6}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
}
-\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
- }
+\pgf@circ@declareground{rground}{0.6}{1}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\ctikzvalof{monopoles/rground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfsetroundcap\pgfusepath{draw}
}
-\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
- }
+\pgf@circ@declareground{tground}{0.6}{0}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
}
-\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
- }
+\pgf@circ@declareground{sground}{0.6}{1.8}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0}{-1.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgf@circ@draworfill
}
% 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
- }
+\pgf@circ@declareground{nground}{0.9}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
+ \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
+ \pgfusepath{draw}
}
% 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
- }
+\pgf@circ@declareground{pground}{0.9}{1.8}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfpathcircle{\pgfpoint{0pt}{-0.9\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
+ \pgfusepath{draw}
}
-% chassis ground
-\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}
+% chassis ground
+\pgf@circ@declareground{cground}{1}{2}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% Contributed by @fotesan https://github.com/fotesan
+
+\pgf@circ@declareground{eground}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.1\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\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
- }
+\pgf@circ@declareground{eground2}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/monopoles/tground/thickness}\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-1.1\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{-.45\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-1.7\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfusepath{draw}
}
% 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
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+ \pgf@x=1.625\pgf@circ@res@step
+ \pgf@circ@res@step = \ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+ \pgf@y=.25\pgf@circ@res@step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0.5\pgf@x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=0cm\relax}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@Rlen
+
+ \pgfscope\begin{pgftransparencygroup}
\pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
- \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgf@circ@maybefill
+ \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}
+ \pgf@circ@draworfill
+ \pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \end{pgftransparencygroup} \endpgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@step}{0pt}}
+ \pgfusepath{draw}
+ }
+}
+
+%% New antennas without tails
+
+% main body
+\def\pgf@circ@antennabody{%
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfsetbeveljoin
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{2\pgf@circ@res@step}}
+ \pgfusepath{draw}
+}
+
+% Waves for the antennas.
+\def\pgf@circ@antennawaves{%
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{3\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf@circ@res@step}{-1\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>2
+ \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\c@pgf@counta*\pgf@circ@res@other}
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+% additional shape with the waves
+\pgfdeclareshape{waves}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0pt}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
+ \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{north east}{\northeast}
+ \anchor{east}{\northeast\pgf@y=0pt}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@Rlen
+ \pgf@circ@res@step=0.5\pgf@circ@res@step
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{2\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-2\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>1
+ \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other}
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop
\pgfusepath{draw}
- \endpgfscope
- }
+ \endpgfscope
+ }
+}
+
+% the three types of antennas: simple, TX, RX. Notice that you can flip them...
+
+\pgfdeclareshape{bareantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ }
}
-
+\pgfdeclareshape{bareTXantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@x=\dimexpr-\pgf@x-\wd\pgfnodeparttextbox\relax
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgf@x=4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ \pgf@circ@antennawaves
+ }
+}
+\pgfdeclareshape{bareRXantenna}{
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=2\pgf@circ@res@step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf@y
+ \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{
+ \northeast
+ \pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@Rlen
+ \pgf@x=-4.2\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@step
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgf@circ@antennabody
+ \pgftransformxshift{-5.2\pgf@circ@res@step}
+ \pgf@circ@antennawaves
+ }
+}
+
+% Microstrip monopoles
+
+\pgfdeclareshape{mslstub}{
+ \savedanchor{\southeast}{
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=-.5\pgf@y
+ }
+ \savedanchor{\northwest}{
+ \pgf@x=\ctikzvalof{bipoles/mstline/width}\pgf@circ@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf@y=0pt\relax}
+ \anchor{left}{\northwest\pgf@y=0pt\relax}
+ \anchor{right}{\southeast\pgf@y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msrstub}{
+ \savedanchor{\southeast}{
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=0pt\relax
+ }
+ \savedanchor{\northwest}{
+ \pgf@x=\ctikzvalof{monopoles/msrstub/width}\pgf@circ@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/msrstub/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointpolar{135}{\pgf@circ@res@step}}
+ \pgfpatharc{135}{45}{\pgf@circ@res@step}
+ \pgfpathlineto{\pgfpointpolar{45}{\pgf@circ@res@up}}
+ \pgfpatharc{45}{135}{\pgf@circ@res@up}
+ \pgfclosepath
+ % \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msport}{
+ \savedanchor{\southeast}{
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=-.5\pgf@y
+ }
+ \savedanchor{\northwest}{
+ \pgf@x=\ctikzvalof{monopoles/msport/width}\pgf@circ@Rlen
+ \pgf@x=-.5\pgf@x
+ \pgf@y=\ctikzvalof{bipoles/mstline/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ }
+ \anchor{north}{\northwest\pgf@x=0pt\relax}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{east}{\southeast\pgf@y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf@x=0pt\relax}
+ \anchor{south west}{\southeast\pgf@x=-\pgf@x}
+ \anchor{west}{\northwest\pgf@y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf@y=0pt\relax}
+ \anchor{left}{\northwest\pgf@y=0pt\relax}
+ \anchor{right}{\southeast\pgf@y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@right}{\southeast}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@down}{\southeast}
+ \pgfmathsetlength{\pgf@circ@res@step}{0.5*\pgf@circ@res@up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
+}
+% Legacy antennas (with tails)
+
+\def\pgf@circ@shift@antenna@xy#1#2{%
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@y=\dimexpr\pgf@y+#2\pgf@circ@res@step
+ \pgf@x=\dimexpr\pgf@x+#1\pgf@circ@res@step
+\relax}
\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}}
-
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{0}{3}\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{0}{4}\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{3}}
+ \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{2}}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{0}{4}}
+ \anchor{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
+
\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}
-
- }
- }
+
+ \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}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{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}}
@@ -345,161 +701,208 @@
\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
- }
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@Rlen
+ \pgf@x=\pgf@circ@res@step%-0.5\pgflinewidth
+ \pgf@y=4\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf@y=0cm\pgf@circ@shift@antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\pgf@circ@shift@antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf@circ@shift@antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@circ@shift@antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x\pgf@circ@shift@antenna@xy{1}{4}}
+ \anchor{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}
-
- }
+
+ \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
-}
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=3\pgf@x%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf@circ@res@step+2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=2\pgf@circ@res@step
+ \advance \pgf@y by 0.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfscope
+ \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
-}
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=-3\pgf@x%
+ }
+ \anchor{south}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y\relax}
+ \anchor{north}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf@y=0.5\pgf@y\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast}
+ \anchor{south west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast\pgf@y=0pt\relax}
+ \anchor{north west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{text}{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{-.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{-2\pgf@circ@res@step-2\ht\pgfnodeparttextbox}}
+ \pgf@x=0pt
+ \pgf@y=-2\pgf@circ@res@step
+ \advance \pgf@y by -1.5\ht\pgfnodeparttextbox
+ \pgf@x=-.5\wd\pgfnodeparttextbox
+ }
+
+ \behindforegroundpath{
+ \pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@Rlen
+
+ \pgfscope
+ \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
- }
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
+ \pgf@x=2\pgf@circ@res@step
+ \pgf@circ@res@step = \ctikzvalof{monopoles/match/width} \pgf@circ@Rlen
+ \pgf@y=.5\pgf@circ@res@step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf@x=0.5\pgf@x\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=0pt\pgf@x=0.5\pgf@x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=0cm\relax}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\pgfpointorigin}
+ \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
+ }
+}
\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
new file mode 100644
index 00000000000..48c9c91a9d7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex
@@ -0,0 +1,559 @@
+% Copyright 2007-2009 by Massimo Redaelli
+% Copyright 2019 by Romano Giannetti
+%
+% 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 files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Multipoles
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% counters for pin accounting...
+\newcount\pgf@circ@count@c
+\newcount\pgf@circ@count@b
+\def\pgf@circ@dip@pin@shift{0.5}
+\def\pgf@circ@qfp@pin@shift{0.25}
+
+% derived from https://tex.stackexchange.com/a/146753/38080
+% original author Mark Wibrow
+% Thanks also to John Kormylo https://tex.stackexchange.com/a/372996/38080
+% a lot of thanks to @marmot for the un-rotation hint
+% https://tex.stackexchange.com/a/473571/38080
+
+% DIP (dual in line package) chips
+
+\pgfdeclareshape{dipchip}{
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength\pgf@x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins})
+ *\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}}}
+ \saveddimen{\width}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/width}}}
+ \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})
+ *\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}}
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \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{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/pin spacing}\pgf@circ@Rlen
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf@circ@Rlen
+ \pgfscope% (for the line width)
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
+ \pgf@circ@draworfill
+ %% upside mark
+ \ifpgf@circuit@chip@topmark
+ \pgfpathmoveto{\pgfpoint{0.2*\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
+ \fi
+ \pgfusepath{stroke}%
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ % Adding the pin number
+ \ifpgf@circuit@chip@shownumbers
+ \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}%
+ \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
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop
+ \fi
+ \endpgfscope
+ \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}%
+ \divide\c@pgf@counta by 2 \pgf@circ@count@b=\c@pgf@counta
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0
+ \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
+ \ifnum\padfrac>0
+ \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
+ % left side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ % right side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \else
+ % left side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ % right side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \fi
+ \advance\c@pgf@counta by -1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{stroke}
+ \endpgfscope
+ \fi
+ }%
+ % \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@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
+ \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}%
+ }
+ % 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%
+ }%
+ }
+
+% QFP (quad flat package) chips
+
+\pgfdeclareshape{qfpchip}{
+ \savedanchor\centerpoint{%
+ \pgf@x=-.5\wd\pgfnodeparttextbox%
+ \pgf@y=-.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y by+.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\origin{\pgfpoint{0pt}{0pt}}
+ \anchor{center}{\origin}
+ \anchor{text}{\centerpoint}% to adjust text
+ \saveddimen\height{%
+ \pgfmathsetlength\pgf@x{((\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}+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)
+ *\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)
+ *\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing})*\pgf@circ@Rlen/4}%
+ \pgf@x=-\pgf@y
+ }
+ \anchor{dot}{\northwest
+ \pgfmathsetlength\pgf@x{\pgf@x + 0.3*\chipspacing}
+ \pgfmathsetlength\pgf@y{\pgf@y - 0.3*\chipspacing}
+ }
+ \anchor{nw}{\northwest}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \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{n}{\northwest\pgf@x=0pt }
+ \anchor{e}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{w}{\northwest\pgf@y=0pt }
+ \anchor{north}{\northwest\pgf@x=0pt }
+ \anchor{east}{\northwest\pgf@x=-\pgf@x\pgf@y=0pt }
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{west}{\northwest\pgf@y=0pt }
+ % start drawing
+ \backgroundpath{%
+ \northwest
+ \pgf@circ@res@up = \pgf@y
+ \pgf@circ@res@down = -\pgf@y
+ \pgf@circ@res@right = -\pgf@x
+ \pgf@circ@res@left = \pgf@x
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/pin spacing}\pgf@circ@Rlen
+ \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins width}\pgf@circ@Rlen
+ \pgfscope% (for the line width)
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/thickness}\pgflinewidth}
+ %% upside mark
+ \ifpgf@circuit@chip@topmark
+ \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2-\pgf@circ@res@step/2}}
+ \pgfpathlineto{\pgfpoint{-\width/2+\pgf@circ@res@step/2}{\height/2}}
+ \else
+ \pgfpathmoveto{\pgfpoint{-\width/2}{\height/2}}
+ \fi
+ %% rest of the shape
+ \pgfpathlineto{\pgfpoint{\width/2}{\height/2}}
+ \pgfpathlineto{\pgfpoint{\width/2}{-\height/2}}
+ \pgfpathlineto{\pgfpoint{-\width/2}{-\height/2}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ % Adding the pin number
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \ifpgf@circuit@chip@shownumbers
+ \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}%
+ \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
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{-atan2(\b,\a)}
+ \pgfmathtruncatemacro{\quadrant}{mod(4+int(360+(\rot+45)/90),4)}
+ \else
+ \pgfmathsetmacro{\rot}{0}
+ \pgfmathsetmacro{\quadrant}{0}
+ \fi
+ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0
+ \ifcase\quadrant % rotation 0
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or % rotation -90
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or %rotation 180
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \or % rotation +90
+ % left
+ \pgf@circ@count@c=\c@pgf@counta
+ \pgftext[bottom,
+ at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % bottom
+ \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[right,
+ at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down},
+ rotate=\rot]{\mytext}
+ % right
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax
+ \pgftext[top,
+ at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step},
+ rotate=\rot]{\mytext}
+ % top
+ \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax
+ \pgftext[left,
+ at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up},
+ rotate=\rot]{\mytext}
+ \fi
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop
+ \fi
+ \endpgfscope
+ \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}%
+ \divide\c@pgf@counta by 4 \pgf@circ@count@b=\c@pgf@counta
+ \pgfmathloop%
+ \ifnum\c@pgf@counta>0
+ \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}}
+ \ifnum\padfrac>0
+ \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac
+ % left side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ % bottom side pads
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ % right side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ % top side pads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \else
+ % left side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ % bottom side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}}
+ % right side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}}
+ % top side pins
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}}
+ \fi
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{stroke}
+ \endpgfscope
+ \fi
+ }%
+ % \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@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
+ \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}%
+ }
+ \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}%
+ }
+ \advance\c@pgf@counta-1\relax%
+ \repeatpgfmathloop%
+ }%
+ }
+
+%% 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}%
+}
+
+%% 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@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@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@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}%
+}
+\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@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@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\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}%
+}
+
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
index 44fa367b4ce..cb1c15022bd 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
@@ -3,7 +3,7 @@
% Names
\ctikzset{name/.style = { n=#1 } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@
-\ctikzset{n/.code = {
+\ctikzset{n/.code = {
\pgfkeys{/tikz/circuitikz/bipole/name=#1}
}}
@@ -33,130 +33,124 @@
% 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
- }
+ \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
- }
+ \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
+ \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 relative 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}}
+ \pgfmathround{\pgfmathresult}
+ \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
+ (\ctikzvalof{bipole/name}start.center) -- (anchorstartnode)
+ (anchorendnode) -- (\ctikzvalof{bipole/name}end.center)
+ \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@sresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#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@capacitivesens@path#1{\pgf@circ@bipole@path{capacitivesens}{#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}}
@@ -167,42 +161,63 @@
\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@cutechoke@path#1{\pgf@circ@bipole@path{cutechoke}{#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%
+ \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%
+ \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@inductivesens@path#1{%
+ \pgfextra{
+ \edef\pgf@circ@temp{\ctikzvalof{inductor}}%
+ \def\pgf@temp{european}%
+ }
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@europeaninductivesens@path{#1}%
+ \else%
+ \pgfextra{ \def\pgf@temp{cute} }%
+ \ifx\pgf@temp\pgf@circ@temp%
+ \pgf@circ@cuteinductivesens@path{#1}%
+ \else%
+ \pgf@circ@americaninductivesens@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@europeaninductivesens@path#1{\pgf@circ@bipole@path{sfullgeneric}{#1}}
+\def\pgf@circ@americaninductivesens@path#1{\pgf@circ@bipole@path{samericaninductor}{#1}}
+\def\pgf@circ@cuteinductivesens@path#1{\pgf@circ@bipole@path{scuteinductor}{#1}}
\def\pgf@circ@lamp@path#1{\pgf@circ@bipole@path{lamp}{#1}}
+\def\pgf@circ@bulb@path#1{\pgf@circ@bipole@path{bulb}{#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}}
@@ -228,6 +243,7 @@
\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@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#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}}
@@ -237,6 +253,7 @@
\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@oscope@path#1{\pgf@circ@bipole@path{oscope}{#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}}
@@ -246,6 +263,7 @@
\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@mstline@path#1{\pgf@circ@bipole@path{mstline}{#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}}
@@ -280,9 +298,7 @@
\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}}
-
-
-
+\def\pgf@circ@viscoe@path#1{\pgf@circ@bipole@path{viscoe}{#1}}
%% Styles
@@ -296,6 +312,7 @@
\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{viscoe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@viscoe@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}}
@@ -326,6 +343,7 @@
\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{cute choke/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cutechoke@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}}
@@ -334,6 +352,7 @@
\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{mstline/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mstline@path, l=#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}}
@@ -364,6 +383,7 @@
\compattikzset{open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@open@path}}
\compattikzset{lamp/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@lamp@path}}
+\compattikzset{bulb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@bulb@path, l=#1}}
\compattikzset{squid/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@squid@path}}
\compattikzset{barrier/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@barrier@path}}
@@ -392,7 +412,7 @@
\compattikzset{detector/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@detector@path}}
% % % % % %
-% % Beginn of Diodes
+% % Begin of Diodes
% % % % % %
\def\pgf@circ@fulldiode@path#1{\pgf@circ@bipole@path{fulldiode}{#1}}
@@ -403,6 +423,7 @@
\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@fullbidirectionaldiode@path#1{\pgf@circ@bipole@path{fullbidirectionaldiode}{#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}}
@@ -411,6 +432,7 @@
\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@emptybidirectionaldiode@path#1{\pgf@circ@bipole@path{emptybidirectionaldiode}{#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}}
@@ -420,6 +442,7 @@
\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 bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@fullbidirectionaldiode@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}}
@@ -431,6 +454,7 @@
\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 bidirectionaldiode/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@emptybidirectionaldiode@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}}
@@ -457,6 +481,7 @@
\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!
+\compattikzset{bidirectionaldiode/.style = {\comnpatname \ifpgf@circuit@fulldiode full \else empty \fi bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
%% Define Shortcuts
\compattikzset{Do/.style = {\comnpatname empty diode}}
@@ -467,6 +492,7 @@
\compattikzset{pDo/.style = {\comnpatname empty photodiode}}
\compattikzset{leDo/.style = {\comnpatname empty led}}
\compattikzset{VCo/.style = {\comnpatname empty varcap}}
+\compattikzset{biDo/.style = {\comnpatname empty bidirectionaldiode}}
\compattikzset{Tyo/.style = {\comnpatname empty thyristor}}
\compattikzset{Tro/.style = {\comnpatname empty triac}}
@@ -478,6 +504,7 @@
\compattikzset{pD*/.style = {\comnpatname full photodiode}}
\compattikzset{leD*/.style = {\comnpatname full led}}
\compattikzset{VC*/.style = {\comnpatname full varcap}}
+\compattikzset{biD*/.style = {\comnpatname full bidirectionaldiode}}
\compattikzset{Ty*/.style = {\comnpatname full thyristor}}
\compattikzset{Tr*/.style = {\comnpatname full triac}}
@@ -489,6 +516,7 @@
\compattikzset{pD/.style = {\comnpatname photodiode}}
\compattikzset{leD/.style = {\comnpatname led}}
\compattikzset{VC/.style = {\comnpatname varcap}}
+\compattikzset{biD/.style = {\comnpatname bidirectionaldiode}}
\compattikzset{Ty/.style = {\comnpatname thyristor}}
\compattikzset{Tr/.style = {\comnpatname triac}}
@@ -502,6 +530,7 @@
\compattikzset{VC-/.style = {\comnpatname stroke varcap}}
\compattikzset{Ty-/.style = {\comnpatname stroke thyristor}}
\compattikzset{Tr-/.style = {\comnpatname empty triac}}%no stroke triac!
+\compattikzset{biD-/.style = {\comnpatname empty bidirectionaldiode}}%no stroke bidirectionaldiode! (based on triac)
% % % % % %
% % End of Diodes
@@ -517,11 +546,38 @@
\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{nopb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
+\compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
+\compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@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}}
+\tikzset{oscope/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@oscope@path, l=#1}}
+
+% cute switches
+%% closed cute switch
+\def\pgf@circ@cuteclosedswitch@path#1{\pgf@circ@bipole@path{cuteclosedswitch}{#1}}
+\compattikzset{cute closed switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosedswitch@path, l=#1}}
+\compattikzset{ccsw/.style= {\comnpatname cute closed switch= #1}}
+
+%% open cute switch
+\def\pgf@circ@cuteopenswitch@path#1{\pgf@circ@bipole@path{cuteopenswitch}{#1}}
+\compattikzset{cute open switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopenswitch@path, l=#1}}
+\compattikzset{cosw/.style= {\comnpatname cute open switch= #1}}
+
+%% closing cute switch
+\def\pgf@circ@cuteclosingswitch@path#1{\pgf@circ@bipole@path{cuteclosingswitch}{#1}}
+\compattikzset{cute closing switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteclosingswitch@path, l=#1}}
+\compattikzset{ccgsw/.style= {\comnpatname cute closing switch= #1}}
+
+%% opening cute switch
+\def\pgf@circ@cuteopeningswitch@path#1{\pgf@circ@bipole@path{cuteopeningswitch}{#1}}
+\compattikzset{cute opening switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteopeningswitch@path, l=#1}}
+\compattikzset{cogsw/.style= {\comnpatname cute opening switch= #1}}
+
% 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}}
@@ -549,7 +605,6 @@
\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}}
@@ -569,13 +624,13 @@
\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} }
+\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{^<}
\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
%current sources
@@ -583,17 +638,63 @@
\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} }
+\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{_}
-
+% cute sources
+\def\pgf@circ@vsourceC@path#1{\pgf@circ@bipole@path{vsourceC}{#1}}
+\compattikzset{cute european voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceC/.style= {\comnpatname cute european voltage source= #1}}
+\compattikzset{ceV/.style= {\comnpatname cute european voltage source= #1}}
+
+\def\pgf@circ@isourceC@path#1{\pgf@circ@bipole@path{isourceC}{#1}}
+\compattikzset{cute european current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceC/.style= {\comnpatname cute european current source= #1}}
+\compattikzset{ceI/.style= {\comnpatname cute european current source= #1}}
+
+\def\pgf@circ@cvsourceC@path#1{\pgf@circ@bipole@path{cvsourceC}{#1}}
+\compattikzset{cute european controlled voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cvsourceC@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{cvsourceC/.style= {\comnpatname cute european controlled voltage source= #1}}
+\compattikzset{cceV/.style= {\comnpatname cute european controlled voltage source= #1}}
+
+\def\pgf@circ@cisourceC@path#1{\pgf@circ@bipole@path{cisourceC}{#1}}
+\compattikzset{cute european controlled current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cisourceC@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{cisourceC/.style= {\comnpatname cute european controlled current source= #1}}
+\compattikzset{cceI/.style= {\comnpatname cute european controlled current source= #1}}
+
+% noise sources
+\def\pgf@circ@vsourceN@path#1{\pgf@circ@bipole@path{vsourceN}{#1}}
+\compattikzset{noise voltage source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@vsourceN@path, \circuitikzbasekey/bipole/is voltage=true, \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true, v=#1}}
+\compattikzset{vsourceN/.style= {\comnpatname noise voltage source= #1}}
+\compattikzset{nV/.style= {\comnpatname noise voltage source= #1}}
+
+\def\pgf@circ@isourceN@path#1{\pgf@circ@bipole@path{isourceN}{#1}}
+\compattikzset{noise current source/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@isourceN@path, \circuitikzbasekey/bipole/is current=true, i=#1}}
+\compattikzset{isourceN/.style= {\comnpatname noise current source= #1}}
+\compattikzset{nI/.style= {\comnpatname noise current source= #1}}
+
+% resistive sensor american style
+\def\pgf@circ@resistivesens@path#1{\pgf@circ@bipole@path{resistivesens}{#1}}
+\compattikzset{american resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@resistivesens@path, l=#1}}
+\compattikzset{european resistive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@thermistorntc@path, l=#1}}
+\compattikzset{resistive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@sresistor@path, l=#1}}
+\compattikzset{sR/.style= {\comnpatname resistive sensor= #1}}
+
+\compattikzset{capacitive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@capacitivesens@path, l=#1}}
+\compattikzset{sC/.style= {\comnpatname capacitive sensor= #1}}
+
+\compattikzset{cute inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@cuteinductivesens@path, l=#1}}
+\compattikzset{european inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@europeaninductivesens@path, l=#1}}
+\compattikzset{american inductive sensor/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@americaninductivesens@path, l=#1}}
+\compattikzset{inductive sensor/.style= {\circuitikzbasekey, /tikz/to path=\pgf@circ@inductivesens@path, l=#1}}
+\compattikzset{sL/.style= {\comnpatname inductive sensor= #1}}
\compattikzset{Mr/.style = {\comnpatname memristor}}
@@ -606,75 +707,79 @@
\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}
- }
-}
+% activate the to-style crossing
+\def\pgf@circ@crossing@path#1{\pgf@circ@bipole@path{crossing}{#1}}
+\compattikzset{crossing/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@crossing@path, l=#1}}
+\compattikzset{xing/.style= {\comnpatname crossing= #1}}
+
+%% loudspeaker and microphone
+
+\def\pgf@circ@loudspeaker@path#1{\pgf@circ@bipole@path{loudspeaker}{#1}}
+\compattikzset{loudspeaker/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@loudspeaker@path, l=#1}}
+
+\def\pgf@circ@mic@path#1{\pgf@circ@bipole@path{mic}{#1}}
+\compattikzset{mic/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@mic@path, l=#1}}
+
+% more instrument
+\def\pgf@circ@rmeter@path#1{\pgf@circ@bipole@path{rmeter}{#1}}
+\compattikzset{rmeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeter@path, l=#1}}
+\def\pgf@circ@rmeterwa@path#1{\pgf@circ@bipole@path{rmeterwa}{#1}}
+\compattikzset{rmeterwa/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@rmeterwa@path, l=#1}}
+\def\pgf@circ@smeter@path#1{\pgf@circ@bipole@path{smeter}{#1}}
+\compattikzset{smeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@smeter@path, l=#1}}
+% current loop probes
+\def\pgf@circ@iloop@path#1{\pgf@circ@bipole@path{iloop}{#1}}
+\compattikzset{iloop/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop@path, l=#1}}
+\def\pgf@circ@iloop2@path#1{\pgf@circ@bipole@path{iloop2}{#1}}
+\compattikzset{iloop2/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@iloop2@path, l=#1}}
+% qucs-style probes
+\def\pgf@circ@qiprobe@path#1{\pgf@circ@bipole@path{qiprobe}{#1}}
+\compattikzset{qiprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qiprobe@path, l=#1}}
+\def\pgf@circ@qvprobe@path#1{\pgf@circ@bipole@path{qvprobe}{#1}}
+\compattikzset{qvprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qvprobe@path, l=#1}}
+\def\pgf@circ@qpprobe@path#1{\pgf@circ@bipole@path{qpprobe}{#1}}
+\compattikzset{qpprobe/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@qpprobe@path, l=#1}}
-\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
+ \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}
+ \pgfmathround{\pgfmathresult}
+ \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
}
@@ -685,6 +790,7 @@
\pgf@circ@definetranspath{elmech}
\pgf@circ@definetranspath{nmos}
\pgf@circ@definetranspath{pmos}
+\pgf@circ@definetranspath{hemt}
\pgf@circ@definetranspath{npn}
\pgf@circ@definetranspath{pnp}
\pgf@circ@definetranspath{nfet}
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
index e1951a6319c..b1082ac4a12 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex
@@ -5,535 +5,829 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt 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
-
- }
- }
+ \pgfdeclareshape{#1}
+ {
+ \anchor{center}{
+ \northwest
+ \pgf@x=0pt
+ \pgf@y=0pt
+ }
+ \savedmacro{\stretto}{\def\stretto{0.4}}
+ \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
+ }
+ %% notice for the dot anchors: I use the cute inductors as reference
+ %% size; if you change one you have to change all of them.
+ \anchor{inner dot A1}{
+ \northwest
+ \pgfmathsetlength\pgf@x{\stretto*\pgf@x +
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
+ }
+ \anchor{outer dot A1}{
+ \northwest
+ \pgfmathsetlength\pgf@x{\stretto*\pgf@x -
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
+ }
+ \anchor{inner dot A2}{
+ \northwest
+ \pgfmathsetlength\pgf@x{\stretto*\pgf@x +
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
+ }
+ \anchor{outer dot A2}{
+ \northwest
+ \pgfmathsetlength\pgf@x{\stretto*\pgf@x -
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
+ }
+ \anchor{inner dot B1}{
+ \northwest
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@x -
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
+ }
+ \anchor{outer dot B1}{
+ \northwest
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@x +
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{0.5*\pgf@circ@Rlen}
+ }
+ \anchor{inner dot B2}{
+ \northwest
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@x -
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
+ }
+ \anchor{outer dot B2}{
+ \northwest
+ \pgfmathsetlength\pgf@x{-\stretto*\pgf@x +
+ \ctikzvalof{bipoles/cuteinductor/height}*\pgf@circ@Rlen/2}
+ \pgfmathsetlength\pgf@y{-0.5*\pgf@circ@Rlen}
+ }
+ \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
- }
+ \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}
-
+ \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
- }
- }
+% 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
+ }
+ \savedanchor\outline{%
+ \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
+ \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \savedanchor\inOneFixed{%
+ \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{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \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
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \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 up}{
+ \northwest
+ \pgf@y=.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out down}{
+ \northwest
+ \pgf@y=-.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out +}{
+ \outline
+ \pgf@y=.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{out -}{
+ \outline
+ \pgf@y=-.5\pgf@y
+ \pgf@x=-.7\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \pgf@x=-.7\pgf@x
+ }
+
+ \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
+ \anchor{north east}{ \northwest \pgf@x=-.7\pgf@x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=-.7\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
+
+ % Triangle
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/quadpoles/thickness}\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
+ \pgf@circ@draworfill
+ \endpgfscope
+ % 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} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
+
+ % 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} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
+
+ % 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} \ifpgf@circuit@oa@oplusup$-$\else$+$\fi}
+
+ % 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} \ifpgf@circuit@oa@oplusup$+$\else$-$\fi}
+
+ \pgfsetrectcap
+ % Draw them all!
+ \pgfusepath{draw}
+ }
+}
-\pgfcircdeclarequadpole{transformer}{
+%% instrumentation amplifier diff output
+
+\pgfdeclareshape{fd inst amp}
+{
+ % when tikz calls the anchor it wants the relative position in the lengths
+ % \pgf@x \pgf@y
+ % \pgfpoint* functions set that variables
+ % anchors are visible outside and run on use
+ \anchor{center}{\pgfpointorigin}
+ % savedanchors are internals and run on node creation (not use)
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \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{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst 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/fd inst amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst 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/fd inst amp/refv pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\outport{
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
+ \pgf@x=-.5\pgf@x
+ \ifpgf@circuit@oa@oplusup\else\pgf@y=-\pgf@y\fi
+ }
+ \anchor{out}{
+ \outport
+ \pgf@y=0pt
+ }
+ \anchor{out +}{
+ \outport
+ }
+ \anchor{out -}{
+ \outport
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\outportfixed{
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/width}\pgf@circ@Rlen
+ \pgf@x=-.5\pgf@x
+ }
+ \anchor{out up}{
+ \outportfixed
+ }
+ \anchor{out down}{
+ \outportfixed
+ \pgf@y=-\pgf@y
+ }
+ %
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \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{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % let's start drawing the component
+ \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
+ % main component, normally in thicker lines
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ %first point (near output)
+ \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+ \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ % input terminal up
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
+
+ % input terminal down
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
+ % output leads down and up
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}} %
+ \pgftext[right, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}} %
+ \pgftext[right, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/port width}\pgf@circ@res@right}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi}
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
- \pgf@circ@drawtransformerbasicbody
+\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@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}
+ \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:
+% 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}}
- }
- }
+ \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
@@ -542,49 +836,47 @@
% 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}
+ \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}
-
-
+ \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 e0985bc65b6..82eddb17453 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircshapes.tex
@@ -5,244 +5,499 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt 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
- }
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\wd\pgfnodeparttextbox%
+ \pgf@y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+ \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
-
- }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/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@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}}
+ \pgfsetfillopacity{1.0}
+ \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
-
- }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/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@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}}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgfsetfillcolor{white}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfsetfillopacity{1.0}
+ \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
- }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/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@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}}
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+% BNC connector
+
+\pgfdeclareshape{bnc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ % BNC size is 2.5 times the size of the internal "ocirc"
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
+ \pgf@y=2.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ % center is on the opening
+ \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{zero}{ \pgfpointorigin }
+ \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ % geo-anchors
+ \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
+ \anchor{west}{ \northwest \pgf@y=0pt }
+ \anchor{left}{ \northwest \pgf@y=0pt }
+ \anchor{south}{ \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 }
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}{2.5*\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen}}
+ }
+ \behindforegroundpath{
+ \pgfextracty{\pgf@circ@res@other}{\northwest}
+ \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\ctikzvalof{bipoles/thickness}\pgflinewidth}
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ % external circle
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
+ {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
+ % next the opening to the right
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal circle
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ % and the contact line to the right
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \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
- }
+ \savedanchor{\northeast}{%
+ \pgf@x=.5\pgflinewidth%
+ \pgf@y=.5\pgflinewidth%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \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
- }
-
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+ \pgf@x=.5\pgf@circ@res@step
+ \pgf@y=\pgf@x%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+ \pgf@x =\pgf@circ@res@step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+
+ \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
- }
+ \savedanchor{\northeast}{%
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+ \pgf@y=.5\pgf@circ@res@step
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgf@x=\pgf@circ@res@step%
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+ \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
- }
-
+ \savedanchor{\northeast}{% this is really not northeast, really -northwest
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \pgfkeysvalueof{/tikz/circuitikz/current arrow scale}
+ \pgf@y=.5\pgf@circ@res@step
+ \pgf@x=1.7\pgf@circ@res@step
+ }
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax\pgf@x=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast\pgf@x=0cm\relax}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y\pgf@x=0cm\relax}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \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
- }
+ \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}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ }
}
+
+% full nodes for wire crossing
+
+\pgfdeclareshape{jump crossing}
+{
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \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 }
+ \behindbackgroundpath{
+ \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
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+\pgfdeclareshape{plain crossing}
+{
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{bipoles/crossing/size}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \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 }
+ \behindbackgroundpath{
+ \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
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+
+ }
+}
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
index c010dc5acd7..5a0417ed240 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
@@ -5,1377 +5,1507 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt 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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+% cute switch "node" shapes, matching with cute "to" shapes
+% #1 -> name
+% #2 -> barposition
+% #3 -> arrowcode
+\long\def\pgfcircdeclarecutespdt#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/spdt/width}\pgf@circ@Rlen
+ \pgf@x=.25\pgf@x
+ }
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/cuteswitch/height}\pgf@circ@Rlen
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/nodes width}\pgf@circ@Rlen
+ \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgf@circ@res@down = -.5\pgf@y
+ \pgf@circ@res@up = .5\pgf@y
+ \pgfextracty{\pgf@circ@res@other}{#2}
+ \pgf@x=0pt
+ \pgf@y=.5\pgf@circ@res@other
+ }
+ % 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 }
+
+ \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
+
+ \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=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
+ \pgfsetlinewidth{2\pgf@circ@res@temp}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ % terminals
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ }
+ }
+}
+
+\pgfcircdeclarecutespdt{cute spdt up}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up-1.5\pgf@circ@res@temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt mid}
+{\pgfpoint{\pgf@circ@res@right}{0pt}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt down}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt up arrow}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up-1.5\pgf@circ@res@temp}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt mid arrow}
+{\pgfpoint{\pgf@circ@res@right}{0pt}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt down arrow}
+{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}}
+{
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}}
+ \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
-\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
%%
+%% Code from John Kormylo at tex.stackexchange.com
+%% See https://tex.stackexchange.com/questions/372993/is-it-possible-to-implement-multiple-input-logic-ports-with-circuitikz
+%% Integration and fixes from Romano Giannetti and TheTeXnician <38565529+TheTeXnician@users.noreply.github.com>
+%%
+
+\newcount\pgf@circ@res@count% reserve global register
+
+\def\pgf@circ@logicport@input#1% #1 = \pgfmathcounter
+{%
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+}%
+
+% #1 = \pgfmathcounter #2=type #3 specificic port
+% type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
+\def\pgf@circ@logicport@baseinput#1#2#3%
+{%
+ % and and nand
+ \ifnum #2=1\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@left
+ \fi
+ % or and nor
+ \ifnum #2=2\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/angle}}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\pgf@y
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgf@x=\pgf@circ@res@other
+ \fi
+ % xor and xnor
+ \ifnum #2=3\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #3 port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@circ@res@temp=\pgf@y
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgf@x=\pgf@circ@res@other
+ \fi
+ % european
+ \ifnum #2=4\relax
+ \pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@other}{\left}%
+ \step
+ \pgf@circ@res@step=\dimexpr 2\pgf@y -2\pgf@circ@res@up\relax
+ \advance\pgf@y by -#1\pgf@circ@res@step\relax
+ \pgf@x=\pgf@circ@res@other
+ \fi
+}%
+
+%%% american
+\long\def\pgfcircdeclarelogicport#1#2#3{%
+ \pgfdeclareshape{american #1 port}%
+ {%
+ \savedmacro\resize{% automatic
+ \pgf@circ@res@up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgf@circ@res@down = -\pgf@circ@res@up
+ \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
+ \ifnum\pgf@circ@res@count<2 \pgf@circ@res@count=2\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
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/height}\pgf@circ@Rlen
+ \divide\pgf@circ@res@step by \pgf@circ@res@count
+ \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
+ }%
+ \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf@circ@res@left}{0pt}}
+ \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/port width}\pgf@circ@res@right}{0pt}}
+ \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american #1 port/origin}\pgf@circ@res@right}{0pt}}
+
+ \anchor{center}{\origin}% for backwards compatibility
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % create input anchors
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@american #1 port\endcsname{%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@circ@res@count%
+ \else%
+ %\pgfutil@ifundefined{pgf@anchor@american #1 port@in \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@american #1 port@in \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
+ }%
+ \expandafter\xdef\csname pgf@anchor@american #1 port@bin \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{#2}{#1}% defined above
+ }%
+ %}{}%
+ \repeatpgfmathloop%
+ }
+
+ \anchor{out}{\northeast\pgf@y=0pt}
+ \anchor{bout}{\right\pgf@y=0pt}
+
+
+ \anchor{left}{\left}% edges of component mius leads
+ \anchor{right}{\right}
+
+ \anchor{north east}{\northeast}% see \Compass macro
+ \anchor{south west}{\southwest}
+ \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfpoint{0cm}{\pgf@circ@res@up}}
+ \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{0cm}}
+ \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfpoint{0cm}{\pgf@circ@res@down}}
+ \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{0cm}}
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ #3
+ }
+}
+}
+%%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{and}{1}{
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american and port/port width}\pgf@circ@res@left
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpatharc{-90}{90}{-2\pgf@circ@res@other and \pgf@circ@res@up}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ }
+%%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \pgfcircdeclarelogicport{nand}{1}{
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nand port/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpatharc{-90}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}
+ \pgfpathclose
-\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
-
- }
- }
+ \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}}
+
+ \pgf@circ@draworfill
}
+%%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{nor}{2}{
+ \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
-\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}
-}
+ \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/angle}}%
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american nor port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+ \advance\pgf@circ@res@other by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpathclose
+ \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}}
-\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}
+ \pgf@circ@draworfill
}
+%%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{or}{2}{
+ \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up /sin(\pgf@circ@math@angle)}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp/\pgf@circ@math@yradius)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradius*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american or port/angle}}%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpathclose
-\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}
+ \pgf@circ@draworfill
}
+%%% american xor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xor}{3}{
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xor port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+ \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/angle}}%
-\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}
-}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{2\pgf@circ@res@other and \pgf@circ@res@up}%
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
-\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}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
+
+ \pgfusepath{draw}
}
+%%% american xnor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{xnor}{3}{
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american xnor port/angle}{\pgf@circ@math@angle}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/inner}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradius}{\pgf@circ@res@other /(1 - cos(\pgf@circ@math@angle)}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradius}{\pgf@circ@res@up / sin(\pgf@circ@math@angle))}%
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@xorigin}{\pgf@circ@res@other + \pgf@circ@math@xradius*cos(\pgf@circ@math@angle)}%
+ \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xor port/distance}\pgf@circ@res@right
+ \pgfmathsetlengthmacro{\pgf@circ@math@distance}{\pgf@circ@res@temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf@circ@math@yradiusA}{\pgf@circ@math@yradius -2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf@circ@math@xradiusA}{\pgf@circ@math@xradius -2\pgflinewidth}%
+
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ \pgf@circ@res@count = \inputs\relax
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfmathsetmacro{\pgf@circ@math@angle}{asin(\pgf@circ@res@temp / \pgf@circ@math@yradiusA)}%
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@math@xradiusA*cos(\pgf@circ@math@angle)-\pgf@circ@math@xorigin}%
+ \advance\pgf@circ@res@other by -\pgf@circ@math@distance
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@temp}}%
+ \advance\pgf@circ@res@count by -1
+ \repeat
+
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+
+ \edef\pgf@circ@math@angle{\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/angle}}%
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/circle width}\pgf@circ@res@right
+ \pgf@circ@res@temp = \dimexpr 2\pgf@circ@res@other - \pgf@circ@res@step\relax
+ \advance\pgf@circ@res@other by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradius and \pgf@circ@math@yradius}%
+ \pgfpatharc{-90}{0}{\pgf@circ@res@temp and \pgf@circ@res@up}%
+ \pgfpathclose
+ \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}}
+ \pgf@circ@draworfill
-\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}
+ \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/american xnor port/port width}\pgf@circ@res@left
+ \pgfmathsetlength{\pgf@circ@res@temp}{(\pgf@circ@math@yradiusA)*sin(\pgf@circ@math@angle)}%
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@math@distance}{\pgf@circ@res@temp}}% first arc
+ \pgfpatharc{\pgf@circ@math@angle}{-\pgf@circ@math@angle}{\pgf@circ@math@xradiusA and \pgf@circ@math@yradiusA}%
+
+ \pgfusepath{draw}
}
+%%% Original one-input ports
+
+\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
-\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}
-
- }
- }
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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}}
+ \pgf@circ@draworfill
+ \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}}
+ \pgf@circ@draworfill
+ \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{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
-\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}
-
- }
- }
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ \pgf@circ@draworfill
+ \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}}
+ \pgf@circ@draworfill
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ \pgf@circ@draworfill
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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}
+
+ }
+}
+%%% start european logic ports, from John Kormylo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
% #1 - name
% #2 - text inside
% #3 - number of inputs
-% #4 - is it a not
+% #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}
-%
-%
- }
- }
+ \pgfdeclareshape{european #1 port}
+ {
+ \savedmacro\resize{% automatic
+ \pgf@circ@res@up = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
+ \pgf@circ@res@up = .5\pgf@circ@res@up
+ \pgf@circ@res@down = -\pgf@circ@res@up
+ \pgf@circ@res@right = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #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/european #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
+ \def\inputs{\the\pgf@circ@res@count}%
+ }%
+ \savedanchor\step{% 1/2 gap at edges
+ \pgf@circ@res@step = \pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/height}\pgf@circ@Rlen
+ \divide\pgf@circ@res@step by #3
+ \pgfpoint{\pgf@circ@res@left}{\dimexpr\pgf@circ@res@up+0.5\pgf@circ@res@step}%
+ }%
+ \savedanchor\northeast{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
+ \savedanchor\southwest{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
+ \savedanchor\left{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
+ \savedanchor\right{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}%
+ \savedanchor\origin{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/origin}\pgf@circ@res@right}{0pt}}%
+
+ \anchor{center}{\origin}% for backwards compatibility
+ % the text anchor overlaps the logic symbol
+ \anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}%
+ % create input anchors
+ \ifnum#3=1\relax
+ \anchor{in}{\pgfpoint{\pgf@circ@res@left}{0pt}}% or \step
+ \else
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>#3%
+ \else%
+ %\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
+ \expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@input{\pgfmathcounter}% defined above
+ }%
+ \expandafter\xdef\csname pgf@anchor@european #1 port@bin \pgfmathcounter\endcsname{%
+ \noexpand\pgf@circ@logicport@baseinput{\pgfmathcounter}{4}{#1}% defined above
+ }%
+ %}{}%
+ \repeatpgfmathloop%
+ }
+ \fi
+ \anchor{out}{\northeast\pgf@y=0pt}
+ \anchor{bout}{\right\pgf@y=0pt}
+
+ \anchor{left}{\left}% edges of component minus leads
+ \anchor{right}{\right}
+
+ \anchor{north east}{\northeast}% see \Compass macro
+ \anchor{south west}{\southwest}
+ \anchor{north}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfpoint{0cm}{\pgf@circ@res@up}}
+ \anchor{north west}{\pgfextracty{\pgf@circ@res@up}{\northeast}%
+ \pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \anchor{west}{\pgfextractx{\pgf@circ@res@left}{\southwest}%
+ \pgfpoint{\pgf@circ@res@left}{0cm}}
+ \anchor{south}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfpoint{0cm}{\pgf@circ@res@down}}
+ \anchor{south east}{\pgfextracty{\pgf@circ@res@down}{\southwest}%
+ \pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
+ \pgfpoint{\pgf@circ@res@right}{0cm}}
+
+ \backgroundpath{
+ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \ifnum#3=1\relax
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
+ \pgfpathlineto{\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}{0pt}}%
+ \else
+ \pgfextracty{\pgf@circ@res@temp}{\step}%
+ \pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
+ %\pgf@circ@res@count = #3\relax% redundant
+ \loop\ifnum\pgf@circ@res@count>0
+ \advance\pgf@circ@res@temp by -\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/european #1 port/reserved}\pgf@circ@res@left}
+ {\pgf@circ@res@temp}}
+ \advance\pgf@circ@res@count by -1
+ \repeat
+ \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}
+ %
+ %
+ %
+ }
+ }
}
-
-
-
-\pgfcircdeclareeurologicport{and}{$\&$}{2}{}
-\pgfcircdeclareeurologicport{or}{$\ge 1$}{2}{}
-\pgfcircdeclareeurologicport{xor}{$=1$}{2}{}
+\pgfcircdeclareeurologicport{and}{\&}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{or}{$\ge 1$}{\pgf@circ@res@count}{}
+\pgfcircdeclareeurologicport{xor}{$=1$}{\pgf@circ@res@count}{}
\pgfcircdeclareeurologicport{not}{$1$}{1}{not}
-\pgfcircdeclareeurologicport{nand}{$\&$}{2}{not}
-\pgfcircdeclareeurologicport{nor}{$\ge 1$}{2}{not}
-\pgfcircdeclareeurologicport{xnor}{$=1$}{2}{not}
+\pgfcircdeclareeurologicport{nand}{\&}{\pgf@circ@res@count}{not}
+\pgfcircdeclareeurologicport{nor}{$\ge 1$}{\pgf@circ@res@count}{not}
+\pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}
+
+%% end european logic ports
\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
- %
- }
- }
+ \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}
+ \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 stroke line
+ \ifpgf@circuit@strokediode
+ \pgfpathmoveto{\pgfpointanchor{pgf@bodydiode}{west}}
+ \pgfpathlineto{\pgfpointanchor{pgf@bodydiode}{east}}
+ \pgfusepath{stroke}
+ \fi
+ %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{}
- %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
- }
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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 transistor
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \ifpgf@circuit@trans@ntype
+ \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/#1/arrow pos}}{%
+ \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{latexslim}
+ \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}
-}
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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}
@@ -1385,247 +1515,282 @@
\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
+ \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}}
- \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
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nmos/arrow pos}}{%
+ \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}
+ \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
+ \ifpgf@circuit@mos@arrows
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+ \pgftransformlineattime{\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/arrow pos}}{%
+ \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}
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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}
+}
+
+%% HEMT FET Transistor
+\pgfcircdeclaretransistor{hemt}{}{%
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@up}}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/gate height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/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/hemt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/base height}\pgf@circ@res@down}}
+ \pgfsetlinewidth{2\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/hemt/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}
}
\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
+ \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}}
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ %Bulk connection line
+ \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
+ {\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/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}
+ {\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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\pgflinewidth}
+ \pgfusepath{draw}
\endpgfscope
-
- \pgfscope
- \pgfslopedattimetrue
- \pgfallowupsidedownattimetrue
- \pgfresetnontranslationattimefalse
-
- \pgftransformlineattime{.6}{%
+
+ \pgfscope
+ \pgfslopedattimetrue
+ \pgfallowupsidedownattimetrue
+ \pgfresetnontranslationattimefalse
+
+ \pgftransformlineattime{.6}{%
\pgfpoint
- {\pgf@circ@res@right}%
- {\pgf@circ@res@up+\pgf@circ@res@down}%
- }{%
+ {\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
+ {\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}
+ \anchor{bulk}{\left\pgf@x=0pt}
+ \anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
+ #2
+ }
+ {#3}
}
@@ -1636,28 +1801,28 @@
\pgfdeclaretransistorwrapperaddbulk{pfet}{}{%
- \pgf@circuit@trans@depletiontypefalse
- \drawfetcore{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
+\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
}
@@ -1665,296 +1830,284 @@
% N-CHANNEL IGFET ENHANCEMENT TYPE with Bulk connector
\pgfdeclaretransistorwrapperaddbulk{nigfetebulk}{}{%
- \pgf@circuit@trans@depletiontypefalse
- \drawfetcore{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
+ \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
+ \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
+ \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}
+ \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
+ \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}
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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}
+ \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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ \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}
+ \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
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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}}
+ {\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
+ % 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}
+ {\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}
- \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
+ % 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
}
@@ -1976,45 +2129,49 @@
\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}
-
+}
+{\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
@@ -2034,45 +2191,58 @@
\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}
-
+}
+{\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}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+
+ \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
@@ -2092,42 +2262,47 @@
\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}
-
}
+{\ctikzvalof{tripoles/triac/height}}
+{emptytriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
-%% Empty triac
+ \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)}}
+
+ \pgf@circ@draworfill
+
+ \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}
+
+}
+
+%% Full triac
\pgfcircdeclarebipole{
\anchor{gate}{
@@ -2144,46 +2319,44 @@
\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}
-
}
+{\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}{
@@ -2194,407 +2367,884 @@
\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}
}
+{\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}
+}
-
-
+%% operational and instrumentation amplifiers
\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
-
-
-
- }
- }
+{
+ \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\inOneFixed{%
+ \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{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+
+ \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
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \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
+ }
+
+ \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{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\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
+
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \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} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
+
+
+ \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} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+
+ }
+}
%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$}
- }
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor\northwest{%
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{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 = \ctikzvalof{tripoles/en amp/port width}\pgf@x
+ }
+ \savedanchor\inOneFixed{%
+ \pgf@y=\ctikzvalof{tripoles/op amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/op amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/op amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\ctikzvalof{tripoles/en amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\ctikzvalof{tripoles/en amp/input height}\pgf@y
+ \pgf@x=-\ctikzvalof{tripoles/en amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \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
+ }
+ \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{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\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
+
+ \pgfscope
+ \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
+
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+
+ \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
+ % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
+ }
}
%%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
-
- }
- }
+{
+ \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\inOneFixed{%
+ \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{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \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
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \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
+ }
+ \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{text}{\northwest
+ \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
+ \pgfpoint{-.5\wd\pgfnodeparttextbox+.25\pgf@x}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\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
+
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ \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} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
+
+
+ \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} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
+
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{0pt}} %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+
+ }
+}
+%% instrumentation amplifier
+\pgfdeclareshape{inst amp}
+{
+ % when tikz calls the anchor it wants the relative position in the lengths
+ % \pgf@x \pgf@y
+ % \pgfpoint* functions set that variables
+ % anchors are visible outside and run on use
+ \anchor{center}{\pgfpointorigin}
+ % savedanchors are internals and run on node creation (not use)
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \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\inOneFixed{%
+ \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{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\up{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst 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/inst amp/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst 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/inst amp/refv pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \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{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % let's start drawing the component
+ \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
+ % main component, normally in thicker lines
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ %first point (near output)
+ \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
+ %from the exit to the top (short side)... (note that the .6 must be copied in \up and \refv anchors
+ \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.6\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ % input terminal -
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
+
+ % input terminal +
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
+ % output lead
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} %
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
+% instrumentation amplifier, with terminals for gain resistance between inputs
+\pgfdeclareshape{inst amp ra}
+{
+ \anchor{center}{\pgfpointorigin}
+ % bounding-box top left
+ \savedanchor\northwest{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ }
+ \anchor{nw}{
+ \northwest
+ }
+ \anchor{south}{
+ \northwest
+ \pgf@y=-\pgf@y\pgf@x=0pt\relax
+ }
+ \anchor{north}{
+ \northwest\pgf@x=0pt\relax
+ }
+ \savedanchor\left{%
+ \pgf@y=0pt
+ }
+ \anchor{leftedge}
+ {\left
+ \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/tripoles/op amp/port width}\pgf@x
+ }
+ % inputs (+-)
+ \savedanchor\inOneFixed{%
+ \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{in up}{
+ \inOneFixed
+ }
+ \anchor{in down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\inOne{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{-}{
+ \inOne
+ }
+ \anchor{+}{
+ \inOne
+ \pgf@y=-\pgf@y
+ }
+ % R ampli anchors. They are by default at 20% more than R-length distance
+ % you can change that with the `ra pos` key (use 0.5 for one-R).
+ \savedanchor\raOneFixed{%
+ \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{ra up}{
+ \inOneFixed
+ }
+ \anchor{ra down}{
+ \inOneFixed
+ \pgf@y=-\pgf@y
+ }
+ \savedanchor\raOne{%
+ \pgf@y=\pgf@circ@Rlen
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
+ \pgf@x=.5\pgf@x
+ \ifpgf@circuit@oa@iplusup\pgf@y=-\pgf@y\fi
+ }
+ \anchor{ra-}{
+ \raOne
+ }
+ \anchor{ra+}{
+ \raOne
+ \pgf@y=-\pgf@y
+ }
+ % power supplies
+ \savedanchor\up{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/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/inst amp ra/up pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{.4\pgf@circ@res@up}}
+ }
+ \anchor{up}{
+ \up
+ }
+ \anchor{down}{
+ \up
+ \pgf@y=-\pgf@y
+ }
+ % reference voltage input anchors.
+ \savedanchor\refv{%
+ \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/height}\pgf@circ@Rlen
+ \pgf@y=0.5\pgf@y
+ \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/width}\pgf@circ@Rlen
+ \pgf@x=0.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/inst amp ra/refv pos}}{
+ \pgfpoint{
+ \pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgf@circ@res@up}}
+ {\pgfpoint{.7\pgf@circ@res@right}{.4\pgf@circ@res@up}}
+ }
+ % we need both because they are normally drawn under the amp, and if you
+ % mirror it vertically you need them
+ \anchor{refv up}{
+ \refv
+ }
+ \anchor{refv down}{
+ \refv
+ \pgf@y=-\pgf@y
+ }
+ \anchor{out}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-\pgf@x
+ }
+ \anchor{west}{
+ \left
+ }
+ \anchor{east}{
+ \left
+ \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{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
+
+ % drawing of the component
+ \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
+
+ % main component, normally in thicker lines
+ \pgfscope
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
+ %primer punto: la linea de salida (lado componente)
+ \pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{0}}
+ %from the exit to the top (short side)... (note that the .4 must be copied in \up anchor
+ \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.4\pgf@circ@res@up}}
+ % and then to the input "front up", "down", to the output short side "down"
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{1.4\pgf@circ@res@right}{.4\pgf@circ@res@down}}
+ % ...and close
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+
+ % ra terminal -
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ % ra terminal +
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/ra pos}\pgf@circ@Rlen}}
+ % input terminal -
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}}
+ %
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@up}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup$+$\else$-$\fi}
+
+ % input terminal +
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}}
+ %
+ \pgfpathlineto{\pgfpoint
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}
+ {\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}}
+ \pgftext[left, at=\pgfpoint{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/port width}\pgf@circ@res@left}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\pgfkeysvalueof{/tikz/circuitikz/tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup$-$\else$+$\fi}
+ % output lead
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}} %
+ %
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ }
+}
%% Potentiometer
\pgfcircdeclarebipole{
\anchor{wiper}{
@@ -2604,441 +3254,454 @@
\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
+ }
+}
+{\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{latexslim}
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
}
-%% Generic tunable
+%% 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}}{
+}
+{\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
+ \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
+ \pgfscope
+ \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}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \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
- }
+ \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}
+ \pgf@circ@draworfill
+
+ % 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
- }
+ \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}
+ \pgf@circ@draworfill
+
+ % 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{\pgfkeysvalueof{/tikz/circuitikz/tripoles/thickness}\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
- }
+ \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{south west}{ \northwest \pgf@y=-\pgf@y}
+ \anchor{north east}{ \northwest \pgf@x=0pt\relax}
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \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}
+ \pgf@circ@draworfill
+
+ % 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}
@@ -3049,7 +3712,7 @@
\pgf@y=.5\pgf@y
\pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/twoport/width}\pgf@circ@Rlen
\pgf@x=.5\pgf@x
- \else
+ \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
@@ -3080,7 +3743,7 @@
\anchor{east}{
\northwest
\pgf@y=0pt
- \pgf@x=-\pgf@x
+ \pgf@x=-\pgf@x
}
\anchor{west}{
\northwest
@@ -3112,18 +3775,18 @@
\pgf@y=-\pgf@y
}
\backgroundpath{
- \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}
-
+ \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{}
@@ -3132,392 +3795,387 @@
\pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
\fi
\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgfusepath{draw}
-
+ \pgf@circ@draworfill
+
% 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
+
+ \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}
-
- }
+ \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
+ \pgf@circ@twoportbox
+
+ % 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
- }
+ \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
+ }
+ \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/elmech/width}\pgf@circ@Rlen
+ \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfscope % clip the bar: whole size minus the circle
+ \pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}}
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \pgfseteorule
+ \pgfusepath{clip}
+ \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{fill, draw}
+ \endpgfscope
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \ifx\tikz@fillcolor\pgfutil@empty
+ \pgfsetfillcolor{white}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \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}
+ \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
+ }
+ \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/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
- }
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ %create outer circle
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf@circ@res@right}
+ \pgf@circ@draworfill
+ %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
+ }
}
\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
index 568eb05385a..826ac82bba9 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircutils.tex
@@ -5,11 +5,11 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
%\def\pgf@circ@handleSI#1{%
% \pgf@circ@siunitx@resfalse
-%
+%
% \edef\len{\stringlength[e]{#1}}
%\testmatchingchar[e]{#1}{\len}{>}%
%\ifmatchingchar%
@@ -19,43 +19,42 @@
%\pgf@circ@siunitx@restrue
% \else
% \fi
- %\else
+ %\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
+ \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
-}
+ \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}
-
-\endinput \ No newline at end of file
+\endinput
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex
index 143f697ce04..62c10016603 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircvoltage.tex
@@ -5,38 +5,38 @@
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
-% See the file doc/LICENSE for more details.
+% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Voltage management
\ctikzset{v^>/.style = {
- v = #1,
- \circuitikzbasekey/bipole/voltage/direction = forward,
- \circuitikzbasekey/bipole/voltage/position = above
- }
+ 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
- }
+ 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
- }
+ 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
- }
+ v = #1,
+ \circuitikzbasekey/bipole/voltage/direction = backward,
+ \circuitikzbasekey/bipole/voltage/position = below
+ }
}
\ctikzset{v_/.style = {v = #1, \circuitikzbasekey/bipole/voltage/position = below} }
@@ -47,305 +47,370 @@
% 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
- }
+ \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
+ \ifpgf@circuit@bipole@iscurrent\ifpgf@circ@fixbatteries
+ \pgfkeys{\circuitikzbasekey/bipole/voltage/position=below,
+ \circuitikzbasekey/bipole/voltage/direction=forward}
+ \fi\fi
+ \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
+ }
}
-
-
+% american voltage font selection and symbol definition
+% the default font command is {} --- nothing
+\def\pgf@circ@avfont{\ctikzvalof{voltage/american font}}
+%
+% plus and minus symbols (default is $+$ and $-$, see pgfcirc.defines.tex)
+% notice that the double braces are needed to be able
+% to use \boldmath in the font (although it is semi-deprecated...)
+%
+\def\pgf@circ@avplus{\ctikzvalof{voltage/american plus}}
+\def\pgf@circ@avminus{\ctikzvalof{voltage/american minus}}
%% 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)$)
+ \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\pgf@temp{/tikz/circuitikz/bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}
+ \pgfkeysifdefined{\pgf@temp}
+ {
+ \edef\partheight{0.5*\ctikzvalof{bipoles/\pgfkeysvalueof{/tikz/circuitikz/bipole/kind}/height}}
+ \edef\tmpdistfromline{(\partheight\pgf@circ@Rlen+0.2\pgf@circ@Rlen)}
+ }
+ {
+ \edef\tmpdistfromline{(.5\pgf@circ@Rlen)} %fallback to fixed value
+ }
+ }
+ }
+ \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}} }
+ \edef\shiftv{\ctikzvalof{voltage/shift}}
+ \pgfmathsetmacro{\bumpb}{\bumpb + \shiftv} %% adjust the bump is shift
+ \ifpgf@circuit@bipole@inverted
+ \pgfmathsetmacro{\shiftv}{-\shiftv}
+ \fi
+ \ifnum \ctikzvalof{mirror value} = -1
+ \pgfmathsetmacro{\shiftv}{-\shiftv}
+ \fi
+ }
+ % %\pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} is equal to the length of the currarrow
+ coordinate (pgfcirc@midtmp) at ($(\tikztostart) ! \pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (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@Vfrom) at ($(pgfcirc@midtmp) ! -\distfromline ! \pgf@circ@voltage@angle:(anchorstartnode)$)
+ coordinate (pgfcirc@midtmp) at ($(\tikztotarget) ! \pgf@circ@Rlen/\pgfkeysvalueof{/tikz/circuitikz/current arrow scale} ! (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)$)
+ 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@bipole@voltage@below
+ coordinate (pgfcirc@Vto) at ($(pgfcirc@Vto) ! \shiftv!90 : (anchorendnode)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom) ! \shiftv!-90 : (anchorstartnode)$)
+ 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@Vto) at ($(pgfcirc@Vto) ! -\shiftv!90 : (anchorendnode)$)
+ coordinate (pgfcirc@Vfrom) at ($(pgfcirc@Vfrom) ! -\shiftv!-90 : (anchorstartnode)$)
+ 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
+ \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, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ \fi
+ \else
+ \ifpgf@circ@oldvoltagedirection
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ \else
+ (pgfcirc@Vfrom) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avplus}
+ (pgfcirc@Vto) node[inner sep=0, node font=\pgf@circ@avfont,
+ anchor=\pgf@circ@bipole@voltage@label@anchor]{\pgf@circ@avminus}
+ \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
+ % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a.
+ % it's not perfect, but I can't find the way to do it correctly...
+ \pgfextra{
+ \edef\shiftv{\ctikzvalof{voltage/shift}}
+ \edef\bumpa{\ctikzvalof{voltage/bump a}}
+ \pgfmathsetmacro{\bumpaplus}{\bumpa + \shiftv}
+ }
+ \ifpgf@circuit@bipole@voltage@below
+ coordinate (pgfcirc@Vfrom) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$)
+ coordinate (pgfcirc@Vto) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-60)$)
+ \else
+ coordinate (pgfcirc@Vfrom) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.120)$)
+ coordinate (pgfcirc@Vto) at ($ (\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\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@circ@fixbatteries
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ \else
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ \fi
+ \else
+ \ifpgf@circuit@bipole@voltage@backward
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ \else
+ (pgfcirc@Vfrom) node[node font=\pgf@circ@avfont] {\pgf@circ@avplus}
+ (pgfcirc@Vto) node[node font=\pgf@circ@avfont] {\pgf@circ@avminus}
+ \fi
+ \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
+\def\pgf@circ@drawvoltage{% node name
+ \pgfextra{ %WARNING: indentation is probably wrong
+ \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
- \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
- \ifpgf@circuit@bipole@inverted
- \ifpgf@circuit@bipole@voltage@below
- \pgf@circuit@bipole@voltage@belowfalse
- \else
- \pgf@circuit@bipole@voltage@belowtrue
- \fi
- \fi
+ \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
+ \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}} }
+ \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}} }
+ \edef\shiftv{\ctikzvalof{voltage/shift}}
+ % adjust the label distance to the shift.
+ \pgfmathsetmacro{\eudistplus}{\eudist+\shiftv}
- \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
- }%end pgfextra
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ }%end pgfextra
- \ifpgf@circuit@bipole@isvoltage
- \pgf@circ@drawvoltagegenerator
- \else
- \pgf@circ@drawvoltagegeneric
- \fi
+ \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
+ % (\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
+ \eudistplus
+ \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
\endinput