diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex | 530 |
1 files changed, 318 insertions, 212 deletions
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} |