summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex577
1 files changed, 398 insertions, 179 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 445a14d639..b29aea5135 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -22,6 +22,7 @@
\pgf@circ@declare@family@arrows{tunable}
\pgf@circ@declare@family@arrows{wiper}
\pgf@circ@declare@family@arrows{switch}
+\pgf@circ@declare@family@arrows{gto gate}
%>>>
@@ -1595,6 +1596,8 @@
\ctikzset{bipoles/esource/width/.initial=.60}
\ctikzset{bipoles/pvsource/height/.initial=.60}
\ctikzset{bipoles/pvsource/width/.initial=.60}
+\ctikzset{bipoles/pvmodule/height/.initial=.60}
+\ctikzset{bipoles/pvmodule/width/.initial=1.20}
\ctikzset{bipoles/isource/height/.initial=.60}
\ctikzset{bipoles/isource/width/.initial=.60}
\ctikzset{bipoles/oosource/height/.initial=.60}
@@ -1916,7 +1919,6 @@
\endpgfscope
}
-
%% PV Source
\pgfcircdeclarebipolescaled{sources}
{}
@@ -1958,6 +1960,35 @@
}
+%% PV Module - contributed by Andre Alves
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/pvmodule/height}}
+{pvmodule}
+{\ctikzvalof{bipoles/pvmodule/height}}
+{\ctikzvalof{bipoles/pvmodule/width}}
+{
+
+ % Draw rectangle
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\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@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+
+ % Draw triangle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@draworfill
+
+ \pgfusepath{draw}
+}
+
%% Empty Source
\pgfcircdeclarebipolescaled{sources}
{}
@@ -2867,6 +2898,10 @@
\circuitikzbasekey/bipole/is voltage=true,
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true}
+\pgfcirc@activate@bipole@simple@opt{v}{pvmodule}{%
+ \circuitikzbasekey/bipole/is voltage=true,
+ \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true}
+
\pgfcirc@activate@bipole@simple@opt{v}{dcvsource}{%
\circuitikzbasekey/bipole/is voltage=true,
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true}
@@ -2987,17 +3022,55 @@
\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
\ctikzset{bipoles/varcap/height/.initial=.50}
\ctikzset{bipoles/varcap/width/.initial=.45}
+
\ctikzset{tripoles/thyristor/height/.initial=1.10}
\ctikzset{tripoles/thyristor/height 2/.initial=.5}
\ctikzset{tripoles/thyristor/width/.initial=1.0}
\ctikzset{tripoles/thyristor/diode height/.initial=.5}
\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+\ctikzset{tripoles/thyristor/gate height/.initial=0.0} % legacy 0
+\ctikzset{tripoles/thyristor/gate kink/.initial=1.0} % legacy 1.0
+\ctikzset{tripoles/thyristor/gto space up/.initial=0.5} % legacy 0.5
+\ctikzset{tripoles/thyristor/gto space down/.initial=0.0} % legacy 0.0
+\ctikzset{tripoles/thyristor/gto bar width/.initial=0.2} % legacy 0.2
\ctikzset{tripoles/triac/height/.initial=1.1}
\ctikzset{tripoles/triac/width/.initial=1}
\ctikzset{tripoles/triac/diode width left/.initial=.3}
\ctikzset{tripoles/triac/diode width right/.initial=.3}
+\ctikzset{tripoles/triac/gate kink/.initial=1}
+
+\ctikzset{thyristor style/.is choice}
+\ctikzset{thyristor style/legacy/.code={%
+ \ctikzset{tripoles/thyristor/height=1.1}%
+ \ctikzset{tripoles/thyristor/height 2=.5}%
+ \ctikzset{tripoles/thyristor/width=1.0}%
+ \ctikzset{tripoles/thyristor/diode height=.5}%
+ \ctikzset{tripoles/thyristor/diode width left=.4}%
+ \ctikzset{tripoles/thyristor/diode width right=.3}%
+ \ctikzset{tripoles/thyristor/gate height=0.0}%
+ \ctikzset{tripoles/thyristor/gate kink=1.0}%
+ \ctikzset{tripoles/thyristor/gto space up=0.5}%
+ \ctikzset{tripoles/thyristor/gto space down=0.0}%
+ \ctikzset{tripoles/thyristor/gto bar width=0.2}%
+ \ctikzset{tripoles/triac/gate kink=1}%
+}}
+\ctikzset{thyristor style/compact/.code={%
+ \ctikzset{tripoles/thyristor/height=0.8}% legacy 1.1
+ \ctikzset{tripoles/thyristor/height 2=.5}%
+ \ctikzset{tripoles/thyristor/width=1.0}%
+ \ctikzset{tripoles/thyristor/diode height=.5}%
+ \ctikzset{tripoles/thyristor/diode width left=.4}%
+ \ctikzset{tripoles/thyristor/diode width right=.4}%legacy 0.3
+ \ctikzset{tripoles/thyristor/gate height=0.5}% legacy 0
+ \ctikzset{tripoles/thyristor/gate kink=0.7}% legacy 1.0
+ \ctikzset{tripoles/thyristor/gto space up=0.25}% legacy 0.5
+ \ctikzset{tripoles/thyristor/gto space down=0.25}% legacy 0.0
+ \ctikzset{tripoles/thyristor/gto bar width=0.2}%
+ \ctikzset{tripoles/triac/gate kink=.7}%
+}}
+
%
% Flipping arrows in LED and photodiodes
%
@@ -3563,211 +3636,278 @@
\pgfusepath{draw}
}
-%% Black thyristor
-\pgfcircdeclarebipolescaled{diodes}
-{
- \anchor{gate}{\northeast}
- \anchor{anode}{\southwest\pgf@y=0cm}
- \anchor{G}{\northeast}
- \anchor{cathode}{\northeast\pgf@y=0cm }
-}
-{\ctikzvalof{tripoles/thyristor/height 2}}
-{fullthyristor}
-{\ctikzvalof{tripoles/thyristor/height}}
-{\ctikzvalof{tripoles/thyristor/width}}
-{
-
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+%%% Thyristors in general
- \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}
+\def\pgfcircdeclarethyristor#1#2#3#4{%name, fill (0-> black; 1-empty), gate position (1: catode, -1: anode), extra code
+ \pgfcircdeclarebipolescaled{diodes}
+ {
+ \savedmacro{\gatekink}{\edef\gatekink{\ctikzvalof{tripoles/thyristor/gate kink}}}
+ \anchor{gate}{\northeast\pgf@x=\gatekink\pgf@x\pgf@x=#3\pgf@x}
+ \anchor{G}{\northeast\pgf@x=\gatekink\pgf@x\pgf@x=#3\pgf@x}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+ }
+ {\ctikzvalof{tripoles/thyristor/height 2}}
+ {#1}
+ {\ctikzvalof{tripoles/thyristor/height}}
+ {\ctikzvalof{tripoles/thyristor/width}}
+ {
+ \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
- \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
+ \pgfscope
+ % draw the thick parts here (shifted horizontally)
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ % draw the basic triangle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathclose
+ \ifnum#2=0\relax
+ \pgfusepath{draw,fill}
+ \else
+ \pgf@circ@draworfill
+ \fi
+ % draw the vertical bar
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}}
+ % back to normal linewidth
+ % stroke if needed
+ \ifpgf@circuit@bipole@strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \fi
- \pgfusepath{draw}
+ % draw the gate thing;
+ #4
- \pgfsetlinewidth{\pgfstartlinewidth}
+ % draw the leads in/out
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \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}}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ }
+}
+\def\pgfcirc@thyristor@simplegate{%
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@step}
+ {\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\pgf@circ@res@up}
+ }
\pgfusepath{draw}
-
}
+%% Black thyristor
+\pgfcircdeclarethyristor{fullthyristor}{0}{1}{\pgfcirc@thyristor@simplegate}
%% Empty thyristor
-
-\pgfcircdeclarebipolescaled{diodes}
-{
- \anchor{gate}{\northeast}
- \anchor{anode}{\southwest\pgf@y=0cm}
- \anchor{G}{\northeast}
- \anchor{cathode}{\northeast\pgf@y=0cm }
-}
-{\ctikzvalof{tripoles/thyristor/height 2}}
-{emptythyristor}
-{\ctikzvalof{tripoles/thyristor/height}}
-{\ctikzvalof{tripoles/thyristor/width}}
-{
-
- \pgf@circ@setlinewidth{bipoles}{\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
-
+\pgfcircdeclarethyristor{emptythyristor}{1}{1}{\pgfcirc@thyristor@simplegate}
+%% black and empty GTO (standard: double line symbol, no arrow)
+
+\def\pgfcirc@doublegate@gto@add{
+ % connection to gate terminal
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up -
+ \ctikzvalof{tripoles/thyristor/gto space down}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\pgf@circ@res@up}
+ }
+ \pgfusepath{draw}
\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}}
-
+ \pgfcirc@set@arrows{gto gate}{}{}
+ % \pgfsetarrowsstart{latexslim}
+ % first (lower) gto line: from body to gate
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@step}
+ {(\ctikzvalof{tripoles/thyristor/gate height}-\ctikzvalof{tripoles/thyristor/gto space down})
+ *\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up -
+ \ctikzvalof{tripoles/thyristor/gto space down}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
\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}}
-
+ % second (higher) gto line: from gate to body
+ \pgfpathmoveto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up +
+ \ctikzvalof{tripoles/thyristor/gto space up}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\pgf@circ@res@step}
+ {(\ctikzvalof{tripoles/thyristor/gate height}+\ctikzvalof{tripoles/thyristor/gto space up})
+ *\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
\pgfusepath{draw}
+ \endpgfscope
}
+\pgfcircdeclarethyristor{fullgto}{0}{1}{\pgfcirc@doublegate@gto@add}
+\pgfcircdeclarethyristor{emptygto}{1}{1}{\pgfcirc@doublegate@gto@add}
-%% Empty triac
-\pgfcircdeclarebipolescaled{diodes}
-{
- \anchor{gate}{\northeast}
- \anchor{anode}{\southwest\pgf@y=0cm}
- \anchor{G}{\northeast}
- \anchor{cathode}{\northeast\pgf@y=0cm }
+\def\pgfcirc@bargate@gto@add{%
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@step}
+ {\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right}
+ {\pgf@circ@res@up}
+ }
+ % draw bar line.
+ \pgfpathmoveto{\pgfpoint
+ {(\ctikzvalof{tripoles/thyristor/gate kink}-\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@right}
+ {(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {(\ctikzvalof{tripoles/thyristor/gate kink}+\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@right}
+ {(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up}
+ }
+ \pgfusepath{draw}
}
-{\ctikzvalof{tripoles/triac/height}}
-{emptytriac}
-{\ctikzvalof{tripoles/triac/height}}
-{\ctikzvalof{tripoles/triac/width}}
-{
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+\pgfcircdeclarethyristor{fullgtobar}{0}{1}{\pgfcirc@bargate@gto@add}
+\pgfcircdeclarethyristor{emptygtobar}{1}{1}{\pgfcirc@bargate@gto@add}
- \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
+%% Thyristors with anode-connected gate
- \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)}}
+\def\pgfcirc@thyristor@anodegate{%
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@other}
+ {\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left}
+ {\pgf@circ@res@up}
+ }
+ \pgfusepath{draw}
+}
- \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)}}
+%% Black PUT
+\pgfcircdeclarethyristor{fullput}{0}{-1}{\pgfcirc@thyristor@anodegate}
+%% Empty PUT
+\pgfcircdeclarethyristor{emptyput}{1}{-1}{\pgfcirc@thyristor@anodegate}
+%% black and empty GTO (standard: double line symbol, no arrow)
- \pgf@circ@draworfill
+\def\pgfcirc@anodebargate@gto@add{%
+ \pgfpathmoveto{\pgfpoint
+ {\pgf@circ@res@other}
+ {\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left}
+ {\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left}
+ {\pgf@circ@res@up}
+ }
+ % draw bar line.
+ \pgfpathmoveto{\pgfpoint
+ {(\ctikzvalof{tripoles/thyristor/gate kink}-\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@left}
+ {(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up}
+ }
+ \pgfpathlineto{\pgfpoint
+ {(\ctikzvalof{tripoles/thyristor/gate kink}+\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@left}
+ {(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up}
+ }
+ \pgfusepath{draw}
+}
- \pgfsetlinewidth{\pgfstartlinewidth}
+\pgfcircdeclarethyristor{fullagtobar}{0}{-1}{\pgfcirc@anodebargate@gto@add}
+\pgfcircdeclarethyristor{emptyagtobar}{1}{-1}{\pgfcirc@anodebargate@gto@add}
- \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)
+% Triacs
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+\def\pgfcircdeclaretriac#1#2{%name, fill (0-> black; 1-empty)
+ \pgfcircdeclarebipolescaled{diodes}
+ {
+ \savedmacro{\gatekink}{\edef\gatekink{\ctikzvalof{tripoles/triac/gate kink}}}
+ \anchor{gate}{\northeast\pgf@x=\gatekink\pgf@x}
+ \anchor{G}{\northeast\pgf@x=\gatekink\pgf@x}
+ \anchor{anode}{\southwest\pgf@y=0cm}
+ \anchor{cathode}{\northeast\pgf@y=0cm }
+ }
+ {\ctikzvalof{tripoles/triac/height}}
+ {#1}
+ {\ctikzvalof{tripoles/triac/height}}
+ {\ctikzvalof{tripoles/triac/width}}
+ {
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \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
- \pgfusepath{draw}
-}
+ % diodes forms
+ \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)}}
-%% Full triac
-\pgfcircdeclarebipolescaled{diodes}
-{
- \anchor{gate}{\northeast}
- \anchor{anode}{\southwest\pgf@y=0cm}
- \anchor{G}{\northeast}
- \anchor{cathode}{\northeast\pgf@y=0cm }
-}
-{\ctikzvalof{tripoles/triac/height}}
-{fulltriac}
-{\ctikzvalof{tripoles/triac/height}}
-{\ctikzvalof{tripoles/triac/width}}
-{
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \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@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
+ \ifnum#2=0\relax
+ \pgfusepath{draw,fill}
+ \else
+ \pgf@circ@draworfill
+ \fi
- \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)}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
- \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)}}
+ % draw gate
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/triac/gate kink}*\pgf@circ@res@right}
+ {-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/triac/gate kink}*\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2)
- \pgfusepath{draw,fill}
+ % draw leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \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)
+ \pgfusepath{draw}
- \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}}
+\pgfcircdeclaretriac{fulltriac}{0}
+\pgfcircdeclaretriac{emptytriac}{1}
- \pgfusepath{draw}
-}% %>>>
+% end of shape definitions for diodes%>>>
%% Paths definitions for Diodes%<<<
@@ -3792,6 +3932,14 @@
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2}
\pgfcirc@activate@bipole{l}{#1thyristor}{#1thyristor}{#1 thyristor}
\pgfcirc@style@to@style{#1 thyristor}{Ty#2}
+ \pgfcirc@activate@bipole{l}{#1put}{#1put}{#1 put}
+ \pgfcirc@style@to@style{#1 put}{PUT#2}
+ \pgfcirc@activate@bipole{l}{#1gto}{#1gto}{#1 gto}
+ \pgfcirc@style@to@style{#1 gto}{GTO#2}
+ \pgfcirc@activate@bipole{l}{#1gtobar}{#1gtobar}{#1 gtobar}
+ \pgfcirc@style@to@style{#1 gtobar}{GTOb#2}
+ \pgfcirc@activate@bipole{l}{#1agtobar}{#1agtobar}{#1 agtobar}
+ \pgfcirc@style@to@style{#1 agtobar}{aGTOb#2}
\pgfcirc@activate@bipole{l}{#1triac}{#1triac}{#1 triac}
\pgfcirc@style@to@style{#1 triac}{Tr#2}
}
@@ -3818,6 +3966,14 @@
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2}
\pgfcirc@node@to@style{l}{emptythyristor}{#1 thyristor}{\circuitikzbasekey/bipole/is strokedsymbol=true}
\pgfcirc@style@to@style{#1 thyristor}{Ty#2}
+ \pgfcirc@node@to@style{l}{emptyput}{#1 put}{\circuitikzbasekey/bipole/is strokedsymbol=true}
+ \pgfcirc@style@to@style{#1 put}{PUT#2}
+ \pgfcirc@node@to@style{l}{emptygto}{#1 gto}{\circuitikzbasekey/bipole/is strokedsymbol=true}
+ \pgfcirc@style@to@style{#1 gto}{GTO#2}
+ \pgfcirc@node@to@style{l}{emptygtobar}{#1 gtobar}{\circuitikzbasekey/bipole/is strokedsymbol=true}
+ \pgfcirc@style@to@style{#1 gtobar}{GTOb#2}
+ \pgfcirc@node@to@style{l}{emptyagtobar}{#1 agtobar}{\circuitikzbasekey/bipole/is strokedsymbol=true}
+ \pgfcirc@style@to@style{#1 agtobar}{aGTOb#2}
\pgfcirc@node@to@style{l}{emptytriac}{#1 triac}{\circuitikzbasekey/bipole/is strokedsymbol=true}
\pgfcirc@style@to@style{#1 triac}{Tr#2}
}
@@ -3844,6 +4000,14 @@
\pgfcirc@style@to@style{bidirectionaldiode}{biD}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro thyristor}{thyristor}
\pgfcirc@style@to@style{thyristor}{Ty}
+\pgfcirc@style@to@style{\pgfcircdiodestylemacro put}{put}
+\pgfcirc@style@to@style{put}{PUT}
+\pgfcirc@style@to@style{\pgfcircdiodestylemacro gto}{gto}
+\pgfcirc@style@to@style{gto}{GTO}
+\pgfcirc@style@to@style{\pgfcircdiodestylemacro gtobar}{gtobar}
+\pgfcirc@style@to@style{gtobar}{GTOb}
+\pgfcirc@style@to@style{\pgfcircdiodestylemacro agtobar}{agtobar}
+\pgfcirc@style@to@style{agtobar}{aGTOb}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro triac}{triac}
\pgfcirc@style@to@style{triac}{Tr}
% %>>>
@@ -4657,6 +4821,62 @@
}
% oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
+%
+% oscilloscope waveforms
+
+\ctikzset{%
+ bipoles/oscope/waveform/sin/.code={%
+ \pgfpathmoveto{\pgfpoint{-0.6cm}{0cm}}
+ \pgfpathsine{\pgfpoint{0.3cm}{0.4cm}}
+ \pgfpathcosine{\pgfpoint{0.3cm}{-0.4cm}}
+ \pgfpathsine{\pgfpoint{0.3cm}{-0.4cm}}
+ \pgfpathcosine{\pgfpoint{0.3cm}{0.4cm}}
+ \pgfusepath{draw}
+ },
+ bipoles/oscope/waveform/ramps/.code={%
+ \pgfpathmoveto{\pgfpoint{-0.75cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{-0.05cm}{0.25cm}}
+ \pgfpathlineto{\pgfpoint{-0.05cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.65cm}{0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.65cm}{-0.25cm}}
+ \pgfusepath{draw}
+ },
+ bipoles/oscope/waveform/square/.code={%
+ \pgfpathmoveto{\pgfpoint{-0.75cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{-0.6cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{-0.6cm}{0.25cm}}
+ \pgfpathlineto{\pgfpoint{0cm}{0.25cm}}
+ \pgfpathlineto{\pgfpoint{0cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.6cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.6cm}{0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.75cm}{0.25cm}}
+ \pgfusepath{draw}
+ },
+ bipoles/oscope/waveform/triangle/.code={%
+ \pgfpathmoveto{\pgfpoint{-0.75cm}{0cm}}
+ \pgfpathlineto{\pgfpoint{-0.6cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{-0.3cm}{0.25cm}}
+ \pgfpathlineto{\pgfpoint{0cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.3cm}{0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.6cm}{-0.25cm}}
+ \pgfpathlineto{\pgfpoint{0.75cm}{0cm}}
+ \pgfusepath{draw}
+ },
+ bipoles/oscope/waveform/zero/.code={
+ \pgfpathmoveto{\pgfpoint{-0.75cm}{0cm}}
+ \pgfpathlineto{\pgfpoint{0.75cm}{0cm}}
+ \pgfusepath{draw}
+ },%
+ bipoles/oscope/waveform/lissajous/.code={%
+ \pgfpathellipse{\pgfpoint{0cm}{0cm}}
+ {\pgfpoint{0.5cm}{0.35cm}}{\pgfpoint{-0.3cm}{0.2cm}}
+ \pgfusepath{draw}
+ },
+ bipoles/oscope/waveform/none/.code={},%
+}
+% default waveform (backward compatible)
+\ctikzset{bipoles/oscope/waveform/.initial=ramps}
+
\pgfcircdeclarebipolescaled{instruments}
{
\anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x}
@@ -4682,8 +4902,6 @@
\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
@@ -4700,23 +4918,24 @@
\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]%
+ % the "almost one" make the grid complete most of the time --- beware of antialiasing
+ \pgfpathgrid[stepx=0.995\pgf@circ@res@step, stepy=0.995\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
- \pgf@circ@setlinewidth{bipoles}{\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}
+ % function displayed
+ \pgfscope
+ \pgfmathsetmacro{\@@scalex}{\pgf@circ@res@right/1cm}
+ \pgfmathsetmacro{\@@scaley}{\pgf@circ@res@up/1cm}
+ \pgftransformxscale{\@@scalex}
+ \pgftransformyscale{\@@scaley}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfkeys{\circuitikzbasekey/bipoles/oscope/waveform/\ctikzvalof{bipoles/oscope/waveform}}
+ \endpgfscope
\endpgfscope
}
-
% generic round meter with always horizontal text, no arrow
\pgfcircdeclarebipolescaled{instruments}
{}