diff options
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex')
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex | 294 |
1 files changed, 173 insertions, 121 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex index e013c51c3b..cccb975f22 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex @@ -3231,7 +3231,9 @@ \ctikzset{tripoles/njfet/gate height 2/.initial=.35} \ctikzset{tripoles/njfet/gate width/.initial=.5} \ctikzset{tripoles/njfet/base width/.initial=.5} -\ctikzset{tripoles/njfet/conn height/.initial=.35} +\ctikzset{tripoles/njfet/conn height/.initial=.35}% at the exterior +\ctikzset{tripoles/njfet/union height/.initial=.35}% at the gate +\ctikzset{tripoles/njfet/conn kink/.initial=1}% 1=no kink \ctikzset{tripoles/njfet/height/.initial=1.1} \ctikzset{tripoles/njfet/bodydiode scale/.initial=.3} \ctikzset{tripoles/njfet/bodydiode distance/.initial=.3} @@ -3244,12 +3246,42 @@ \ctikzset{tripoles/pjfet/gate width/.initial=.5} \ctikzset{tripoles/pjfet/base width/.initial=.5} \ctikzset{tripoles/pjfet/conn height/.initial=.35} +\ctikzset{tripoles/pjfet/union height/.initial=.35}% at the gate +\ctikzset{tripoles/pjfet/conn kink/.initial=1}% 1=no kink \ctikzset{tripoles/pjfet/height/.initial=1.1} \ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3} \ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3} \ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6} \ctikzset{tripoles/pjfet/curr direction/.initial=-1} +\ctikzset{tripoles/nujt/width/.initial=.7} +\ctikzset{tripoles/nujt/gate height/.initial=.5} +\ctikzset{tripoles/nujt/gate height 2/.initial=.35} +\ctikzset{tripoles/nujt/gate width/.initial=.5} +\ctikzset{tripoles/nujt/base width/.initial=.5} +\ctikzset{tripoles/nujt/conn height/.initial=.35} +\ctikzset{tripoles/nujt/union height/.initial=0}% at the gate +\ctikzset{tripoles/nujt/conn kink/.initial=.82}% to match the circle position +\ctikzset{tripoles/nujt/height/.initial=1.1} +\ctikzset{tripoles/nujt/bodydiode scale/.initial=.3} +\ctikzset{tripoles/nujt/bodydiode distance/.initial=.3} +\ctikzset{tripoles/nujt/bodydiode conn/.initial=.6} +\ctikzset{tripoles/nujt/curr direction/.initial=1} + +\ctikzset{tripoles/pujt/width/.initial=.7} +\ctikzset{tripoles/pujt/gate height/.initial=.5} +\ctikzset{tripoles/pujt/gate height 2/.initial=.35} +\ctikzset{tripoles/pujt/gate width/.initial=.5} +\ctikzset{tripoles/pujt/base width/.initial=.5} +\ctikzset{tripoles/pujt/conn height/.initial=.35} +\ctikzset{tripoles/pujt/union height/.initial=0}% at the gate +\ctikzset{tripoles/pujt/conn kink/.initial=.82}% to match the circle position +\ctikzset{tripoles/pujt/height/.initial=1.1} +\ctikzset{tripoles/pujt/bodydiode scale/.initial=.3} +\ctikzset{tripoles/pujt/bodydiode distance/.initial=.3} +\ctikzset{tripoles/pujt/bodydiode conn/.initial=.6} +\ctikzset{tripoles/pujt/curr direction/.initial=-1} + \ctikzset{tripoles/isfet/width/.initial=1} \ctikzset{tripoles/isfet/gate height/.initial=.35} \ctikzset{tripoles/isfet/base height/.initial=.5} @@ -5417,139 +5449,159 @@ \fi } -\pgfcircdeclaretransistor{njfet}{ - \anchor{inner up}{ - \northeast - \pgf@y=\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y - } - \anchor{inner down}{ - \northeast - \pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y - } - }{% - % add the circle if requested (before everything else, so we can fill it) - \pgfcirc@transistorcircle - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}} +%%% uni-junction transistors: jfets, ujts - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}} - \pgfusepath{draw} +\long\def\pgfcircdeclarejunctiontransistor#1#2#3{% name, extra anchors, extra draw + \pgfcircdeclaretransistor{#1}{ + \anchor{inner up}{ + \northeast + \pgf@y=\ctikzvalof{tripoles/#1/gate height 2}\pgf@y + } + \anchor{inner down}{ + \northeast + \pgf@y=-\ctikzvalof{tripoles/#1/gate height 2}\pgf@y + } + \anchor{kink}{ + \northeast + \pgf@ya=-\ctikzvalof{tripoles/#1/gate height 2}\pgf@y + \left + \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@ya + \pgf@x=\ctikzvalof{tripoles/#1/conn kink}\pgf@x + } + % extra anchors (or override) + #2 + }{% + % add the circle if requested (before everything else, so we can fill it) + \pgfcirc@transistorcircle - \pgfscope - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@up}} + % get direction + \edef\@@dir{\ctikzvalof{tripoles/#1/curr direction}} + + % draw drain/source connections: up + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint - {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/njfet/gate height}\pgf@circ@res@down}} - \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up}} + + % down + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} + {\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}} \pgfusepath{draw} - \endpgfscope - % arrow - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgfresetnontranslationattimefalse - \ifpgf@circuit@trans@arrowatend - \edef\@@anchor{tip}\edef\@@pos{1.0} - \else - \edef\@@anchor{center}\edef\@@pos{0.6} - \fi - \pgftransformlineattime{\@@pos}{% - \pgfpoint{\pgf@circ@res@left}% - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}% - }{% - \pgfpoint - {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left}% - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}% - } - \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} - \endpgfscope + \pgfscope + \pgfpathmoveto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint + {\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left} + {\ctikzvalof{tripoles/#1/gate height}\pgf@circ@res@down}} + \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} + \pgfusepath{draw} + \endpgfscope - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/njfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth} - {\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@down}} - \pgfusepath{draw} -} + % arrow + \pgfscope + \pgfslopedattimetrue + \pgfallowupsidedownattimetrue + \pgfresetnontranslationattimefalse + \ifpgf@circuit@trans@arrowatend + \ifnum\@@dir>0 + \edef\@@anchor{tip}\edef\@@pos{1.0} + \else + \edef\@@anchor{btip}\edef\@@pos{1.0} + \fi + \else + \ifnum\@@dir>0 + \edef\@@anchor{center}\edef\@@pos{0.6} + \else + \edef\@@anchor{center}\edef\@@pos{0.4} + \fi + \fi + % find x1, x2 and y for the base arrow + \ifnum\@@dir>0 + \pgf@circ@res@step=\ctikzvalof{tripoles/#1/conn kink}\pgf@circ@res@left + \pgf@circ@res@other=\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left + \pgf@circ@res@zero=\ctikzvalof{tripoles/#1/union height}\pgf@circ@res@down + \pgf@circ@res@temp=\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@down + \else + \pgf@circ@res@step=\ctikzvalof{tripoles/#1/gate width}\pgf@circ@res@left + \pgf@circ@res@other=\ctikzvalof{tripoles/#1/conn kink}\pgf@circ@res@left + \pgf@circ@res@zero=\ctikzvalof{tripoles/#1/gate height 2}\pgf@circ@res@up + \pgf@circ@res@temp=\ctikzvalof{tripoles/#1/union height}\pgf@circ@res@up + \fi + % + % gate line (called emitter in UJT) + % + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@temp}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + % + % horizontal gate line + % + \ifpgf@circuit@bpt@drawgate + \ifnum\@@dir>0 + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@temp}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}} + \else + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \fi + \fi + \pgfusepath{draw} + % + % gate arrows (called emitter in UJT) + % + \pgftransformlineattime{\@@pos}{% + \pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@temp} + }{% + \pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero} + } + \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} + % + % gate line (called emitter in UJT) + % + \endpgfscope -\pgfcircdeclaretransistor{pjfet}{ - \anchor{inner up}{ - \northeast - \pgf@y=\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y - } - \anchor{inner down}{ - \northeast - \pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y - } - }{% - % add the circle if requested (before everything else, so we can fill it) - \pgfcirc@transistorcircle - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}} + % extra drawings + #3 + } +} - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right} - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}} - \pgfusepath{draw} +% NJFET and PJFET - \pgfscope - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint - {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/pjfet/gate height}\pgf@circ@res@down}} - \pgf@circ@setlinewidth{tripoles}{\pgflinewidth} - \pgfusepath{draw} - \endpgfscope +\pgfcircdeclarejunctiontransistor{njfet}{}{} +\pgfcircdeclarejunctiontransistor{pjfet}{}{} - \pgfscope - \pgfslopedattimetrue - \pgfallowupsidedownattimetrue - \pgfresetnontranslationattimefalse - \ifpgf@circuit@trans@arrowatend - \edef\@@anchor{btip}\edef\@@pos{1.0} - \else - \edef\@@anchor{center}\edef\@@pos{0.4} +\def\@ujtanchoroverride#1{ + \savedanchor{\ujtrealemitter}{ + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgf@y=\ctikzvalof{tripoles/#1/height}\pgf@circ@scaled@Rlen + \pgf@y=.5\pgf@y %north anchor height + % kink AND conn height, they're the same + \pgf@y=-\ctikzvalof{tripoles/#1/gate height 2}\pgf@y + \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y + % horizontal + \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen % left + \ifpgf@circuit@bpt@drawgate\else + \pgf@x=\ctikzvalof{tripoles/#1/conn kink}\pgf@x \fi - \pgftransformlineattime{\@@pos}{% - \pgfpoint% - {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left}% - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}% - }{% - \pgfpoint{\pgf@circ@res@left}% - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}% - } - \pgfnode{trarrow}{\@@anchor}{}{}{\pgfusepath{stroke}} - \endpgfscope - - \pgfpathmoveto{\pgfpoint - {\ctikzvalof{tripoles/pjfet/gate width}\pgf@circ@res@left} - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth} - {\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}} - \pgfusepath{draw} + } + \anchor{E}{\ujtrealemitter} + \anchor{emitter}{\ujtrealemitter} + \anchor{B2}{\northeast\pgf@y=-\pgf@y} + \anchor{B1}{\northeast} } + +\pgfcircdeclarejunctiontransistor{nujt}{\@ujtanchoroverride{nujt}}{} +\pgfcircdeclarejunctiontransistor{pujt}{\@ujtanchoroverride{pujt}}{} + + \pgfdeclaretransistorwrapperaddbulk{isfet}{ }{% % add the circle if requested (before everything else, so we can fill it) |