diff options
author | Karl Berry <karl@freefriends.org> | 2023-02-11 21:16:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-02-11 21:16:14 +0000 |
commit | 664389d85e86be950cd80065e2af3665a0feadfd (patch) | |
tree | 78c812cf43c4ea3e2713af7e6b947e885127ea4f /Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex | |
parent | d6abdd7b762edd06a176a6ca5dfe4bb308a078bc (diff) |
circuitikz (11feb23)
git-svn-id: svn://tug.org/texlive/trunk@65785 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex | 147 |
1 files changed, 134 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex index c6677c331f5..be54c93e344 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -5568,6 +5568,109 @@ % %>>> +% solder jumpers: definitions and code %<<< +\ctikzset{bipoles/solder jumper/width/.initial=0.36} +\ctikzset{bipoles/solder jumper/height/.initial=0.3} % must be less than width, otherwise no gap! +\ctikzset{bipoles/solder jumper/close height/.initial=0.6}% fraction of the vertical gap filled +\ctikzset{bipoles/double solder jumper/width/.initial=0.57} +% +\def\pgfcirc@base@solder@jumper{% + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpatharc{90}{270}{\pgf@circ@res@up} + \pgfpathclose + \pgfusepath{draw,fill} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\pgf@circ@res@up}} + \pgfpatharc{90}{-90}{\pgf@circ@res@up} + \pgfpathclose + \pgfusepath{draw,fill} +} +% simple solder jumpers +% #1 -> name +% #2 -> open or close (0 means open, 1 closed) +\long\def\pgfcircdeclaresolderjumper#1#2{ + \pgfcircdeclarebipolescaled{switches} + { + \anchor{out}{\northeast \pgf@y=0cm} + \anchor{in}{\southwest\pgf@y=0cm} + \anchor{text}{\northeast + \pgf@x=\dimexpr -.5\wd\pgfnodeparttextbox\relax + \advance\pgf@y by .6\ht\pgfnodeparttextbox\relax + } + } + {\ctikzvalof{bipoles/solder jumper/height}} + {#1} + {\ctikzvalof{bipoles/solder jumper/height}} + {\ctikzvalof{bipoles/solder jumper/width}}{ + % + \pgfcirc@base@solder@jumper + \ifnum #2=0 \else + \pgfpathrectanglecorners + {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up} + {\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up} + {\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \fi + } +} +\pgfcircdeclaresolderjumper{osjumper}{0} +\pgfcircdeclaresolderjumper{csjumper}{1} +\pgfcirc@activate@bipole{l}{osjumper}{osjumper}{open solder jumper} +\pgfcirc@activate@bipole{l}{csjumper}{csjumper}{closed solder jumper} +% three pins (two-ways) solder jumpers +% #1 -> name +% #2 -> first side open or closed +% #3 -> second side open or closed +\long\def\pgfcircdeclaredoublesolderjumper#1#2#3{ + \pgfcircdeclarebipolescaled{switches} + { + % + \anchor{out}{\northeast \pgf@y=0cm} + \anchor{in}{\southwest\pgf@y=0cm} + \anchor{tap}{\northeast\pgf@x=0cm} + \anchor{tap up}{\northeast\pgf@x=0cm} + \anchor{tap down}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y} + \anchor{text}{\northeast + \pgf@x=\dimexpr -.5\wd\pgfnodeparttextbox\relax + \advance\pgf@y by .6\ht\pgfnodeparttextbox\relax + } + } + {\ctikzvalof{bipoles/solder jumper/height}} + {#1} + {\ctikzvalof{bipoles/solder jumper/height}} + {\ctikzvalof{bipoles/double solder jumper/width}} + { + \pgfcirc@base@solder@jumper + \pgfpathrectanglecorners + {\pgfpoint{-.5\pgf@circ@res@up}{\pgf@circ@res@up}} + {\pgfpoint{.5\pgf@circ@res@up}{\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \ifnum #2=0 \else + \pgfpathrectanglecorners + {\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} + {\pgfpoint{-.5\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \fi + \ifnum #3=0 \else + \pgfpathrectanglecorners + {\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} + {\pgfpoint{.5\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} + \pgfusepath{fill, draw} + \fi + } +} +% +\pgfcircdeclaredoublesolderjumper{odsjumper}{0}{0} +\pgfcircdeclaredoublesolderjumper{ldsjumper}{1}{0} +\pgfcircdeclaredoublesolderjumper{rdsjumper}{0}{1} +\pgfcircdeclaredoublesolderjumper{cdsjumper}{1}{1} +\pgfcirc@activate@bipole{l}{odsjumper}{odsjumper}{open double solder jumper} +\pgfcirc@activate@bipole{l}{ldsjumper}{ldsjumper}{left double solder jumper} +\pgfcirc@activate@bipole{l}{rdsjumper}{rdsjumper}{right double solder jumper} +\pgfcirc@activate@bipole{l}{cdsjumper}{cdsjumper}{closed double solder jumper} + +% %>>> + %%%%%%%%%%%%%%%%% %% Instruments %%%%%%%%%%%%%%%%% @@ -6534,6 +6637,8 @@ \ctikzset{bipoles/mic/height/.initial=1.2} \ctikzset{bipoles/mic/depth/.initial=.1} \ctikzset{bipoles/mic/width/.initial=.8}% +\ctikzset{bipoles/tlmic/width/.initial=.5}% it MUST be mic width *5/8 +\ctikzset{bipoles/mic/bar thickness/.initial=1} % arresters, fuses, lamps, etc @@ -6592,6 +6697,15 @@ \pgf@circ@draworfill } +\def\pgf@circ@draw@mic@bar#1{%relative length of the bar + \pgfsetroundcap + \pgfsetlinewidth{\ctikzvalof{bipoles/mic/bar thickness}\pgflinewidth}% + % adjust the vertical position; the symbol looks better if the circle touch the bar + \pgfpathmoveto{\pgfpoint{#1\pgf@circ@res@left}{\pgf@circ@res@up+0.4\pgflinewidth}} + \pgfpathlineto{\pgfpoint{#1\pgf@circ@res@right}{\pgf@circ@res@up+0.4\pgflinewidth}} + \pgfusepath{draw} +} + \pgfcircdeclarebipolescaled{misc} {} {\ctikzvalof{bipoles/mic/depth}} @@ -6600,14 +6714,11 @@ {\ctikzvalof{bipoles/mic/width}}{ \pgfscope - \pgf@circ@setlinewidth{bipoles}{\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} + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up} + \pgf@circ@draworfill + \pgf@circ@draw@mic@bar{.6} \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) @@ -6616,9 +6727,18 @@ \pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} \pgfusepath{draw} +} +\pgfcircdeclarebipolescaled{misc} +{} +{\ctikzvalof{bipoles/tlmic/width}} +{tlmic} +{\ctikzvalof{bipoles/tlmic/width}} +{\ctikzvalof{bipoles/tlmic/width}}{ - \pgfusepath{draw} - \endpgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0pt}{0pt}}{\pgf@circ@res@up} + \pgf@circ@draworfill + \pgf@circ@draw@mic@bar{1} } %% european gas filled surge arrester @@ -6875,6 +6995,7 @@ \pgfcirc@path@to@style{l}{gfsurgearrester}{gas filled surge arrester}{} \pgfcirc@path@to@style{l}{gfsurgearrester}{gf surge arrester}{} \pgfcirc@activate@bipole@simple{l}{mic} +\pgfcirc@activate@bipole@simple{l}{tlmic} \pgfcirc@activate@bipole@simple{l}{loudspeaker} % %>>> |