| 1 |
% Copyright 2018-2026 by Romano Giannetti |
| 2 |
% Copyright 2015-2026 by Stefan Lindner |
| 3 |
% Copyright 2013-2026 by Stefan Erhardt |
| 4 |
% Copyright 2007-2026 by Massimo Redaelli |
| 5 |
% |
| 6 |
% This file may be distributed and/or modified |
| 7 |
% |
| 8 |
% 1. under the LaTeX Project Public License and/or |
| 9 |
% 2. under the GNU Public License. |
| 10 |
% |
| 11 |
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details. |
| 12 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 13 |
%% Standard bipole shapes declarations |
| 14 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 15 |
|
| 16 |
%% Generic macro and flags for bipoles %<<< |
| 17 |
% Fixing tunable directions |
| 18 |
\newif\ifpgf@circ@fixtunable@dir |
| 19 |
\ctikzset{bipoles/fix tunable direction/.is if=pgf@circ@fixtunable@dir} |
| 20 |
\ctikzset{bipoles/fix tunable direction=true} |
| 21 |
% choosing several arrows |
| 22 |
\pgf@circ@declare@family@arrows{tunable} |
| 23 |
\pgf@circ@declare@family@arrows{wiper} |
| 24 |
\pgf@circ@declare@family@arrows{switch} |
| 25 |
\pgf@circ@declare@family@arrows{gto gate} |
| 26 |
\pgf@circ@declare@family@arrows{opto} |
| 27 |
|
| 28 |
%>>> |
| 29 |
|
| 30 |
|
| 31 |
%%%%%%%%%%%%%%%%%%%%%%%% |
| 32 |
% Resistive components: generics, resistors, wires |
| 33 |
%%%%%%%%%%%%%%%%%%%%%%%% |
| 34 |
|
| 35 |
%% Definitions for resistive components %<<< |
| 36 |
|
| 37 |
% Zig Zag resistors |
| 38 |
\ctikzset{resistors/zigs/.initial=3} |
| 39 |
\ctikzset{resistors/width/.code={% |
| 40 |
\ctikzset{bipoles/resistor/width=#1}% |
| 41 |
\ctikzset{bipoles/vresistor/width=#1}% |
| 42 |
\ctikzset{bipoles/potentiometer/width=#1}% |
| 43 |
\ctikzset{bipoles/resistivesens/width=#1}% |
| 44 |
\ctikzset{bipoles/photoresistor/width=#1}% |
| 45 |
\ctikzset{bipoles/thermistor/width=#1}% |
| 46 |
\ctikzset{bipoles/thermistorntc/width=#1}% |
| 47 |
\ctikzset{bipoles/thermistorptc/width=#1}% |
| 48 |
\ctikzset{bipoles/varistor/width=#1}% |
| 49 |
\ctikzset{bipoles/generic/width=#1}% |
| 50 |
\ctikzset{bipoles/generic potentiometer/width=#1}% |
| 51 |
\ctikzset{bipoles/ageneric/width=#1}% |
| 52 |
\ctikzset{bipoles/tgeneric/width=#1}% |
| 53 |
\ctikzset{bipoles/ldresistor/width=#1}% |
| 54 |
\ctikzset{bipoles/ldgeneric/width=#1}% |
| 55 |
}} |
| 56 |
\ctikzset{wiper pos/.code={% |
| 57 |
\ctikzset{bipoles/potentiometer/wiper pos=#1}% |
| 58 |
\ctikzset{bipoles/generic potentiometer/wiper pos=#1}% |
| 59 |
}} |
| 60 |
% zigzag resistor |
| 61 |
\ctikzset{bipoles/resistor/height/.initial=.3} |
| 62 |
\ctikzset{bipoles/resistor/width/.initial=.8} |
| 63 |
\ctikzset{bipoles/potentiometer/height/.initial=.8} |
| 64 |
\ctikzset{bipoles/potentiometer/height 2/.initial=.3} |
| 65 |
\ctikzset{bipoles/potentiometer/width/.initial=.8} |
| 66 |
\ctikzset{bipoles/potentiometer/wiper pos/.initial=.5} |
| 67 |
\ctikzset{bipoles/vresistor/height/.initial=.6} |
| 68 |
\ctikzset{bipoles/vresistor/width/.initial=.8} |
| 69 |
\ctikzset{bipoles/resistivesens/height/.initial=.6} |
| 70 |
\ctikzset{bipoles/resistivesens/width/.initial=.8} |
| 71 |
\ctikzset{bipoles/ldresistor/height/.initial=.8} |
| 72 |
\ctikzset{bipoles/ldresistor/width/.initial=.8} |
| 73 |
\ctikzset{bipoles/ldresistor/internal scale/.initial=.8} |
| 74 |
% square resistors |
| 75 |
\ctikzset{bipoles/photoresistor/height/.initial=.6} |
| 76 |
\ctikzset{bipoles/photoresistor/height 2/.initial=.3} |
| 77 |
\ctikzset{bipoles/photoresistor/width/.initial=.8} |
| 78 |
\ctikzset{bipoles/thermistor/main/.initial=.7} |
| 79 |
\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7 |
| 80 |
\ctikzset{bipoles/thermistorntc/width/.initial=.8} |
| 81 |
\ctikzset{bipoles/thermistorntc/main/.initial=.7} |
| 82 |
\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7 |
| 83 |
\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7 |
| 84 |
\ctikzset{bipoles/thermistorptc/width/.initial=.8} |
| 85 |
\ctikzset{bipoles/thermistorptc/main/.initial=.7} |
| 86 |
\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7 |
| 87 |
\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7 |
| 88 |
\ctikzset{bipoles/thermistor/width/.initial=.8} |
| 89 |
\ctikzset{bipoles/varistor/main/.initial=.7} |
| 90 |
\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7 |
| 91 |
\ctikzset{bipoles/varistor/width/.initial=.8} |
| 92 |
\ctikzset{bipoles/generic/height/.initial=.30} |
| 93 |
\ctikzset{bipoles/generic/width/.initial=.80} |
| 94 |
\ctikzset{bipoles/generic potentiometer/height/.initial=.80} |
| 95 |
\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30} |
| 96 |
\ctikzset{bipoles/generic potentiometer/width/.initial=.80} |
| 97 |
\ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5} |
| 98 |
\ctikzset{bipoles/ageneric/height/.initial=.30} |
| 99 |
\ctikzset{bipoles/tgeneric/height/.initial=.70} |
| 100 |
\ctikzset{bipoles/tgeneric/width/.initial=.80} |
| 101 |
\ctikzset{bipoles/ageneric/width/.initial=.80} |
| 102 |
\ctikzset{bipoles/memristor/height/.initial=.30} |
| 103 |
\ctikzset{bipoles/memristor/wave height/.initial=.5} |
| 104 |
\ctikzset{bipoles/memristor/width/.initial=.80} |
| 105 |
\ctikzset{bipoles/ldgeneric/height/.initial=.8} |
| 106 |
\ctikzset{bipoles/ldgeneric/width/.initial=.8} |
| 107 |
\ctikzset{bipoles/ldgeneric/internal scale/.initial=.8} |
| 108 |
|
| 109 |
\newif\ifpgf@circuit@europeanresistor |
| 110 |
\ctikzset{resistor/.is choice} |
| 111 |
\ctikzset{resistor/american/.code = \pgf@circuit@europeanresistorfalse } |
| 112 |
\ctikzset{resistor/european/.code = \pgf@circuit@europeanresistortrue } |
| 113 |
\tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}} |
| 114 |
\tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}% |
| 115 |
|
| 116 |
% wires (open, shorts, ...) |
| 117 |
|
| 118 |
\ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages |
| 119 |
\ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages |
| 120 |
\ctikzset{bipoles/open/voltage/straight label distance/.initial=0} |
| 121 |
\ctikzset{bipoles/open/voltage/distance from node/.initial=.2} |
| 122 |
\ctikzset{bipoles/short/height/.initial=.1} %dummy height for voltage positioning |
| 123 |
\ctikzset{bipoles/short/width/.initial=.1} %dummy width for voltage positioning |
| 124 |
% multiwire |
| 125 |
\ctikzset{bipoles/multiwire/height/.initial=0.4} |
| 126 |
\ctikzset{bipoles/multiwire/width/.initial=0.2} |
| 127 |
\ctikzset{bipoles/multiwire/spacing/.initial=0.05} |
| 128 |
% crossing wires |
| 129 |
\ctikzset{bipoles/crossing/size/.initial=.2} |
| 130 |
|
| 131 |
%%>>> |
| 132 |
|
| 133 |
%% Shapes for generic, resistives and wires components %<<< |
| 134 |
%% Short circuit |
| 135 |
|
| 136 |
%%% NOTICE that the short is really NOT drawn; we trust the fact that its |
| 137 |
%%% natural length is zero. |
| 138 |
\pgfcircdeclarebipole |
| 139 |
{% fix the anchor border to add a bit of space for voltage and labels |
| 140 |
% it uses the dummy width and height |
| 141 |
\anchorborder{% |
| 142 |
\ifpgf@circuit@bipole@inverted |
| 143 |
\pgf@circ@res@left=-\pgf@x |
| 144 |
\pgf@circ@res@up=-\pgf@y |
| 145 |
\else |
| 146 |
\pgf@circ@res@left=\pgf@x |
| 147 |
\pgf@circ@res@up=\pgf@y |
| 148 |
\fi |
| 149 |
\ifdim\pgf@circ@res@up>0cm |
| 150 |
\pgf@x=\ctikzvalof{bipoles/short/width}\pgf@circ@Rlen |
| 151 |
\pgf@y=\ctikzvalof{bipoles/short/height}\pgf@circ@Rlen |
| 152 |
\pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 153 |
{\pgfpoint{\pgf@x}{\pgf@y}} |
| 154 |
\else |
| 155 |
\pgf@x=-\ctikzvalof{bipoles/short/width}\pgf@circ@Rlen |
| 156 |
\pgf@y=-\ctikzvalof{bipoles/short/height}\pgf@circ@Rlen |
| 157 |
\pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 158 |
{\pgfpoint{-\pgf@x}{-\pgf@y}} |
| 159 |
\fi |
| 160 |
} |
| 161 |
} |
| 162 |
{0} |
| 163 |
{short} |
| 164 |
{0} |
| 165 |
{0} |
| 166 |
{} |
| 167 |
|
| 168 |
%% Open circuit |
| 169 |
\pgfcircdeclarebipole |
| 170 |
{} |
| 171 |
{\ctikzvalof{bipoles/open/height}} |
| 172 |
{open} |
| 173 |
{\ctikzvalof{bipoles/open/height}} |
| 174 |
{\ctikzvalof{bipoles/open/width}} |
| 175 |
{} |
| 176 |
|
| 177 |
% multiwire(s) |
| 178 |
\pgfcircdeclarebipole |
| 179 |
{} |
| 180 |
{\ctikzvalof{bipoles/multiwire/height}} |
| 181 |
{multiwire} |
| 182 |
{\ctikzvalof{bipoles/multiwire/height}} |
| 183 |
{\ctikzvalof{bipoles/multiwire/width}} |
| 184 |
{ |
| 185 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 186 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 187 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 188 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 189 |
\pgfusepath{draw} |
| 190 |
} |
| 191 |
|
| 192 |
\pgfcircdeclarebipole |
| 193 |
{} |
| 194 |
{\ctikzvalof{bipoles/multiwire/height}} |
| 195 |
{bmultiwire} |
| 196 |
{\ctikzvalof{bipoles/multiwire/height}} |
| 197 |
{\ctikzvalof{bipoles/multiwire/width}} |
| 198 |
{ |
| 199 |
\pgf@circ@res@other=\ctikzvalof{bipoles/multiwire/spacing}\pgf@circ@Rlen |
| 200 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 201 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 202 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 203 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 204 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 205 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 206 |
\pgfusepath{draw} |
| 207 |
} |
| 208 |
|
| 209 |
\pgfcircdeclarebipole |
| 210 |
{} |
| 211 |
{\ctikzvalof{bipoles/multiwire/height}} |
| 212 |
{tmultiwire} |
| 213 |
{\ctikzvalof{bipoles/multiwire/height}} |
| 214 |
{\ctikzvalof{bipoles/multiwire/width}} |
| 215 |
{ |
| 216 |
\pgf@circ@res@other=\ctikzvalof{bipoles/multiwire/spacing}\pgf@circ@Rlen |
| 217 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 218 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 219 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 220 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 221 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+2\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 222 |
\pgfpathlineto{\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 223 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 224 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 225 |
\pgfusepath{draw} |
| 226 |
} |
| 227 |
|
| 228 |
%%%%%%%%%%%%%%%% |
| 229 |
%% Crossing |
| 230 |
%%%%%%%%%%%%%%%% |
| 231 |
|
| 232 |
%% crossing bipole (but see also nodes) |
| 233 |
\pgfcircdeclarebipole |
| 234 |
{} |
| 235 |
{\ctikzvalof{bipoles/crossing/size}} |
| 236 |
{crossing} |
| 237 |
{\ctikzvalof{bipoles/crossing/size}} |
| 238 |
{\ctikzvalof{bipoles/crossing/size}}{ |
| 239 |
\pgfscope |
| 240 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 241 |
\pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 242 |
\pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left} |
| 243 |
\pgfsetbeveljoin |
| 244 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 245 |
\pgfusepath{draw} |
| 246 |
\endpgfscope |
| 247 |
} |
| 248 |
% |
| 249 |
% |
| 250 |
%% Generic bipole - used as resistor by some |
| 251 |
\pgfcircdeclarebipolescaled{resistors} |
| 252 |
{} |
| 253 |
{\ctikzvalof{bipoles/generic/height}} |
| 254 |
{generic} |
| 255 |
{\ctikzvalof{bipoles/generic/height}} |
| 256 |
{\ctikzvalof{bipoles/generic/width}} |
| 257 |
{ |
| 258 |
% \pgf@circ@debug@colors |
| 259 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 260 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 261 |
\pgf@circ@draworfill |
| 262 |
} |
| 263 |
|
| 264 |
% |
| 265 |
% generic crossed, suggested by Radványi Patrik Tamás <[email protected]> |
| 266 |
% inherit "generic" properties |
| 267 |
% |
| 268 |
\pgfcircdeclarebipolescaled{resistors} |
| 269 |
{} |
| 270 |
{\ctikzvalof{bipoles/generic/height}} |
| 271 |
{xgeneric} |
| 272 |
{\ctikzvalof{bipoles/generic/height}} |
| 273 |
{\ctikzvalof{bipoles/generic/width}} |
| 274 |
{ |
| 275 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 276 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 277 |
\pgf@circ@draworfill |
| 278 |
% cross it |
| 279 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 280 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 281 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 282 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 283 |
\pgfusepath{draw} |
| 284 |
} |
| 285 |
% |
| 286 |
% generic slashed, suggested by Jana on TeX.stackexchange.com |
| 287 |
% https://tex.stackexchange.com/questions/711702/european-relay-with-circuitikz |
| 288 |
% inherit "generic" properties |
| 289 |
% |
| 290 |
\pgfcircdeclarebipolescaled{resistors} |
| 291 |
{} |
| 292 |
{\ctikzvalof{bipoles/generic/height}} |
| 293 |
{sgeneric} |
| 294 |
{\ctikzvalof{bipoles/generic/height}} |
| 295 |
{\ctikzvalof{bipoles/generic/width}} |
| 296 |
{ |
| 297 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 298 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 299 |
\pgf@circ@draworfill |
| 300 |
% slash it |
| 301 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 302 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 303 |
\pgfusepath{draw} |
| 304 |
} |
| 305 |
|
| 306 |
%% generic with sine wave |
| 307 |
\pgfcircdeclarebipolescaled{resistors} |
| 308 |
{} |
| 309 |
{\ctikzvalof{bipoles/generic/height}} |
| 310 |
{singeneric} |
| 311 |
{\ctikzvalof{bipoles/generic/height}} |
| 312 |
{\ctikzvalof{bipoles/generic/width}} |
| 313 |
{ |
| 314 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 315 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 316 |
\pgf@circ@draworfill |
| 317 |
% sine |
| 318 |
\pgfscope |
| 319 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 320 |
\pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{0cm}} |
| 321 |
\pgfpathsine{\pgfpoint{.4\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 322 |
\pgfpathcosine{\pgfpoint{.4\pgf@circ@res@right}{-.5\pgf@circ@res@up}} |
| 323 |
\pgfpathsine{\pgfpoint{.4\pgf@circ@res@right}{-.5\pgf@circ@res@up}} |
| 324 |
\pgfpathcosine{\pgfpoint{.4\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 325 |
\pgfusepath{draw} |
| 326 |
\endpgfscope |
| 327 |
} |
| 328 |
|
| 329 |
%% Generic empty tunable |
| 330 |
\pgfcircdeclarebipolescaled{resistors} |
| 331 |
{ |
| 332 |
\anchor{wiper}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} |
| 333 |
\anchor{W}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} |
| 334 |
\anchor{tip}{\northeast\pgf@x=0.5\pgf@x} |
| 335 |
} |
| 336 |
{\ctikzvalof{bipoles/tgeneric/height}} |
| 337 |
{tgeneric} |
| 338 |
{\ctikzvalof{bipoles/tgeneric/height}} |
| 339 |
{\ctikzvalof{bipoles/tgeneric/width}} |
| 340 |
{ |
| 341 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}} |
| 342 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 343 |
\pgf@circ@draworfill |
| 344 |
\pgfscope |
| 345 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 346 |
\pgfcirc@set@arrows{tunable}{}{latexslim} |
| 347 |
\ifpgf@circ@fixtunable@dir |
| 348 |
\pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 349 |
\pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 350 |
\else |
| 351 |
\pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 352 |
\pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 353 |
\fi |
| 354 |
\pgfusepath{draw} |
| 355 |
\endpgfscope |
| 356 |
} |
| 357 |
|
| 358 |
%% Generic asymmetric bipole |
| 359 |
\pgfcircdeclarebipolescaled{resistors} |
| 360 |
{} |
| 361 |
{\ctikzvalof{bipoles/ageneric/height}} |
| 362 |
{ageneric} |
| 363 |
{\ctikzvalof{bipoles/ageneric/height}} |
| 364 |
{\ctikzvalof{bipoles/ageneric/width}} |
| 365 |
{ |
| 366 |
\pgfscope |
| 367 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 368 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 369 |
\pgf@circ@draworfill |
| 370 |
\endpgfscope |
| 371 |
|
| 372 |
\pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 373 |
\pgfusepath{stroke,fill} |
| 374 |
} |
| 375 |
|
| 376 |
%% Memristor |
| 377 |
\pgfcircdeclarebipolescaled{resistors} |
| 378 |
{} |
| 379 |
{\ctikzvalof{bipoles/memristor/height}} |
| 380 |
{memristor} |
| 381 |
{\ctikzvalof{bipoles/memristor/height}} |
| 382 |
{\ctikzvalof{bipoles/memristor/width}} |
| 383 |
{ |
| 384 |
\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen |
| 385 |
\divide \pgf@circ@res@step by 14 |
| 386 |
|
| 387 |
\pgfscope |
| 388 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 389 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 390 |
\pgf@circ@draworfill |
| 391 |
\endpgfscope |
| 392 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 393 |
\pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{0pt}} |
| 394 |
\pgfpathlineto{\pgfpoint{.72*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} |
| 395 |
\pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} |
| 396 |
\pgfpathlineto{\pgfpoint{.35*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} |
| 397 |
\pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{-\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} |
| 398 |
\pgfpathlineto{\pgfpoint{-.05*\pgf@circ@res@left}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} |
| 399 |
\pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{\ctikzvalof{bipoles/memristor/wave height}\pgf@circ@res@up}} |
| 400 |
\pgfpathlineto{\pgfpoint{.42*\pgf@circ@res@right}{0pt}} |
| 401 |
\pgfpathlineto{\pgfpoint{.8*\pgf@circ@res@right}{0pt}} |
| 402 |
|
| 403 |
\pgfusepath{draw} |
| 404 |
|
| 405 |
\pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 406 |
\pgfusepath{stroke,fill} |
| 407 |
} |
| 408 |
|
| 409 |
%% Photoresistor |
| 410 |
\pgfcircdeclarebipolescaled{resistors} |
| 411 |
{% anchor for light arrows |
| 412 |
\anchor{arrows}{\northeast\pgf@x=0.575\pgf@x\pgf@y=1.1\pgf@y}% |
| 413 |
} |
| 414 |
{\ctikzvalof{bipoles/photoresistor/height 2}} |
| 415 |
{photoresistor} |
| 416 |
{\ctikzvalof{bipoles/photoresistor/height}} |
| 417 |
{\ctikzvalof{bipoles/photoresistor/width}} |
| 418 |
{ |
| 419 |
\pgfscope |
| 420 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@down}} |
| 421 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 422 |
\pgf@circ@draworfill |
| 423 |
\endpgfscope |
| 424 |
|
| 425 |
\pgfscope |
| 426 |
\pgf@circ@set@optoarrow@style |
| 427 |
\pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 428 |
\pgfpathlineto{\pgfpoint{.3\pgf@circ@res@right}{-1.2\pgf@circ@res@down}} |
| 429 |
\pgfusepath{draw} |
| 430 |
\pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 431 |
\pgfpathlineto{\pgfpoint{.05\pgf@circ@res@right}{-1.2\pgf@circ@res@down}} |
| 432 |
\pgfusepath{draw} |
| 433 |
\endpgfscope |
| 434 |
} |
| 435 |
|
| 436 |
|
| 437 |
|
| 438 |
%% Thermistor |
| 439 |
\pgfcircdeclarebipolescaled{resistors} |
| 440 |
{% anchor for labelling the type of dependency |
| 441 |
\anchor{label}{% |
| 442 |
\southwest |
| 443 |
\pgf@x=0.4\pgf@x |
| 444 |
\pgf@y=1.2\pgf@y |
| 445 |
}% |
| 446 |
\pgfcirc@border@extend@updown{1}{1.2} |
| 447 |
\anchor{wiper}{\northeast\pgf@x=-\pgf@x\pgf@y=-1.2\pgf@y} |
| 448 |
\anchor{W}{\northeast\pgf@x=-\pgf@x\pgf@y=-1.2\pgf@y} |
| 449 |
\anchor{tip}{\northeast} |
| 450 |
} |
| 451 |
{\ctikzvalof{bipoles/thermistor/height}} |
| 452 |
{thermistor} |
| 453 |
{\ctikzvalof{bipoles/thermistor/height}} |
| 454 |
{\ctikzvalof{bipoles/thermistor/width}} |
| 455 |
{ |
| 456 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistor/main}\pgf@circ@res@up}} |
| 457 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 458 |
\pgf@circ@draworfill |
| 459 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 460 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}} |
| 461 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{1.2\pgf@circ@res@down}} |
| 462 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.2\pgf@circ@res@down}} |
| 463 |
\pgfusepath{draw} |
| 464 |
} |
| 465 |
|
| 466 |
%% Thermistor PTC |
| 467 |
\pgfcircdeclarebipolescaled{resistors} |
| 468 |
{} |
| 469 |
{\ctikzvalof{bipoles/thermistorptc/height 2}} |
| 470 |
{thermistorptc} |
| 471 |
{\ctikzvalof{bipoles/thermistorptc/height}} |
| 472 |
{\ctikzvalof{bipoles/thermistorptc/width}} |
| 473 |
{ |
| 474 |
\pgfscope |
| 475 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorptc/main}\pgf@circ@res@up}} |
| 476 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 477 |
\pgf@circ@draworfill |
| 478 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 479 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 480 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}} |
| 481 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}} |
| 482 |
\pgfusepath{draw} |
| 483 |
\endpgfscope |
| 484 |
|
| 485 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 486 |
\pgfsetarrowsend{latexslim} |
| 487 |
\pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 488 |
\pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} |
| 489 |
\pgfusepath{draw} |
| 490 |
\pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 491 |
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} |
| 492 |
\pgfusepath{draw} |
| 493 |
\pgf@circ@text@strokecolor |
| 494 |
\pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} |
| 495 |
} |
| 496 |
|
| 497 |
%% Thermistor NTC |
| 498 |
\pgfcircdeclarebipolescaled{resistors} |
| 499 |
{} |
| 500 |
{\ctikzvalof{bipoles/thermistorntc/height 2}} |
| 501 |
{thermistorntc} |
| 502 |
{\ctikzvalof{bipoles/thermistorntc/height}} |
| 503 |
{\ctikzvalof{bipoles/thermistorntc/width}} |
| 504 |
{ |
| 505 |
\pgfscope |
| 506 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up}} |
| 507 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 508 |
\pgf@circ@draworfill |
| 509 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 510 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 511 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}} |
| 512 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}} |
| 513 |
\pgfusepath{draw} |
| 514 |
\endpgfscope |
| 515 |
|
| 516 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 517 |
\pgfsetarrowsend{latexslim} |
| 518 |
\pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 519 |
\pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} |
| 520 |
\pgfusepath{draw} |
| 521 |
\pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} |
| 522 |
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 523 |
\pgfusepath{draw} |
| 524 |
\pgf@circ@text@strokecolor |
| 525 |
\pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} |
| 526 |
} |
| 527 |
|
| 528 |
%% Varistor |
| 529 |
\pgfcircdeclarebipolescaled{resistors} |
| 530 |
{ |
| 531 |
\pgfcirc@border@extend@updown{1}{1.4} |
| 532 |
} |
| 533 |
{\ctikzvalof{bipoles/varistor/height}} |
| 534 |
{varistor} |
| 535 |
{\ctikzvalof{bipoles/varistor/height}} |
| 536 |
{\ctikzvalof{bipoles/varistor/width}} |
| 537 |
{ |
| 538 |
\pgfscope |
| 539 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}} |
| 540 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 541 |
\pgf@circ@draworfill |
| 542 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 543 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@down}} |
| 544 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 545 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 546 |
\pgfusepath{draw} |
| 547 |
\endpgfscope |
| 548 |
\pgf@circ@text@strokecolor |
| 549 |
\pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}} |
| 550 |
} |
| 551 |
%% MOV |
| 552 |
\pgfcircdeclarebipolescaled{resistors} |
| 553 |
{ |
| 554 |
\pgfcirc@border@extend@updown{1.2}{1.2} |
| 555 |
} |
| 556 |
{\ctikzvalof{bipoles/varistor/height}} |
| 557 |
{mov} |
| 558 |
{\ctikzvalof{bipoles/varistor/height}} |
| 559 |
{\ctikzvalof{bipoles/varistor/width}} |
| 560 |
{ |
| 561 |
\pgfscope |
| 562 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{-\ctikzvalof{bipoles/varistor/main}\pgf@circ@res@up}} |
| 563 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 564 |
\pgf@circ@draworfill |
| 565 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 566 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-1.1\pgf@circ@res@down}} |
| 567 |
\pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@left}{-1.1\pgf@circ@res@down}} |
| 568 |
\pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@left}{1.1\pgf@circ@res@down}} |
| 569 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{1.1\pgf@circ@res@down}} |
| 570 |
\pgfusepath{draw} |
| 571 |
\endpgfscope |
| 572 |
} |
| 573 |
%% Generic tunable |
| 574 |
\pgfcircdeclarebipolescaled{resistors} |
| 575 |
{ |
| 576 |
\savedanchor{\wiper}{ |
| 577 |
\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen |
| 578 |
\pgf@ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf@circ@scaled@Rlen |
| 579 |
\pgf@y=.5\pgf@ya |
| 580 |
\pgf@xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf@circ@scaled@Rlen |
| 581 |
\pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}-0.5)*\pgf@xa} |
| 582 |
} |
| 583 |
\anchor{wiper}{\wiper} |
| 584 |
\anchor{W}{\wiper} |
| 585 |
\anchor{tip}{\wiper\pgf@xa=\pgf@x\southwest\pgf@x=\pgf@xa\pgf@y=-\pgf@y} |
| 586 |
} |
| 587 |
{\ctikzvalof{bipoles/generic potentiometer/height 2}} |
| 588 |
{genericpotentiometer} |
| 589 |
{\ctikzvalof{bipoles/generic potentiometer/height}} |
| 590 |
{\ctikzvalof{bipoles/generic potentiometer/width}} |
| 591 |
{ |
| 592 |
|
| 593 |
\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@scaled@Rlen |
| 594 |
\divide \pgf@circ@res@step by 14 |
| 595 |
|
| 596 |
\pgfscope |
| 597 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 598 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 599 |
\pgf@circ@draworfill |
| 600 |
\endpgfscope |
| 601 |
\pgfscope |
| 602 |
%\pgfsetlinewidth{\pgfstartlinewidth} |
| 603 |
\pgfcirc@set@arrows{wiper}{}{latexslim} |
| 604 |
\pgfextractx{\pgf@circ@res@other}{\wiper} |
| 605 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 606 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} |
| 607 |
\pgfusepath{draw} |
| 608 |
\endpgfscope |
| 609 |
} |
| 610 |
|
| 611 |
%% european style LDR |
| 612 |
\pgfcircdeclarebipolescaled{resistors} |
| 613 |
{% anchor for light arrows |
| 614 |
\anchor{arrows}{\northeast\pgf@x=1.6\pgf@x\pgf@y=1.4\pgf@y}% |
| 615 |
\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} |
| 616 |
} |
| 617 |
{\ctikzvalof{bipoles/ldgeneric/height}} |
| 618 |
{ldgeneric} |
| 619 |
{\ctikzvalof{bipoles/ldgeneric/height}} |
| 620 |
{\ctikzvalof{bipoles/ldgeneric/width}} |
| 621 |
{% |
| 622 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 623 |
\pgfscope |
| 624 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 625 |
\pgf@circ@draworfill |
| 626 |
\endpgfscope |
| 627 |
\pgfscope |
| 628 |
% arrows |
| 629 |
\pgf@circ@set@optoarrow@style |
| 630 |
\pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{1.4\pgf@circ@res@up}} |
| 631 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{0.8\pgf@circ@res@up}} |
| 632 |
\pgfusepath{draw} |
| 633 |
\pgfpathmoveto{\pgfpoint{1.6\pgf@circ@res@right}{1.2\pgf@circ@res@up}} |
| 634 |
\pgfpathlineto{\pgfpoint{1.0\pgf@circ@res@right}{0.6\pgf@circ@res@up}} |
| 635 |
\pgfusepath{draw} |
| 636 |
\endpgfscope |
| 637 |
\edef\@@intscale{\ctikzvalof{bipoles/ldgeneric/internal scale}}% |
| 638 |
\pgfmathsetmacro{\@@hscale}{0.5*\@@intscale}% |
| 639 |
\pgftransformscale{\@@intscale}% the end of the bipole will deactivate it |
| 640 |
% the generic will be reduced by @@intscale; let's undo the scaling to |
| 641 |
% connect the leads to the end of the component. |
| 642 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left/\@@intscale-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 643 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 644 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 645 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 646 |
\pgftransformationadjustments |
| 647 |
\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldgeneric/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth} |
| 648 |
\pgfusepath{draw} |
| 649 |
\pgfscope |
| 650 |
% reset the up at the "generic" thing |
| 651 |
\pgf@circ@res@up=\ctikzvalof{bipoles/generic/height}\pgf@circ@scaled@Rlen |
| 652 |
\pgf@circ@res@up=0.5\pgf@circ@res@up |
| 653 |
\pgf@circ@res@down=-\pgf@circ@res@up |
| 654 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 655 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 656 |
\pgfusepath{draw} |
| 657 |
\endpgfscope |
| 658 |
}% |
| 659 |
%% Zig-zag resistors |
| 660 |
% see https://github.com/circuitikz/circuitikz/discussions/814 |
| 661 |
\ctikzset{resistors/zigzag stub/.initial=0} |
| 662 |
\ctikzset{resistors/zigzag hook/.code={}} |
| 663 |
\def\pgf@circ@zigzag#1{% |
| 664 |
\pgf@circ@res@temp=\ctikzvalof{resistors/zigzag stub}\pgf@circ@res@step |
| 665 |
\advance \pgf@circ@res@step by -2\pgf@circ@res@temp |
| 666 |
\divide \pgf@circ@res@step by \numexpr4*\zigs\relax |
| 667 |
|
| 668 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} |
| 669 |
\ifdim\pgf@circ@res@temp>0pt |
| 670 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp -\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} |
| 671 |
\fi |
| 672 |
\pgf@circ@res@other = \pgf@circ@res@left |
| 673 |
\advance\pgf@circ@res@other by \pgf@circ@res@temp |
| 674 |
\pgf@circ@count@a=\zigs\relax |
| 675 |
% first half zig |
| 676 |
\advance\pgf@circ@res@other by \pgf@circ@res@step |
| 677 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}} |
| 678 |
\pgfmathloop% |
| 679 |
\advance\pgf@circ@count@a by -1\relax% Loop zigs -1 times |
| 680 |
\ifnum\pgf@circ@count@a>0 |
| 681 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 682 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}} |
| 683 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 684 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-#1\pgf@circ@res@down}} |
| 685 |
\repeatpgfmathloop% |
| 686 |
% last zig and a half |
| 687 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 688 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}} |
| 689 |
\advance\pgf@circ@res@other by \pgf@circ@res@step |
| 690 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} |
| 691 |
\ifdim\pgf@circ@res@temp>0pt |
| 692 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other+\pgf@circ@res@temp+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} |
| 693 |
\fi |
| 694 |
\pgfsetbeveljoin |
| 695 |
\pgfkeys{/tikz/circuitikz/resistors/zigzag hook} |
| 696 |
\pgfusepath{draw} |
| 697 |
} |
| 698 |
%% Resistor |
| 699 |
\pgfcircdeclarebipolescaled{resistors} |
| 700 |
{ |
| 701 |
\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} |
| 702 |
} |
| 703 |
{\ctikzvalof{bipoles/resistor/height}} |
| 704 |
{resistor} |
| 705 |
{\ctikzvalof{bipoles/resistor/height}} |
| 706 |
{\ctikzvalof{bipoles/resistor/width}} |
| 707 |
{ |
| 708 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 709 |
\pgftransformationadjustments |
| 710 |
\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen} |
| 711 |
\pgf@circ@zigzag{1} |
| 712 |
} |
| 713 |
|
| 714 |
|
| 715 |
%% Variable resistor |
| 716 |
\pgfcircdeclarebipolescaled{resistors} |
| 717 |
{ |
| 718 |
\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} |
| 719 |
\anchor{wiper}{\northeast\pgf@x=-0.4\pgf@x\pgf@y=-\pgf@y} |
| 720 |
\anchor{W}{\northeast\pgf@x=-0.4\pgf@x\pgf@y=-\pgf@y} |
| 721 |
\anchor{tip}{\northeast\pgf@x=0.4\pgf@x} |
| 722 |
} |
| 723 |
{\ctikzvalof{bipoles/vresistor/height}} |
| 724 |
{vresistor} |
| 725 |
{\ctikzvalof{bipoles/vresistor/height}} |
| 726 |
{\ctikzvalof{bipoles/vresistor/width}} |
| 727 |
{ |
| 728 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 729 |
\pgftransformationadjustments |
| 730 |
\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen} |
| 731 |
\pgf@circ@zigzag{.5} |
| 732 |
|
| 733 |
\pgfscope |
| 734 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 735 |
\pgfcirc@set@arrows{tunable}{}{latexslim} |
| 736 |
\ifpgf@circ@fixtunable@dir |
| 737 |
\pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 738 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 739 |
\else |
| 740 |
\pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 741 |
\pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 742 |
\fi |
| 743 |
\pgfusepath{draw} |
| 744 |
\endpgfscope |
| 745 |
} |
| 746 |
|
| 747 |
%% Potentiometer |
| 748 |
\pgfcircdeclarebipolescaled{resistors} |
| 749 |
{ |
| 750 |
\savedanchor{\wiper}{ |
| 751 |
\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen |
| 752 |
\pgf@ya=\ctikzvalof{bipoles/potentiometer/height}\pgf@circ@scaled@Rlen |
| 753 |
\pgf@y=.5\pgf@ya |
| 754 |
\pgf@xa=\ctikzvalof{bipoles/potentiometer/width}\pgf@circ@scaled@Rlen |
| 755 |
\pgfmathsetlength{\pgf@x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}-0.5)*\pgf@xa} |
| 756 |
} |
| 757 |
\anchor{wiper}{\wiper} |
| 758 |
\anchor{W}{\wiper} |
| 759 |
\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} |
| 760 |
\anchor{tip}{\wiper\pgf@xa=\pgf@x\southwest\pgf@x=\pgf@xa\pgf@y=-\pgf@y} |
| 761 |
} |
| 762 |
{\ctikzvalof{bipoles/potentiometer/height 2}} |
| 763 |
{potentiometer} |
| 764 |
{\ctikzvalof{bipoles/potentiometer/height}} |
| 765 |
{\ctikzvalof{bipoles/potentiometer/width}} |
| 766 |
{ |
| 767 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 768 |
\pgftransformationadjustments |
| 769 |
\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen} |
| 770 |
\pgf@circ@zigzag{1} |
| 771 |
|
| 772 |
\pgfscope |
| 773 |
%\pgfsetlinewidth{\pgfstartlinewidth} |
| 774 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 775 |
\pgfcirc@set@arrows{wiper}{}{latexslim} |
| 776 |
\pgfextractx{\pgf@circ@res@other}{\wiper} |
| 777 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 778 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} |
| 779 |
\pgfusepath{draw} |
| 780 |
\endpgfscope |
| 781 |
} |
| 782 |
|
| 783 |
%% Resistive sensor |
| 784 |
\pgfcircdeclarebipolescaled{resistors} |
| 785 |
{% anchor for labelling the type of dependency |
| 786 |
\anchor{label}{\southwest\pgf@x=0.4\pgf@x}% |
| 787 |
\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} |
| 788 |
\anchor{wiper}{\northeast\pgf@x=-0.9\pgf@x\pgf@y=-\pgf@y} |
| 789 |
\anchor{W}{\northeast\pgf@x=-0.9\pgf@x\pgf@y=-\pgf@y} |
| 790 |
\anchor{tip}{\northeast\pgf@x=0.4\pgf@x} |
| 791 |
} |
| 792 |
{\ctikzvalof{bipoles/resistivesens/height}} |
| 793 |
{resistivesens} |
| 794 |
{\ctikzvalof{bipoles/resistivesens/height}} |
| 795 |
{\ctikzvalof{bipoles/resistivesens/width}} |
| 796 |
{% |
| 797 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 798 |
\pgftransformationadjustments |
| 799 |
\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen} |
| 800 |
\pgf@circ@zigzag{.5} |
| 801 |
|
| 802 |
\pgfscope |
| 803 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 804 |
\pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 805 |
\pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 806 |
\pgfpathlineto{\pgfpoint{-.9\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 807 |
\pgfusepath{draw} |
| 808 |
\endpgfscope |
| 809 |
}% |
| 810 |
|
| 811 |
%% american style LDR |
| 812 |
\pgfcircdeclarebipolescaled{resistors} |
| 813 |
{% anchor for light arrows |
| 814 |
\anchor{arrows}{\northeast\pgf@x=1.6\pgf@x\pgf@y=1.4\pgf@y}% |
| 815 |
\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}} |
| 816 |
% \pgfcirc@border@extend@full{1.2}{1.2}{1.2}{1.2} |
| 817 |
} |
| 818 |
{\ctikzvalof{bipoles/ldresistor/height}} |
| 819 |
{ldresistor} |
| 820 |
{\ctikzvalof{bipoles/ldresistor/height}} |
| 821 |
{\ctikzvalof{bipoles/ldresistor/width}} |
| 822 |
{% |
| 823 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 824 |
\pgfscope |
| 825 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 826 |
\pgf@circ@draworfill |
| 827 |
\endpgfscope |
| 828 |
\pgfscope |
| 829 |
% arrows |
| 830 |
\pgf@circ@set@optoarrow@style |
| 831 |
\pgfpathmoveto{\pgfpoint{1.4\pgf@circ@res@right}{1.4\pgf@circ@res@up}} |
| 832 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{0.8\pgf@circ@res@up}} |
| 833 |
\pgfusepath{draw} |
| 834 |
\pgfpathmoveto{\pgfpoint{1.6\pgf@circ@res@right}{1.2\pgf@circ@res@up}} |
| 835 |
\pgfpathlineto{\pgfpoint{1.0\pgf@circ@res@right}{0.6\pgf@circ@res@up}} |
| 836 |
\pgfusepath{draw} |
| 837 |
\endpgfscope |
| 838 |
\edef\@@intscale{\ctikzvalof{bipoles/ldresistor/internal scale}}% |
| 839 |
\pgfmathsetmacro{\@@hscale}{0.5*\@@intscale}% |
| 840 |
\pgftransformscale{\@@intscale}% the end of the bipole will deactivate it |
| 841 |
% the zigzag will be reduced by @@intscale; let's undo the scaling to |
| 842 |
% connect the leads to the end of the component. |
| 843 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left/\@@intscale-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 844 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 845 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 846 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} |
| 847 |
\pgftransformationadjustments |
| 848 |
\pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldresistor/width}*\scaledRlen} |
| 849 |
\pgf@circ@zigzag{\@@hscale} |
| 850 |
}% |
| 851 |
|
| 852 |
|
| 853 |
%>>> |
| 854 |
|
| 855 |
%% Paths for resistive components: generic, resistors and wires% %<<< |
| 856 |
|
| 857 |
%% GENERICS |
| 858 |
\def\pgf@circ@empty@path#1{} |
| 859 |
\pgfcirc@activate@bipole@simple{l}{generic} |
| 860 |
\pgfcirc@activate@bipole@simple{l}{ageneric} |
| 861 |
\pgfcirc@activate@bipole@simple{l}{tgeneric} |
| 862 |
\pgfcirc@activate@bipole@simple{l}{xgeneric} |
| 863 |
\pgfcirc@activate@bipole@simple{l}{sgeneric} |
| 864 |
\pgfcirc@activate@bipole@simple{l}{singeneric} |
| 865 |
\pgfcirc@activate@bipole@simple{l}{fullgeneric} |
| 866 |
\pgfcirc@activate@bipole@simple{l}{tfullgeneric} |
| 867 |
\pgfcirc@activate@bipole@simple{l}{short} |
| 868 |
\pgfcirc@activate@bipole@simple{l}{open} |
| 869 |
|
| 870 |
%% wires and crossings |
| 871 |
|
| 872 |
\pgfcirc@activate@bipole@simple{l}{crossing} |
| 873 |
\pgfcirc@style@to@style{crossing}{xing} |
| 874 |
\pgfcirc@activate@bipole@simple{l}{multiwire} |
| 875 |
\pgfcirc@activate@bipole@simple{l}{bmultiwire} |
| 876 |
\pgfcirc@activate@bipole@simple{l}{tmultiwire} |
| 877 |
|
| 878 |
% automatically switching path --- to be defined manually |
| 879 |
\def\pgf@circ@resistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{generic}{#1}\else\pgf@circ@bipole@path{resistor}{#1}\fi} |
| 880 |
\pgfcirc@path@to@style{l}{resistor}{resistor}{} |
| 881 |
\pgfcirc@node@to@style{l}{resistor}{american resistor}{} |
| 882 |
\pgfcirc@node@to@style{l}{generic}{european resistor}{} |
| 883 |
\pgfcirc@style@to@style{resistor}{R} |
| 884 |
|
| 885 |
\def\pgf@circ@vresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{tgeneric}{#1}\else\pgf@circ@bipole@path{vresistor}{#1}\fi} |
| 886 |
\pgfcirc@path@to@style{l}{vresistor}{variable resistor}{} |
| 887 |
\pgfcirc@node@to@style{l}{vresistor}{variable american resistor}{} |
| 888 |
\pgfcirc@node@to@style{l}{tgeneric}{variable european resistor}{} |
| 889 |
\pgfcirc@style@to@style{variable resistor}{vR} |
| 890 |
|
| 891 |
\def\pgf@circ@resistivesens@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{thermistor}{#1}\else\pgf@circ@bipole@path{resistivesens}{#1}\fi} |
| 892 |
\pgfcirc@path@to@style{l}{resistivesens}{resistive sensor}{} |
| 893 |
\pgfcirc@node@to@style{l}{resistivesens}{american resistive sensor}{} |
| 894 |
\pgfcirc@node@to@style{l}{thermistor}{european resistive sensor}{} |
| 895 |
\pgfcirc@style@to@style{resistive sensor}{sR} |
| 896 |
|
| 897 |
\def\pgf@circ@ldresistor@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{ldgeneric}{#1}\else\pgf@circ@bipole@path{ldresistor}{#1}\fi} |
| 898 |
\pgfcirc@path@to@style{l}{ldresistor}{light dependent resistor}{} |
| 899 |
\pgfcirc@node@to@style{l}{ldresistor}{american light dependent resistor}{} |
| 900 |
\pgfcirc@node@to@style{l}{ldgeneric}{european light dependent resistor}{} |
| 901 |
\pgfcirc@style@to@style{light dependent resistor}{ldR} |
| 902 |
|
| 903 |
\def\pgf@circ@potentiometer@path#1{\ifpgf@circuit@europeanresistor\pgf@circ@bipole@path{genericpotentiometer}{#1}\else\pgf@circ@bipole@path{potentiometer}{#1}\fi} |
| 904 |
\pgfcirc@path@to@style{l}{potentiometer}{potentiometer}{} |
| 905 |
\pgfcirc@node@to@style{l}{potentiometer}{american potentiometer}{} |
| 906 |
\pgfcirc@node@to@style{l}{genericpotentiometer}{european potentiometer}{} |
| 907 |
\pgfcirc@style@to@style{potentiometer}{pR} |
| 908 |
|
| 909 |
\pgfcirc@activate@bipole@simple{l}{thermistor} |
| 910 |
\pgfcirc@style@to@style{thermistor}{thR} |
| 911 |
\pgfcirc@activate@bipole{l}{thermistorptc}{thermistorptc}{thermistor ptc} |
| 912 |
\pgfcirc@style@to@style{thermistor ptc}{thRp} |
| 913 |
\pgfcirc@activate@bipole{l}{thermistorntc}{thermistorntc}{thermistor ntc} |
| 914 |
\pgfcirc@style@to@style{thermistor ntc}{thRn} |
| 915 |
\pgfcirc@activate@bipole@simple{l}{photoresistor} |
| 916 |
\pgfcirc@style@to@style{photoresistor}{phR} |
| 917 |
\pgfcirc@activate@bipole@simple{l}{varistor} |
| 918 |
\pgfcirc@activate@bipole@simple{l}{mov} |
| 919 |
\pgfcirc@activate@bipole@simple{l}{memristor} |
| 920 |
\pgfcirc@style@to@style{memristor}{Mr}% |
| 921 |
% %>>> |
| 922 |
|
| 923 |
%%%%%%%%%%%%%% |
| 924 |
%% Capacitors |
| 925 |
%%%%%%%%%%%%% |
| 926 |
|
| 927 |
%% Definitions for Capacitors%<<<1 |
| 928 |
\ctikzset{bipoles/capacitor/height/.initial=.6} |
| 929 |
\ctikzset{bipoles/capacitor/width/.initial=.2} |
| 930 |
\ctikzset{bipoles/ecapacitor/height/.initial=.5} |
| 931 |
\ctikzset{bipoles/ecapacitor/width/.initial=.2} |
| 932 |
\ctikzset{bipoles/ecapacitor/font/.initial=\pgf@circ@font@sixbm} |
| 933 |
%%% pcapacitor is deprecated |
| 934 |
\ctikzset{bipoles/pcapacitor/height/.initial=.6} |
| 935 |
\ctikzset{bipoles/pcapacitor/width/.initial=.2} |
| 936 |
\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1} |
| 937 |
\ctikzset{bipoles/ccapacitor/height/.initial=.6} |
| 938 |
\ctikzset{bipoles/ccapacitor/width/.initial=.2} |
| 939 |
\ctikzset{bipoles/ccapacitor/bend width/.initial=1.1} |
| 940 |
\ctikzset{bipoles/vcapacitor/height/.initial=.6} |
| 941 |
\ctikzset{bipoles/vcapacitor/width/.initial=.2} |
| 942 |
\ctikzset{bipoles/vcapacitor/tunable width/.initial=3} |
| 943 |
\ctikzset{bipoles/vcapacitor/capacitor width/.code={% |
| 944 |
\pgfutil@packagewarning{circuitikz}{vcapacitor/capacitor width deprecated; ignored}% |
| 945 |
}}% deprecated |
| 946 |
% piezoelectric (double size by default) |
| 947 |
\ctikzset{bipoles/piezoelectric/height/.initial=.7} |
| 948 |
\ctikzset{bipoles/piezoelectric/width/.initial=.4}% |
| 949 |
% constant phase element (double size by default) |
| 950 |
\ctikzset{bipoles/cpe/height/.initial=.6} |
| 951 |
\ctikzset{bipoles/cpe/width/.initial=.4} |
| 952 |
% |
| 953 |
% style settings |
| 954 |
% |
| 955 |
\ctikzset{capacitors/width/.code={% |
| 956 |
\pgfmathsetmacro{\pgfcirc@@double}{2*#1}% |
| 957 |
\ctikzset{bipoles/.cd, |
| 958 |
capacitor/width=#1, ecapacitor/width=#1, ccapacitor/width=#1, |
| 959 |
vcapacitor/width=#1, |
| 960 |
piezoelectric/width=\pgfcirc@@double, |
| 961 |
cpe/width=\pgfcirc@@double, |
| 962 |
}}} |
| 963 |
\ctikzset{capacitors/height/.code={% |
| 964 |
\ctikzset{bipoles/.cd, |
| 965 |
capacitor/height=#1, ecapacitor/height=#1, ccapacitor/height=#1, |
| 966 |
vcapacitor/height=#1, |
| 967 |
piezoelectric/height=#1, |
| 968 |
cpe/height=#1, |
| 969 |
}}} |
| 970 |
\def\pgfcirc@maybe@fill@straight@capacitor{% |
| 971 |
\pgfscope |
| 972 |
\pgfpathrectanglecorners |
| 973 |
{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 974 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 975 |
\pgf@circ@maybefill |
| 976 |
\endpgfscope |
| 977 |
} |
| 978 |
%>>> |
| 979 |
|
| 980 |
%% Shapes for capacitors%<<< |
| 981 |
%% Plain Capacitor |
| 982 |
\pgfcircdeclarebipolescaled{capacitors} |
| 983 |
{} |
| 984 |
{\ctikzvalof{bipoles/capacitor/height}} |
| 985 |
{capacitor} |
| 986 |
{\ctikzvalof{bipoles/capacitor/height}} |
| 987 |
{\ctikzvalof{bipoles/capacitor/width}} |
| 988 |
{ |
| 989 |
\pgfcirc@maybe@fill@straight@capacitor |
| 990 |
|
| 991 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 992 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 993 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 994 |
|
| 995 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 996 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 997 |
\pgfusepath{draw} |
| 998 |
|
| 999 |
} |
| 1000 |
|
| 1001 |
%% Capacitive sensor |
| 1002 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1003 |
{ |
| 1004 |
\anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}% |
| 1005 |
\pgfcirc@border@extend@full{2.6}{1}{4.4}{1.2} |
| 1006 |
\anchor{wiper}{\northeast\pgf@x=-4.4\pgf@x\pgf@y=-1.2\pgf@y} |
| 1007 |
\anchor{W}{\northeast\pgf@x=-4.4\pgf@x\pgf@y=-1.2\pgf@y} |
| 1008 |
\anchor{tip}{\northeast\pgf@x=2.6\pgf@x} |
| 1009 |
} |
| 1010 |
{\ctikzvalof{bipoles/capacitor/height}} |
| 1011 |
{capacitivesens} |
| 1012 |
{\ctikzvalof{bipoles/capacitor/height}} |
| 1013 |
{\ctikzvalof{bipoles/capacitor/width}} |
| 1014 |
{ |
| 1015 |
\pgfcirc@maybe@fill@straight@capacitor |
| 1016 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1017 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1018 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1019 |
|
| 1020 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1021 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1022 |
\pgfusepath{draw} |
| 1023 |
\pgfscope |
| 1024 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1025 |
\pgfpathmoveto{\pgfpoint{2.6\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1026 |
\pgfpathlineto{\pgfpoint{-2.6\pgf@circ@res@right}{1.2\pgf@circ@res@down}} |
| 1027 |
\pgfpathlineto{\pgfpoint{-4.4\pgf@circ@res@right}{1.2\pgf@circ@res@down}} |
| 1028 |
\pgfusepath{draw} |
| 1029 |
\endpgfscope |
| 1030 |
} |
| 1031 |
|
| 1032 |
%% Polar Capacitor (DEPRECATED) |
| 1033 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1034 |
{} |
| 1035 |
{\ctikzvalof{bipoles/pcapacitor/height}} |
| 1036 |
{polarcapacitor} |
| 1037 |
{\ctikzvalof{bipoles/pcapacitor/height}} |
| 1038 |
{\ctikzvalof{bipoles/pcapacitor/width}} |
| 1039 |
{ |
| 1040 |
|
| 1041 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1042 |
|
| 1043 |
\pgfutil@packagewarning{circuitikz}{polar capacitor has been deprecated; change to curved capacitor (see manual)}% |
| 1044 |
|
| 1045 |
\pgfscope |
| 1046 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1047 |
\pgftransformrotate{-90} |
| 1048 |
\pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}} |
| 1049 |
\pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@left}} |
| 1050 |
\pgfusepath{draw} |
| 1051 |
\endpgfscope |
| 1052 |
|
| 1053 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1054 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1055 |
\pgfusepath{draw} |
| 1056 |
} |
| 1057 |
|
| 1058 |
|
| 1059 |
%% Curved capacitor |
| 1060 |
% see https://tex.stackexchange.com/questions/509594/polar-capacitor-orientation-in-circuitikz-seems-wrong |
| 1061 |
% for a rationale |
| 1062 |
% |
| 1063 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1064 |
{} |
| 1065 |
{\ctikzvalof{bipoles/ccapacitor/height}} |
| 1066 |
{ccapacitor} |
| 1067 |
{\ctikzvalof{bipoles/ccapacitor/height}} |
| 1068 |
{\ctikzvalof{bipoles/ccapacitor/width}} |
| 1069 |
{ |
| 1070 |
\pgfscope |
| 1071 |
\pgfscope |
| 1072 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1073 |
\pgftransformrotate{-90} |
| 1074 |
\pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}} |
| 1075 |
\pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@right}} |
| 1076 |
\pgftransformrotate{90} |
| 1077 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1078 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1079 |
\pgfpathclose{} |
| 1080 |
\pgf@circ@maybefill |
| 1081 |
\endpgfscope |
| 1082 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1083 |
\pgfscope |
| 1084 |
% \pgfsetcolor{red} |
| 1085 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1086 |
\pgftransformrotate{-90} |
| 1087 |
\pgfpathsine{\pgfpoint{\pgf@circ@res@up}{-\ctikzvalof{bipoles/ccapacitor/bend width}\pgf@circ@res@right}} |
| 1088 |
\pgfpathcosine{\pgfpoint{\pgf@circ@res@up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@right}} |
| 1089 |
\pgfusepath{draw} |
| 1090 |
\endpgfscope |
| 1091 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1092 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1093 |
\pgfusepath{draw} |
| 1094 |
\endpgfscope |
| 1095 |
% extend wire to the curved capacitor |
| 1096 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\ctikzvalof{bipoles/pcapacitor/bend width}\pgf@circ@res@right}{0pt}} |
| 1097 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 1098 |
\pgfusepath{draw} |
| 1099 |
} |
| 1100 |
|
| 1101 |
%% Electrolytic Capacitor |
| 1102 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1103 |
{} |
| 1104 |
{\ctikzvalof{bipoles/ecapacitor/height}} |
| 1105 |
{ecapacitor} |
| 1106 |
{\ctikzvalof{bipoles/ecapacitor/height}} |
| 1107 |
{\ctikzvalof{bipoles/ecapacitor/width}} |
| 1108 |
{ |
| 1109 |
\pgfscope |
| 1110 |
\pgfsetrectcap |
| 1111 |
% % % Draw plus pole |
| 1112 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1113 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1114 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1115 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1116 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1117 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1118 |
\pgf@circ@draworfill |
| 1119 |
% % Draw minus pole |
| 1120 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1121 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1122 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1123 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1124 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1125 |
\pgf@circ@setcolor |
| 1126 |
\pgf@circ@fill@strokecolor |
| 1127 |
\pgfusepath{draw,fill} |
| 1128 |
\endpgfscope |
| 1129 |
% % plus pole annotation |
| 1130 |
\pgf@circ@text@strokecolor |
| 1131 |
\pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}] |
| 1132 |
{\ctikzvalof{bipoles/ecapacitor/font} $+$} |
| 1133 |
} |
| 1134 |
|
| 1135 |
%% Variable Capacitor |
| 1136 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1137 |
{ |
| 1138 |
\saveddimen{\tunablewidth}{% |
| 1139 |
\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/vcapacitor/tunable width}* |
| 1140 |
\ctikzvalof{bipoles/vcapacitor/width}*0.5* |
| 1141 |
\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} |
| 1142 |
} |
| 1143 |
\anchor{wiper}{\northeast\pgf@x=-\tunablewidth\pgf@y=-\pgf@y} |
| 1144 |
\anchor{W}{\northeast\pgf@x=-\tunablewidth\pgf@y=-\pgf@y} |
| 1145 |
\anchor{tip}{\northeast\pgf@x=\tunablewidth} |
| 1146 |
} |
| 1147 |
{\ctikzvalof{bipoles/vcapacitor/height}} |
| 1148 |
{vcapacitor} |
| 1149 |
{\ctikzvalof{bipoles/vcapacitor/height}} |
| 1150 |
{\ctikzvalof{bipoles/vcapacitor/width}} |
| 1151 |
{ |
| 1152 |
\pgfcirc@maybe@fill@straight@capacitor |
| 1153 |
\pgf@circ@res@step = \ctikzvalof{bipoles/vcapacitor/tunable width} \pgf@circ@res@right |
| 1154 |
|
| 1155 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1156 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1157 |
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1158 |
|
| 1159 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1160 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1161 |
\pgfusepath{draw} |
| 1162 |
|
| 1163 |
\pgfscope |
| 1164 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1165 |
\pgfcirc@set@arrows{tunable}{}{latexslim} |
| 1166 |
\ifpgf@circ@fixtunable@dir |
| 1167 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 1168 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 1169 |
\else |
| 1170 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 1171 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 1172 |
\fi |
| 1173 |
\pgfusepath{draw} |
| 1174 |
\endpgfscope |
| 1175 |
|
| 1176 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 1177 |
\pgfusepath{draw} |
| 1178 |
} |
| 1179 |
|
| 1180 |
|
| 1181 |
%% Piezoelectric Element |
| 1182 |
|
| 1183 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1184 |
{} |
| 1185 |
{\ctikzvalof{bipoles/piezoelectric/height}} |
| 1186 |
{piezoelectric} |
| 1187 |
{\ctikzvalof{bipoles/piezoelectric/height}} |
| 1188 |
{\ctikzvalof{bipoles/piezoelectric/width}} |
| 1189 |
{ |
| 1190 |
% \pgf@circ@res@step = \ctikzvalof{bipoles/piezoelectric/width}\pgf@circ@Rlen |
| 1191 |
% \divide \pgf@circ@res@step by 5 |
| 1192 |
|
| 1193 |
%% Outer markings |
| 1194 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1195 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1196 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1197 |
|
| 1198 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1199 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1200 |
\pgfusepath{draw} |
| 1201 |
|
| 1202 |
%% Inner Box |
| 1203 |
\pgf@circ@res@step = \pgf@circ@res@right \divide \pgf@circ@res@step by 10 |
| 1204 |
\pgfscope |
| 1205 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1206 |
\pgfpathrectanglecorners |
| 1207 |
{\pgfpoint{\pgf@circ@res@left+4*\pgf@circ@res@step}{\pgf@circ@res@up-\pgf@circ@res@step}} |
| 1208 |
{\pgfpoint{\pgf@circ@res@right-4*\pgf@circ@res@step}{\pgf@circ@res@down+\pgf@circ@res@step}} |
| 1209 |
\pgf@circ@draworfill |
| 1210 |
\endpgfscope |
| 1211 |
} |
| 1212 |
|
| 1213 |
% Ferroelectric capacitor, suggested by Mayeul Cantan |
| 1214 |
% (see https://github.com/circuitikz/circuitikz/issues/515) |
| 1215 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1216 |
{ |
| 1217 |
\anchor{curve right}{\southwest\pgf@x=-1.8\pgf@x\pgf@y=\pgf@y}% |
| 1218 |
\anchor{curve left}{\southwest\pgf@x=1.8\pgf@x\pgf@y=-\pgf@y}% |
| 1219 |
\anchor{kink right}{\southwest\pgf@x=-1.8\pgf@x\pgf@y=0.5\pgf@y}% |
| 1220 |
\anchor{kink left}{\southwest\pgf@x=1.8\pgf@x\pgf@y=-0.5\pgf@y}% |
| 1221 |
\pgfcirc@border@extend@full{1.8}{1}{1.8}{1} |
| 1222 |
} |
| 1223 |
{\ctikzvalof{bipoles/capacitor/height}} |
| 1224 |
{ferrocap} |
| 1225 |
{\ctikzvalof{bipoles/capacitor/height}} |
| 1226 |
{\ctikzvalof{bipoles/capacitor/width}} |
| 1227 |
{ |
| 1228 |
\pgfcirc@maybe@fill@straight@capacitor |
| 1229 |
|
| 1230 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1231 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1232 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1233 |
|
| 1234 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1235 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1236 |
\pgfusepath{draw} |
| 1237 |
\pgfscope |
| 1238 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1239 |
\pgfsetcornersarced{\pgfpoint{0.2\pgf@circ@res@right}{0.2\pgf@circ@res@up}} |
| 1240 |
\pgfpathmoveto{\pgfpoint{-1.8\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1241 |
\pgfpathlineto{\pgfpoint{-1.8\pgf@circ@res@right}{0.5\pgf@circ@res@up}} |
| 1242 |
\pgfpathlineto{\pgfpoint{1.8\pgf@circ@res@right}{0.5\pgf@circ@res@down}} |
| 1243 |
\pgfpathlineto{\pgfpoint{1.8\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1244 |
\pgfusepath{draw} |
| 1245 |
\endpgfscope |
| 1246 |
} |
| 1247 |
|
| 1248 |
%% Constant phase element |
| 1249 |
\pgfcircdeclarebipolescaled{capacitors} |
| 1250 |
{} |
| 1251 |
{\ctikzvalof{bipoles/cpe/height}} |
| 1252 |
{cpe} |
| 1253 |
{\ctikzvalof{bipoles/cpe/height}} |
| 1254 |
{\ctikzvalof{bipoles/cpe/width}} |
| 1255 |
{ |
| 1256 |
\pgfscope |
| 1257 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1258 |
\pgfpathlineto{\pgfpointorigin} |
| 1259 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1260 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} |
| 1261 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 1262 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 1263 |
\pgfpathclose |
| 1264 |
\pgf@circ@maybefill |
| 1265 |
\endpgfscope |
| 1266 |
|
| 1267 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 1268 |
\pgfpathlineto{\pgfpointorigin} |
| 1269 |
\pgfusepath{draw} |
| 1270 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1271 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1272 |
\pgfpathlineto{\pgfpointorigin} |
| 1273 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1274 |
|
| 1275 |
\pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 1276 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 1277 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} |
| 1278 |
\pgfusepath{draw} |
| 1279 |
} |
| 1280 |
|
| 1281 |
% %>>> |
| 1282 |
|
| 1283 |
%% Paths for capacitors%<<< |
| 1284 |
\pgfcirc@activate@bipole@simple{l}{capacitor} |
| 1285 |
\pgfcirc@style@to@style{capacitor}{C} |
| 1286 |
\pgfcirc@activate@bipole@simple{l}{ecapacitor} |
| 1287 |
\pgfcirc@style@to@style{ecapacitor}{eC} |
| 1288 |
\pgfcirc@style@to@style{ecapacitor}{elko} |
| 1289 |
\pgfcirc@activate@bipole{l}{polarcapacitor}{polarcapacitor}{polar capacitor} |
| 1290 |
%% polar capacitor is deprecated, use curved capacitor instead |
| 1291 |
\pgfcirc@style@to@style{polar capacitor}{pC} |
| 1292 |
\pgfcirc@activate@bipole{l}{ccapacitor}{ccapacitor}{curved capacitor} |
| 1293 |
\pgfcirc@style@to@style{curved capacitor}{cC} |
| 1294 |
\pgfcirc@activate@bipole{l}{vcapacitor}{vcapacitor}{variable capacitor} |
| 1295 |
\pgfcirc@style@to@style{variable capacitor}{vC} |
| 1296 |
\pgfcirc@activate@bipole@simple{l}{piezoelectric} |
| 1297 |
\pgfcirc@style@to@style{piezoelectric}{PZ} |
| 1298 |
\pgfcirc@activate@bipole{l}{capacitivesens}{capacitivesens}{capacitive sensor} |
| 1299 |
\pgfcirc@style@to@style{capacitive sensor}{sC} |
| 1300 |
\pgfcirc@activate@bipole@simple{l}{ferrocap} |
| 1301 |
\pgfcirc@style@to@style{ferrocap}{feC} |
| 1302 |
\pgfcirc@activate@bipole@simple{l}{cpe} |
| 1303 |
% %>>> |
| 1304 |
|
| 1305 |
%%%%%%%%%%%%%%% |
| 1306 |
%% Inductors |
| 1307 |
%%%%%%%%%%%%%%% |
| 1308 |
|
| 1309 |
% Definitions of Inductors%<<<1 |
| 1310 |
|
| 1311 |
\ctikzset{inductors/coils/.code={% |
| 1312 |
\ctikzset{bipoles/cuteinductor/coils=#1}% |
| 1313 |
\ctikzset{bipoles/cutechoke/coils=#1}% |
| 1314 |
\ctikzset{bipoles/americaninductor/coils=#1}% |
| 1315 |
\ctikzset{bipoles/vcuteinductor/coils=#1}% |
| 1316 |
\ctikzset{bipoles/vamericaninductor/coils=#1}% |
| 1317 |
}} |
| 1318 |
\ctikzset{inductors/width/.code={% |
| 1319 |
\ctikzset{bipoles/cuteinductor/width=#1}% |
| 1320 |
\ctikzset{bipoles/cutechoke/width=#1}% |
| 1321 |
\ctikzset{bipoles/americaninductor/width=#1}% |
| 1322 |
\ctikzset{bipoles/vcuteinductor/width=#1}% |
| 1323 |
\ctikzset{bipoles/vamericaninductor/width=#1}% |
| 1324 |
\ctikzset{bipoles/fullgeneric/width=#1}% |
| 1325 |
\ctikzset{bipoles/tfullgeneric/width=#1}% |
| 1326 |
}} |
| 1327 |
\ctikzset{bipoles/cuteinductor/height/.initial=.3} |
| 1328 |
\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15} |
| 1329 |
\ctikzset{bipoles/cuteinductor/width/.initial=.6} |
| 1330 |
\ctikzset{bipoles/cuteinductor/coils/.initial=5} |
| 1331 |
\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil |
| 1332 |
%% Cute choke settings |
| 1333 |
\ctikzset{bipoles/cutechoke/height/.initial=.3} |
| 1334 |
\ctikzset{bipoles/cutechoke/lower coil height/.initial=.15} |
| 1335 |
\ctikzset{bipoles/cutechoke/width/.initial=.6} |
| 1336 |
\ctikzset{bipoles/cutechoke/coils/.initial=5} |
| 1337 |
\ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil |
| 1338 |
\ctikzset{bipoles/cutechoke/cstep/.initial=.3} |
| 1339 |
\ctikzset{bipoles/cutechoke/cdist/.initial=1.3} |
| 1340 |
\ctikzset{bipoles/cutechoke/cthick/.initial=1} |
| 1341 |
\newif\ifpgf@circuit@bipole@twolineschoke |
| 1342 |
\pgf@circuit@bipole@twolineschokefalse |
| 1343 |
\pgfkeys{/tikz/onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}} |
| 1344 |
\ctikzset{onelinechoke/.add code={}{\pgf@circuit@bipole@twolineschokefalse}} |
| 1345 |
\pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}} |
| 1346 |
\ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}} |
| 1347 |
% |
| 1348 |
% generic core anchor settings |
| 1349 |
\ctikzset{bipoles/inductors/core distance/.initial={2pt}} |
| 1350 |
\ctikzset{bipoles/inductors/dot x distance/.initial={4pt}} |
| 1351 |
\ctikzset{bipoles/inductors/dot y distance/.initial={1pt}} |
| 1352 |
\def\pgfcir@basic@core@anchors{% |
| 1353 |
\saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} |
| 1354 |
\saveddimen{\dotXdistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/dot x distance}}} |
| 1355 |
\saveddimen{\dotYdistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/dot y distance}}} |
| 1356 |
\anchor{core east}{% |
| 1357 |
\northeast\advance\pgf@y by\coredistance |
| 1358 |
} |
| 1359 |
\anchor{core west}{% |
| 1360 |
\northeast\advance\pgf@y by\coredistance\pgf@x=-\pgf@x |
| 1361 |
} |
| 1362 |
\anchor{ll dot}{% |
| 1363 |
\southwestborder |
| 1364 |
\advance\pgf@x by -\dotXdistance |
| 1365 |
\advance\pgf@y by -\dotYdistance |
| 1366 |
} |
| 1367 |
\anchor{ul dot}{% |
| 1368 |
\northeastborder |
| 1369 |
\advance\pgf@x by \dotXdistance\pgf@x=-\pgf@x |
| 1370 |
\advance\pgf@y by \dotYdistance |
| 1371 |
} |
| 1372 |
\anchor{lr dot}{% |
| 1373 |
\southwestborder |
| 1374 |
\advance\pgf@x by -\dotXdistance\pgf@x=-\pgf@x |
| 1375 |
\advance\pgf@y by -\dotYdistance |
| 1376 |
} |
| 1377 |
\anchor{ur dot}{% |
| 1378 |
\northeastborder |
| 1379 |
\advance\pgf@x by \dotXdistance |
| 1380 |
\advance\pgf@y by \dotYdistance |
| 1381 |
} |
| 1382 |
} |
| 1383 |
% |
| 1384 |
\ctikzset{bipoles/americaninductor/height/.initial=.3} |
| 1385 |
\ctikzset{bipoles/americaninductor/height 2/.initial=.1} |
| 1386 |
\ctikzset{bipoles/americaninductor/width/.initial=.8} |
| 1387 |
\ctikzset{bipoles/americaninductor/coils/.initial=4} |
| 1388 |
\ctikzset{bipoles/americaninductor/coil height/.initial=.15} |
| 1389 |
\ctikzset{bipoles/vcuteinductor/height/.initial=.6} |
| 1390 |
\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3} |
| 1391 |
\ctikzset{bipoles/vcuteinductor/width/.initial=.6} |
| 1392 |
\ctikzset{bipoles/vcuteinductor/coils/.initial=5} |
| 1393 |
\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil |
| 1394 |
\ctikzset{bipoles/vamericaninductor/height/.initial=.6} |
| 1395 |
\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2} |
| 1396 |
\ctikzset{bipoles/vamericaninductor/width/.initial=.8} |
| 1397 |
\ctikzset{bipoles/vamericaninductor/coils/.initial=4} |
| 1398 |
\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15} |
| 1399 |
\ctikzset{bipoles/tfullgeneric/height/.initial=.70} |
| 1400 |
\ctikzset{bipoles/tfullgeneric/width/.initial=.80} |
| 1401 |
\ctikzset{bipoles/fullgeneric/height/.initial=.30} |
| 1402 |
\ctikzset{bipoles/fullgeneric/width/.initial=.80} |
| 1403 |
\ctikzset{inductor/.is choice} |
| 1404 |
\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}} |
| 1405 |
\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}} |
| 1406 |
\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}} |
| 1407 |
|
| 1408 |
\tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}} |
| 1409 |
\tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}} |
| 1410 |
\tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}} |
| 1411 |
\tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}} |
| 1412 |
\tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}} |
| 1413 |
|
| 1414 |
%%>>> |
| 1415 |
|
| 1416 |
%% Shapes for inductors%<<< |
| 1417 |
%% cute inductor |
| 1418 |
\pgfcircdeclarebipolescaled{inductors} |
| 1419 |
{ |
| 1420 |
\savedanchor{\midtap}{% |
| 1421 |
\pgf@x=0pt\relax |
| 1422 |
\pgfmathsetlength{\pgf@y}{% |
| 1423 |
(mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% |
| 1424 |
\ctikzvalof{bipoles/cuteinductor/height} :% even |
| 1425 |
-\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd |
| 1426 |
*\pgf@circ@scaled@Rlen/2 |
| 1427 |
} |
| 1428 |
} |
| 1429 |
\anchor{midtap}{\midtap} |
| 1430 |
\pgfcir@basic@core@anchors |
| 1431 |
} |
| 1432 |
{\ctikzvalof{bipoles/cuteinductor/lower coil height}} |
| 1433 |
{cuteinductor} |
| 1434 |
{\ctikzvalof{bipoles/cuteinductor/height}} |
| 1435 |
{\ctikzvalof{bipoles/cuteinductor/width}} |
| 1436 |
{ |
| 1437 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1438 |
\pgftransformationadjustments |
| 1439 |
|
| 1440 |
\pgfmathsetlength{\pgf@circ@res@other}%width of small coil |
| 1441 |
{0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)} |
| 1442 |
|
| 1443 |
|
| 1444 |
\pgfmathsetlength{\pgf@circ@res@step} |
| 1445 |
{(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2} |
| 1446 |
|
| 1447 |
\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 |
| 1448 |
\foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}} |
| 1449 |
{ |
| 1450 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up} |
| 1451 |
\pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down} |
| 1452 |
} |
| 1453 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up} |
| 1454 |
\pgfsetbuttcap |
| 1455 |
\pgfsetbeveljoin |
| 1456 |
\pgfusepath{stroke} |
| 1457 |
} |
| 1458 |
|
| 1459 |
%% cute inductive sensor |
| 1460 |
\pgfcircdeclarebipolescaled{inductors} |
| 1461 |
{% anchor for labelling the type of dependency |
| 1462 |
\anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}% |
| 1463 |
\savedanchor{\midtap}{% |
| 1464 |
\pgf@x=0pt\relax |
| 1465 |
\pgfmathsetlength{\pgf@y}{% |
| 1466 |
(mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% |
| 1467 |
\ctikzvalof{bipoles/cuteinductor/height} :% even |
| 1468 |
-\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd |
| 1469 |
*\pgf@circ@scaled@Rlen/2 |
| 1470 |
} |
| 1471 |
} |
| 1472 |
\anchor{midtap}{\midtap} |
| 1473 |
\pgfcirc@border@extend@full{1}{2}{1.6}{2.6} |
| 1474 |
\pgfcir@basic@core@anchors |
| 1475 |
\anchor{wiper}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} |
| 1476 |
\anchor{W}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} |
| 1477 |
\anchor{tip}{\northeast\pgf@x=0.8\pgf@x\pgf@y=2\pgf@y} |
| 1478 |
} |
| 1479 |
{\ctikzvalof{bipoles/cuteinductor/lower coil height}} |
| 1480 |
{scuteinductor} |
| 1481 |
{\ctikzvalof{bipoles/cuteinductor/height}} |
| 1482 |
{\ctikzvalof{bipoles/cuteinductor/width}} |
| 1483 |
{ |
| 1484 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1485 |
\pgftransformationadjustments |
| 1486 |
|
| 1487 |
\pgfmathsetlength{\pgf@circ@res@other}%width of small coil |
| 1488 |
{0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}-1)} |
| 1489 |
|
| 1490 |
|
| 1491 |
\pgfmathsetlength{\pgf@circ@res@step} |
| 1492 |
{(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cuteinductor/coils}/2} |
| 1493 |
|
| 1494 |
\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 |
| 1495 |
\foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}} |
| 1496 |
{ |
| 1497 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up} |
| 1498 |
\pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down} |
| 1499 |
} |
| 1500 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up} |
| 1501 |
\pgfsetbuttcap |
| 1502 |
\pgfsetbeveljoin |
| 1503 |
\pgfusepath{stroke} |
| 1504 |
\pgfscope |
| 1505 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1506 |
\pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}} |
| 1507 |
\pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}} |
| 1508 |
\pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}} |
| 1509 |
\pgfusepath{draw} |
| 1510 |
\endpgfscope |
| 1511 |
} |
| 1512 |
|
| 1513 |
%% cute choke |
| 1514 |
\pgfcircdeclarebipolescaled{inductors} |
| 1515 |
{ |
| 1516 |
\savedanchor{\midtap}{% |
| 1517 |
\pgf@x=0pt\relax |
| 1518 |
\pgfmathsetlength{\pgf@y}{% |
| 1519 |
(mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% |
| 1520 |
\ctikzvalof{bipoles/cuteinductor/height} :% even |
| 1521 |
-\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd |
| 1522 |
*\pgf@circ@scaled@Rlen/2 |
| 1523 |
} |
| 1524 |
} |
| 1525 |
\anchor{midtap}{\midtap} |
| 1526 |
} |
| 1527 |
{\ctikzvalof{bipoles/cutechoke/lower coil height}} |
| 1528 |
{cutechoke} |
| 1529 |
{\ctikzvalof{bipoles/cutechoke/height}} |
| 1530 |
{\ctikzvalof{bipoles/cutechoke/width}} |
| 1531 |
{ |
| 1532 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1533 |
\pgftransformationadjustments |
| 1534 |
|
| 1535 |
\pgfmathsetlength{\pgf@circ@res@other}%width of small coil |
| 1536 |
{0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen/(\ctikzvalof{bipoles/cutechoke/coils}-1)} |
| 1537 |
|
| 1538 |
|
| 1539 |
\pgfmathsetlength{\pgf@circ@res@step} |
| 1540 |
{(\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/cutechoke/coils}/2} |
| 1541 |
|
| 1542 |
\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 |
| 1543 |
\foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}} |
| 1544 |
{ |
| 1545 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up} |
| 1546 |
\pgfpatharc{0}{-180}{\pgf@circ@res@other and -\pgf@circ@res@down} |
| 1547 |
} |
| 1548 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@up} |
| 1549 |
\pgfsetbuttcap |
| 1550 |
\pgfsetbeveljoin |
| 1551 |
\pgfusepath{stroke} |
| 1552 |
|
| 1553 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}} |
| 1554 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf@circ@res@up}} |
| 1555 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1556 |
\pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth} |
| 1557 |
\pgfusepath{stroke} |
| 1558 |
|
| 1559 |
\ifpgf@circuit@bipole@twolineschoke |
| 1560 |
\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}} |
| 1561 |
\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}} |
| 1562 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1563 |
\pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth} |
| 1564 |
\pgfusepath{stroke} |
| 1565 |
\fi |
| 1566 |
} |
| 1567 |
|
| 1568 |
%% variable cute inductor |
| 1569 |
\pgfcircdeclarebipolescaled{inductors} |
| 1570 |
{ |
| 1571 |
\savedanchor{\midtap}{% |
| 1572 |
\pgf@x=0pt\relax |
| 1573 |
\pgfmathsetlength{\pgf@y}{% |
| 1574 |
(mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?% |
| 1575 |
\ctikzvalof{bipoles/cuteinductor/height} :% even |
| 1576 |
-\ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd |
| 1577 |
*\pgf@circ@scaled@Rlen/2 |
| 1578 |
} |
| 1579 |
} |
| 1580 |
\anchor{midtap}{\midtap} |
| 1581 |
\saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} |
| 1582 |
\anchor{core east}{% |
| 1583 |
\northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance |
| 1584 |
} |
| 1585 |
\anchor{core west}{% |
| 1586 |
\northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance\pgf@x=-\pgf@x |
| 1587 |
} |
| 1588 |
\anchor{wiper}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} |
| 1589 |
\anchor{W}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} |
| 1590 |
\anchor{tip}{\northeast\pgf@x=0.4\pgf@x} |
| 1591 |
} |
| 1592 |
{\ctikzvalof{bipoles/vcuteinductor/lower coil height}} |
| 1593 |
{vcuteinductor} |
| 1594 |
{\ctikzvalof{bipoles/vcuteinductor/height}} |
| 1595 |
{\ctikzvalof{bipoles/vcuteinductor/width}} |
| 1596 |
{ |
| 1597 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1598 |
\pgftransformationadjustments |
| 1599 |
|
| 1600 |
\pgfmathsetlength{\pgf@circ@res@other}%width of small coil |
| 1601 |
{0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/vcuteinductor/coils}-1)} |
| 1602 |
|
| 1603 |
|
| 1604 |
\pgfmathsetlength{\pgf@circ@res@step} |
| 1605 |
{(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2} |
| 1606 |
|
| 1607 |
\pgfscope |
| 1608 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1609 |
\pgfcirc@set@arrows{tunable}{}{latexslim} |
| 1610 |
\pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1611 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 1612 |
\pgfusepath{draw} |
| 1613 |
\endpgfscope |
| 1614 |
|
| 1615 |
\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 |
| 1616 |
\foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}} |
| 1617 |
{ |
| 1618 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up} |
| 1619 |
\pgfpatharc{0}{-180}{\pgf@circ@res@other and -.5\pgf@circ@res@down} |
| 1620 |
} |
| 1621 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and .5\pgf@circ@res@up} |
| 1622 |
\pgfsetbuttcap |
| 1623 |
\pgfsetbeveljoin |
| 1624 |
\pgfusepath{stroke} |
| 1625 |
} |
| 1626 |
|
| 1627 |
%% american inductor |
| 1628 |
\pgfcircdeclarebipolescaled{inductors} |
| 1629 |
{ |
| 1630 |
\savedanchor{\midtap}{% |
| 1631 |
\pgf@x=0pt\relax |
| 1632 |
\pgfmathsetlength{\pgf@y}{% |
| 1633 |
(mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?% |
| 1634 |
2*\ctikzvalof{bipoles/americaninductor/coil height} :% even |
| 1635 |
0) %odd |
| 1636 |
*\pgf@circ@scaled@Rlen/2 |
| 1637 |
} |
| 1638 |
} |
| 1639 |
\anchor{midtap}{\midtap} |
| 1640 |
\pgfcir@basic@core@anchors |
| 1641 |
} |
| 1642 |
{\ctikzvalof{bipoles/americaninductor/height 2}} |
| 1643 |
{americaninductor} |
| 1644 |
{\ctikzvalof{bipoles/americaninductor/height}} |
| 1645 |
{\ctikzvalof{bipoles/americaninductor/width}} |
| 1646 |
{ |
| 1647 |
\pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen |
| 1648 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1649 |
\pgftransformationadjustments |
| 1650 |
\advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth |
| 1651 |
\divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils} |
| 1652 |
\divide \pgf@circ@res@step by 2 |
| 1653 |
\pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen |
| 1654 |
|
| 1655 |
\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 |
| 1656 |
\foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}} |
| 1657 |
{ |
| 1658 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} |
| 1659 |
} |
| 1660 |
\pgfsetbuttcap |
| 1661 |
\pgfsetbeveljoin |
| 1662 |
\pgfusepath{stroke} |
| 1663 |
} |
| 1664 |
|
| 1665 |
|
| 1666 |
%% american inductive sensor |
| 1667 |
\pgfcircdeclarebipolescaled{inductors} |
| 1668 |
{% anchor for labelling the type of dependency |
| 1669 |
\anchor{label}{\southwest\pgf@x=0.8\pgf@x\pgf@y=2.6\pgf@y}% |
| 1670 |
\savedanchor{\midtap}{% |
| 1671 |
\pgf@x=0pt\relax |
| 1672 |
\pgfmathsetlength{\pgf@y}{% |
| 1673 |
(mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?% |
| 1674 |
2*\ctikzvalof{bipoles/americaninductor/coil height} :% even |
| 1675 |
0) %odd |
| 1676 |
*\pgf@circ@scaled@Rlen/2 |
| 1677 |
} |
| 1678 |
} |
| 1679 |
\anchor{midtap}{\midtap} |
| 1680 |
\pgfcirc@border@extend@full{1}{2}{1.6}{2.6} |
| 1681 |
\pgfcir@basic@core@anchors |
| 1682 |
\anchor{wiper}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} |
| 1683 |
\anchor{W}{\southwest\pgf@x=1.6\pgf@x\pgf@y=2.6\pgf@y} |
| 1684 |
\anchor{tip}{\northeast\pgf@x=0.8\pgf@x\pgf@y=2\pgf@y} |
| 1685 |
} |
| 1686 |
{\ctikzvalof{bipoles/americaninductor/height 2}} |
| 1687 |
{samericaninductor} |
| 1688 |
{\ctikzvalof{bipoles/americaninductor/height}} |
| 1689 |
{\ctikzvalof{bipoles/americaninductor/width}} |
| 1690 |
{ |
| 1691 |
\pgf@circ@res@step=\ctikzvalof{bipoles/americaninductor/width}\pgf@circ@scaled@Rlen |
| 1692 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1693 |
\pgftransformationadjustments |
| 1694 |
\advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth |
| 1695 |
\divide \pgf@circ@res@step by \ctikzvalof{bipoles/americaninductor/coils} |
| 1696 |
\divide \pgf@circ@res@step by 2 |
| 1697 |
\pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@scaled@Rlen |
| 1698 |
|
| 1699 |
\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 |
| 1700 |
\foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}} |
| 1701 |
{ |
| 1702 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} |
| 1703 |
} |
| 1704 |
\pgfsetbuttcap |
| 1705 |
\pgfsetbeveljoin |
| 1706 |
\pgfusepath{stroke} |
| 1707 |
\pgfscope |
| 1708 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1709 |
\pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@right}{2\pgf@circ@res@up}} |
| 1710 |
\pgfpathlineto{\pgfpoint{-.8\pgf@circ@res@right}{2.6\pgf@circ@res@down}} |
| 1711 |
\pgfpathlineto{\pgfpoint{-1.6\pgf@circ@res@right}{2.6\pgf@circ@res@down}} |
| 1712 |
\pgfusepath{draw} |
| 1713 |
\endpgfscope |
| 1714 |
} |
| 1715 |
|
| 1716 |
%% variable american inductor |
| 1717 |
\pgfcircdeclarebipolescaled{inductors} |
| 1718 |
{ |
| 1719 |
\savedanchor{\midtap}{% |
| 1720 |
\pgf@x=0pt\relax |
| 1721 |
\pgfmathsetlength{\pgf@y}{% |
| 1722 |
(mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?% |
| 1723 |
2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even |
| 1724 |
0) %odd |
| 1725 |
*\pgf@circ@scaled@Rlen/2 |
| 1726 |
} |
| 1727 |
} |
| 1728 |
\anchor{midtap}{\midtap} |
| 1729 |
\saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} |
| 1730 |
\anchor{core east}{% |
| 1731 |
\northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance |
| 1732 |
} |
| 1733 |
\anchor{core west}{% |
| 1734 |
\northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance\pgf@x=-\pgf@x |
| 1735 |
} |
| 1736 |
\anchor{wiper}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} |
| 1737 |
\anchor{W}{\southwest\pgf@x=0.4\pgf@x\pgf@y=\pgf@y} |
| 1738 |
\anchor{tip}{\northeast\pgf@x=0.4\pgf@x} |
| 1739 |
} |
| 1740 |
{\ctikzvalof{bipoles/vamericaninductor/height 2}} |
| 1741 |
{vamericaninductor} |
| 1742 |
{\ctikzvalof{bipoles/vamericaninductor/height}} |
| 1743 |
{\ctikzvalof{bipoles/vamericaninductor/width}} |
| 1744 |
{ |
| 1745 |
\pgf@circ@res@step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf@circ@scaled@Rlen |
| 1746 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1747 |
\pgftransformationadjustments |
| 1748 |
\advance \pgf@circ@res@step by \pgfhorizontaltransformationadjustment\pgflinewidth |
| 1749 |
\divide \pgf@circ@res@step by \ctikzvalof{bipoles/vamericaninductor/coils} |
| 1750 |
\divide \pgf@circ@res@step by 2 |
| 1751 |
\pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@scaled@Rlen |
| 1752 |
|
| 1753 |
\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 |
| 1754 |
\foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}} |
| 1755 |
{ |
| 1756 |
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other} |
| 1757 |
} |
| 1758 |
\pgfsetbuttcap |
| 1759 |
\pgfsetbeveljoin |
| 1760 |
\pgfusepath{stroke} |
| 1761 |
|
| 1762 |
\pgfscope |
| 1763 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1764 |
\pgfcirc@set@arrows{tunable}{}{latexslim} |
| 1765 |
\pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1766 |
\pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1767 |
\pgfusepath{draw} |
| 1768 |
\endpgfscope |
| 1769 |
} |
| 1770 |
|
| 1771 |
%% Generic bipole, filled - used as inductor by some |
| 1772 |
\pgfcircdeclarebipolescaled{inductors} |
| 1773 |
{ |
| 1774 |
\anchor{midtap}{\northeast\pgf@x=0pt\relax} |
| 1775 |
\pgfcir@basic@core@anchors |
| 1776 |
} |
| 1777 |
{\ctikzvalof{bipoles/fullgeneric/height}} |
| 1778 |
{fullgeneric} |
| 1779 |
{\ctikzvalof{bipoles/fullgeneric/height}} |
| 1780 |
{\ctikzvalof{bipoles/fullgeneric/width}} |
| 1781 |
{ |
| 1782 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1783 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1784 |
|
| 1785 |
\pgf@circ@fill@strokecolor |
| 1786 |
\pgfusepath{draw,fill} |
| 1787 |
} |
| 1788 |
|
| 1789 |
%% Generic sensor, filled - used as inductive sensor by some |
| 1790 |
\pgfcircdeclarebipolescaled{inductors} |
| 1791 |
{% anchor for labelling the type of dependency |
| 1792 |
\anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}% |
| 1793 |
\anchor{midtap}{\northeast\pgf@x=0pt\relax} |
| 1794 |
\pgfcirc@border@extend@full{1}{2}{1}{2} |
| 1795 |
\pgfcir@basic@core@anchors |
| 1796 |
\anchor{wiper}{\northeast\pgf@x=-\pgf@x\pgf@y=-2\pgf@y} |
| 1797 |
\anchor{W}{\northeast\pgf@x=-\pgf@x\pgf@y=-2\pgf@y} |
| 1798 |
\anchor{tip}{\northeast\pgf@y=2\pgf@y} |
| 1799 |
} |
| 1800 |
{\ctikzvalof{bipoles/fullgeneric/height}} |
| 1801 |
{sfullgeneric} |
| 1802 |
{\ctikzvalof{bipoles/fullgeneric/height}} |
| 1803 |
{\ctikzvalof{bipoles/fullgeneric/width}} |
| 1804 |
{ |
| 1805 |
|
| 1806 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 1807 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1808 |
\pgf@circ@fill@strokecolor |
| 1809 |
\pgfusepath{draw,fill} |
| 1810 |
\pgfscope |
| 1811 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1812 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{-2\pgf@circ@res@down}} |
| 1813 |
\pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{2\pgf@circ@res@down}} |
| 1814 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{2\pgf@circ@res@down}} |
| 1815 |
\pgfusepath{draw} |
| 1816 |
\endpgfscope |
| 1817 |
} |
| 1818 |
|
| 1819 |
%% Generic full tunable |
| 1820 |
\pgfcircdeclarebipolescaled{inductors} |
| 1821 |
{ |
| 1822 |
\anchor{midtap}{\northeast\pgf@x=0pt\relax} |
| 1823 |
\saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} |
| 1824 |
\anchor{core east}{% |
| 1825 |
\northeast\pgf@y=0.4\pgf@y\advance\pgf@y by \coredistance |
| 1826 |
} |
| 1827 |
\anchor{core west}{% |
| 1828 |
\northeast\pgf@y=0.4\pgf@y\advance\pgf@y by \coredistance\pgf@x=-\pgf@x |
| 1829 |
} |
| 1830 |
\anchor{wiper}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} |
| 1831 |
\anchor{W}{\northeast\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} |
| 1832 |
\anchor{tip}{\northeast\pgf@x=0.5\pgf@x} |
| 1833 |
} |
| 1834 |
{\ctikzvalof{bipoles/tfullgeneric/height}} |
| 1835 |
{tfullgeneric} |
| 1836 |
{\ctikzvalof{bipoles/tfullgeneric/height}} |
| 1837 |
{\ctikzvalof{bipoles/tfullgeneric/width}} |
| 1838 |
{ |
| 1839 |
\pgf@circ@res@step = \ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen |
| 1840 |
\divide \pgf@circ@res@step by 14 |
| 1841 |
|
| 1842 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}} |
| 1843 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 1844 |
\pgf@circ@fill@strokecolor |
| 1845 |
\pgfusepath{draw,fill} |
| 1846 |
|
| 1847 |
\pgfscope |
| 1848 |
\pgf@circ@set@relative@thickness{modifier thickness} |
| 1849 |
\pgfcirc@set@arrows{tunable}{}{latexslim} |
| 1850 |
\ifpgf@circ@fixtunable@dir |
| 1851 |
\pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1852 |
\pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1853 |
\else |
| 1854 |
\pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 1855 |
\pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 1856 |
\fi |
| 1857 |
\pgfusepath{draw} |
| 1858 |
\endpgfscope |
| 1859 |
} |
| 1860 |
% %>>> |
| 1861 |
|
| 1862 |
%% Paths for Inductors%<<< |
| 1863 |
%% these are complex because of the three-way set |
| 1864 |
%% should be simplified |
| 1865 |
\def\pgf@circ@inductor@path#1{% |
| 1866 |
\pgfextra{ |
| 1867 |
\edef\pgf@circ@temp{\ctikzvalof{inductor}}% |
| 1868 |
\def\pgf@temp{european}% |
| 1869 |
} |
| 1870 |
\ifx\pgf@temp\pgf@circ@temp% |
| 1871 |
\pgf@circ@europeaninductor@path{#1}% |
| 1872 |
\else% |
| 1873 |
\pgfextra{ \def\pgf@temp{cute} }% |
| 1874 |
\ifx\pgf@temp\pgf@circ@temp% |
| 1875 |
\pgf@circ@cuteinductor@path{#1}% |
| 1876 |
\else% |
| 1877 |
\pgf@circ@americaninductor@path{#1}% |
| 1878 |
\fi% |
| 1879 |
\fi% |
| 1880 |
} |
| 1881 |
\pgfcirc@path@to@style{l}{inductor}{inductor}{} |
| 1882 |
\pgfcirc@style@to@style{inductor}{L} |
| 1883 |
\pgfcirc@activate@bipole{l}{europeaninductor}{fullgeneric}{european inductor} |
| 1884 |
\pgfcirc@activate@bipole{l}{americaninductor}{americaninductor}{american inductor} |
| 1885 |
\pgfcirc@activate@bipole{l}{cuteinductor}{cuteinductor}{cute inductor} |
| 1886 |
|
| 1887 |
\def\pgf@circ@vinductor@path#1{ |
| 1888 |
\pgfextra{ |
| 1889 |
\edef\pgf@circ@temp{\ctikzvalof{inductor}}% |
| 1890 |
\def\pgf@temp{european}% |
| 1891 |
} |
| 1892 |
\ifx\pgf@temp\pgf@circ@temp% |
| 1893 |
\pgf@circ@veuropeaninductor@path{#1}% |
| 1894 |
\else% |
| 1895 |
\pgfextra{ \def\pgf@temp{cute} }% |
| 1896 |
\ifx\pgf@temp\pgf@circ@temp% |
| 1897 |
\pgf@circ@vcuteinductor@path{#1}% |
| 1898 |
\else% |
| 1899 |
\pgf@circ@vamericaninductor@path{#1}% |
| 1900 |
\fi% |
| 1901 |
\fi% |
| 1902 |
} |
| 1903 |
\pgfcirc@path@to@style{l}{vinductor}{variable inductor}{} |
| 1904 |
\pgfcirc@style@to@style{variable inductor}{vL} |
| 1905 |
\pgfcirc@activate@bipole{l}{veuropeaninductor}{tfullgeneric}{variable european inductor} |
| 1906 |
\pgfcirc@activate@bipole{l}{vamericaninductor}{vamericaninductor}{variable american inductor} |
| 1907 |
\pgfcirc@activate@bipole{l}{vcuteinductor}{vcuteinductor}{variable cute inductor} |
| 1908 |
|
| 1909 |
\def\pgf@circ@inductivesens@path#1{% |
| 1910 |
\pgfextra{ |
| 1911 |
\edef\pgf@circ@temp{\ctikzvalof{inductor}}% |
| 1912 |
\def\pgf@temp{european}% |
| 1913 |
} |
| 1914 |
\ifx\pgf@temp\pgf@circ@temp% |
| 1915 |
\pgf@circ@europeaninductivesens@path{#1}% |
| 1916 |
\else% |
| 1917 |
\pgfextra{ \def\pgf@temp{cute} }% |
| 1918 |
\ifx\pgf@temp\pgf@circ@temp% |
| 1919 |
\pgf@circ@cuteinductivesens@path{#1}% |
| 1920 |
\else% |
| 1921 |
\pgf@circ@americaninductivesens@path{#1}% |
| 1922 |
\fi% |
| 1923 |
\fi% |
| 1924 |
} |
| 1925 |
\pgfcirc@path@to@style{l}{inductivesens}{inductive sensor}{} |
| 1926 |
\pgfcirc@style@to@style{inductive sensor}{sL} |
| 1927 |
\pgfcirc@activate@bipole{l}{europeaninductivesens}{sfullgeneric}{european inductive sensor} |
| 1928 |
\pgfcirc@activate@bipole{l}{americaninductivesens}{samericaninductor}{american inductive sensor} |
| 1929 |
\pgfcirc@activate@bipole{l}{cuteinductivesens}{scuteinductor}{cute inductive sensor} |
| 1930 |
|
| 1931 |
\pgfcirc@activate@bipole{l}{cutechoke}{cutechoke}{cute choke} |
| 1932 |
% %>>> |
| 1933 |
|
| 1934 |
%%%%%%%%%%% |
| 1935 |
%% Sources (batteries, independent, dependents and so on |
| 1936 |
%%%%%%%%%%% |
| 1937 |
|
| 1938 |
% Definitions for Sources%<<<1 |
| 1939 |
|
| 1940 |
\ctikzset{bipoles/esource/height/.initial=.60} |
| 1941 |
\ctikzset{bipoles/esource/width/.initial=.60} |
| 1942 |
\ctikzset{bipoles/pvsource/height/.initial=.60} |
| 1943 |
\ctikzset{bipoles/pvsource/width/.initial=.60} |
| 1944 |
\ctikzset{bipoles/pvmodule/height/.initial=.60} |
| 1945 |
\ctikzset{bipoles/pvmodule/width/.initial=1.20} |
| 1946 |
\ctikzset{bipoles/isource/height/.initial=.60} |
| 1947 |
\ctikzset{bipoles/isource/width/.initial=.60} |
| 1948 |
\ctikzset{bipoles/dcisource/angle/.initial=80} |
| 1949 |
\ctikzset{bipoles/dcisource/height/.initial=.60} |
| 1950 |
\ctikzset{bipoles/dcisource/width/.initial=.60} |
| 1951 |
\ctikzset{bipoles/dcvsource/height/.initial=.60} |
| 1952 |
\ctikzset{bipoles/dcvsource/width/.initial=.60} |
| 1953 |
\ctikzset{bipoles/vsourcetri/height/.initial=.60} |
| 1954 |
\ctikzset{bipoles/vsourcetri/width/.initial=.60} |
| 1955 |
\ctikzset{bipoles/isourceam/height/.initial=.60} |
| 1956 |
\ctikzset{bipoles/isourceam/width/.initial=.60} |
| 1957 |
\ctikzset{bipoles/vsource/height/.initial=.60} |
| 1958 |
\ctikzset{bipoles/vsource/width/.initial=.60} |
| 1959 |
\ctikzset{bipoles/vsourceam/height/.initial=.60} |
| 1960 |
\ctikzset{bipoles/vsourceam/width/.initial=.60} |
| 1961 |
\ctikzset{bipoles/vsourceam/margin/.initial=.7} |
| 1962 |
\ctikzset{bipoles/isourcesin/angle/.initial=90} |
| 1963 |
\ctikzset{bipoles/isourcesin/height/.initial=.60} |
| 1964 |
\ctikzset{bipoles/isourcesin/width/.initial=.60} |
| 1965 |
\ctikzset{bipoles/vsourcesin/height/.initial=.60} |
| 1966 |
\ctikzset{bipoles/vsourcesin/width/.initial=.60} |
| 1967 |
\ctikzset{bipoles/vsourcesquare/height/.initial=.60} |
| 1968 |
\ctikzset{bipoles/vsourcesquare/width/.initial=.60} |
| 1969 |
\ctikzset{bipoles/cisource/height/.initial=.7} |
| 1970 |
\ctikzset{bipoles/cisource/width/.initial=.7} |
| 1971 |
\ctikzset{bipoles/cisourceam/height/.initial=.7} |
| 1972 |
\ctikzset{bipoles/cisourceam/width/.initial=.7} |
| 1973 |
\ctikzset{bipoles/ecsource/height/.initial=.7} |
| 1974 |
\ctikzset{bipoles/ecsource/width/.initial=.7} |
| 1975 |
\ctikzset{bipoles/cvsource/height/.initial=.7} |
| 1976 |
\ctikzset{bipoles/cvsource/width/.initial=.7} |
| 1977 |
\ctikzset{bipoles/cvsourceam/height/.initial=.7} |
| 1978 |
\ctikzset{bipoles/cvsourceam/width/.initial=.7} |
| 1979 |
\ctikzset{bipoles/cvsourceam/margin/.initial=.7} |
| 1980 |
\ctikzset{bipoles/cvsourceam/text scale/.initial=1} |
| 1981 |
\ctikzset{bipoles/cisourcesin/width/.initial=.7} |
| 1982 |
\ctikzset{bipoles/cvsourcesin/height/.initial=.7} |
| 1983 |
\ctikzset{bipoles/cvsourcesin/width/.initial=.7} |
| 1984 |
\ctikzset{bipoles/battery/height/.initial=.6} |
| 1985 |
\ctikzset{bipoles/battery/width/.initial=.3} |
| 1986 |
\ctikzset{bipoles/battery1/height/.initial=.6} |
| 1987 |
\ctikzset{bipoles/battery1/width/.initial=.3} |
| 1988 |
\ctikzset{bipoles/battery2/height/.initial=.6} |
| 1989 |
\ctikzset{bipoles/battery2/width/.initial=.3} |
| 1990 |
\ctikzset{bipoles/solar/height/.initial=.6} |
| 1991 |
\ctikzset{bipoles/solar/width/.initial=.3} |
| 1992 |
|
| 1993 |
% noise sources |
| 1994 |
\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50} |
| 1995 |
|
| 1996 |
% for special symbols in the sources: sin, square, triangle, delta, wye, eyw, zig, etc. |
| 1997 |
\ctikzset{sources/symbol/thickness/.initial={1}} |
| 1998 |
\ctikzset{csources/symbol/thickness/.initial={1}} |
| 1999 |
\ctikzset{sources/symbol/rotate/.initial={90}} |
| 2000 |
\ctikzset{csources/symbol/rotate/.initial={90}} |
| 2001 |
|
| 2002 |
% % % basic oosources |
| 2003 |
\ctikzset{bipoles/oosource/height/.initial=.39} % 0.65*0.6 to maintain the original size |
| 2004 |
\ctikzset{bipoles/oosource/width/.initial=.60} |
| 2005 |
% this is only needed to fix a horrible code in one example of the manual before v1.8.3 |
| 2006 |
\ctikzset{bipoles/oosource/circlesize/.code={% |
| 2007 |
\pgfmathsetmacro{\@@hack@oo@h}{0.6*#1}\ctikzset{bipoles/oosource/height=\@@hack@oo@h} |
| 2008 |
\pgfutil@packagewarning{circuitikz}{Do not use circlesize with oo-style source! Use width and height} |
| 2009 |
}} |
| 2010 |
\ctikzset{bipoles/oosource/circleoffset/.code={% |
| 2011 |
\pgfmathsetmacro{\@@hack@oo@w}{0.6*#1+0.3}\ctikzset{bipoles/oosource/width=\@@hack@oo@w} |
| 2012 |
\pgfutil@packagewarning{circuitikz}{Do not use circleoffset with oo-style source! Use width and height} |
| 2013 |
}} |
| 2014 |
|
| 2015 |
% % % oo autotransformer |
| 2016 |
\ctikzset{bipoles/oosourceatrans/height/.initial=.36} |
| 2017 |
\ctikzset{bipoles/oosourceatrans/width/.initial=.5} |
| 2018 |
% the number here is, for compatibility, (0.6/0.36)**2*1.2 |
| 2019 |
\ctikzset{bipoles/oosourceatrans/vectorgroupscale/.initial=3.33}% better if it's a bit bigger |
| 2020 |
|
| 2021 |
% % % ootransformer |
| 2022 |
\ctikzset{bipoles/oosourcetrans/height/.initial=.36} |
| 2023 |
\ctikzset{bipoles/oosourcetrans/width/.initial=.6} |
| 2024 |
% the number here is, for compatibility, (0.6/0.36)**2 |
| 2025 |
\ctikzset{bipoles/oosourcetrans/vectorgroupscale/.initial=2.78} |
| 2026 |
\ctikzset{bipoles/oosourcetrans/vectorgroupoffset/.initial=0.6} |
| 2027 |
|
| 2028 |
% % % oootransformer |
| 2029 |
\ctikzset{bipoles/ooosource/height/.initial=.6} |
| 2030 |
\ctikzset{bipoles/ooosource/width/.initial=.5640} % the h and w are TIGHTLY related! |
| 2031 |
\ctikzset{bipoles/ooosource/vectorgroupscale/.initial=1} |
| 2032 |
\ctikzset{bipoles/oosourcetrans/vectorgroupoffset/.initial=0.6} |
| 2033 |
|
| 2034 |
%%% key to change size globally |
| 2035 |
\ctikzset{ootrans size/.is choice} |
| 2036 |
\ctikzset{ootrans size/small/.code={% |
| 2037 |
\ctikzset{bipoles/oosourceatrans/height/.initial=.36}% |
| 2038 |
\ctikzset{bipoles/oosourceatrans/width/.initial=.5}% |
| 2039 |
\ctikzset{bipoles/oosourcetrans/height/.initial=.36}% |
| 2040 |
\ctikzset{bipoles/oosourcetrans/width/.initial=.6}% |
| 2041 |
\ctikzset{bipoles/ooosource/height/.initial=.6}% |
| 2042 |
\ctikzset{bipoles/ooosource/width/.initial=.5640}% |
| 2043 |
} |
| 2044 |
} |
| 2045 |
\ctikzset{ootrans size/large/.code={% |
| 2046 |
\ctikzset{bipoles/oosourceatrans/height/.initial=.6}% |
| 2047 |
\ctikzset{bipoles/oosourceatrans/width/.initial=.83333}% |
| 2048 |
\ctikzset{bipoles/oosourcetrans/height/.initial=.6}% |
| 2049 |
\ctikzset{bipoles/oosourcetrans/width/.initial=.83333}% |
| 2050 |
\ctikzset{bipoles/ooosource/height/.initial=1.0909}% |
| 2051 |
\ctikzset{bipoles/ooosource/width/.initial=1.0255}% |
| 2052 |
} |
| 2053 |
} |
| 2054 |
|
| 2055 |
|
| 2056 |
% % % primary windings |
| 2057 |
\newif\ifpgf@circ@prim@delta |
| 2058 |
\newif\ifpgf@circ@prim@wye |
| 2059 |
\newif\ifpgf@circ@prim@eyw |
| 2060 |
\newif\ifpgf@circ@prim@zig |
| 2061 |
\pgfkeys{tikz/prim/.is choice} |
| 2062 |
\pgfkeys{tikz/prim/delta/.add code={}{\pgf@circ@prim@deltatrue}} |
| 2063 |
\pgfkeys{tikz/prim/wye/.add code={}{\pgf@circ@prim@wyetrue}} |
| 2064 |
\pgfkeys{tikz/prim/eyw/.add code={}{\pgf@circ@prim@eywtrue}} |
| 2065 |
\pgfkeys{tikz/prim/zig/.add code={}{\pgf@circ@prim@zigtrue}} |
| 2066 |
|
| 2067 |
% % % secondary windings |
| 2068 |
\newif\ifpgf@circ@sec@delta |
| 2069 |
\newif\ifpgf@circ@sec@wye |
| 2070 |
\newif\ifpgf@circ@sec@eyw |
| 2071 |
\newif\ifpgf@circ@sec@zig |
| 2072 |
\pgfkeys{tikz/sec/.is choice} |
| 2073 |
\pgfkeys{tikz/sec/delta/.add code={}{\pgf@circ@sec@deltatrue}} |
| 2074 |
\pgfkeys{tikz/sec/wye/.add code={}{\pgf@circ@sec@wyetrue}} |
| 2075 |
\pgfkeys{tikz/sec/eyw/.add code={}{\pgf@circ@sec@eywtrue}} |
| 2076 |
\pgfkeys{tikz/sec/zig/.add code={}{\pgf@circ@sec@zigtrue}} |
| 2077 |
|
| 2078 |
% % % tertiary windings (ooosource) |
| 2079 |
\newif\ifpgf@circ@tert@delta |
| 2080 |
\newif\ifpgf@circ@tert@wye |
| 2081 |
\newif\ifpgf@circ@tert@eyw |
| 2082 |
\newif\ifpgf@circ@tert@zig |
| 2083 |
\pgfkeys{tikz/tert/.is choice} |
| 2084 |
\pgfkeys{tikz/tert/delta/.add code={}{\pgf@circ@tert@deltatrue}} |
| 2085 |
\pgfkeys{tikz/tert/wye/.add code={}{\pgf@circ@tert@wyetrue}} |
| 2086 |
\pgfkeys{tikz/tert/eyw/.add code={}{\pgf@circ@tert@eywtrue}} |
| 2087 |
\pgfkeys{tikz/tert/zig/.add code={}{\pgf@circ@tert@zigtrue}}% |
| 2088 |
|
| 2089 |
% % % additional winding for oosource[a]trans |
| 2090 |
\newif\ifpgf@circ@ooupperwinding |
| 2091 |
\pgfkeys{tikz/oo upper winding/.code={\pgf@circ@ooupperwindingtrue% |
| 2092 |
\ctikzset{bipoles/oosourcetrans/upper circle size=#1}% |
| 2093 |
}} |
| 2094 |
\pgfkeys{tikz/oo upper winding/.default=\ctikzvalof{bipoles/oosourcetrans/upper circle size default}} |
| 2095 |
\ctikzset{bipoles/oosourcetrans/upper circle size/.initial=.7} |
| 2096 |
\ctikzset{bipoles/oosourcetrans/upper circle size default/.initial=.7} |
| 2097 |
% the default for the upper position is chosen so that it seems more or less |
| 2098 |
% the same as a rotated ooosource |
| 2099 |
\ctikzset{bipoles/oosourcetrans/upper circle offset/.initial=1.3} |
| 2100 |
\newif\ifpgf@circ@upper@delta |
| 2101 |
\newif\ifpgf@circ@upper@wye |
| 2102 |
\newif\ifpgf@circ@upper@eyw |
| 2103 |
\newif\ifpgf@circ@upper@zig |
| 2104 |
\pgfkeys{tikz/upper/.is choice} |
| 2105 |
\pgfkeys{tikz/upper/delta/.add code={}{\pgf@circ@upper@deltatrue}} |
| 2106 |
\pgfkeys{tikz/upper/wye/.add code={}{\pgf@circ@upper@wyetrue}} |
| 2107 |
\pgfkeys{tikz/upper/eyw/.add code={}{\pgf@circ@upper@eywtrue}} |
| 2108 |
\pgfkeys{tikz/upper/zig/.add code={}{\pgf@circ@upper@zigtrue}}% |
| 2109 |
|
| 2110 |
% nullator and norator |
| 2111 |
\ctikzset{bipoles/nullator/height/.initial=.30} |
| 2112 |
\ctikzset{bipoles/nullator/width/.initial=.60} |
| 2113 |
\ctikzset{bipoles/norator/height/.initial=.25} |
| 2114 |
\ctikzset{bipoles/norator/width/.initial=.60}%must be greater than 2*height |
| 2115 |
|
| 2116 |
%%>>> |
| 2117 |
|
| 2118 |
%% Nodes definitions for sources%<<< |
| 2119 |
|
| 2120 |
%% Battery |
| 2121 |
\pgfcircdeclarebipolescaled{batteries} |
| 2122 |
{} |
| 2123 |
{\ctikzvalof{bipoles/battery/height}} |
| 2124 |
{battery} |
| 2125 |
{\ctikzvalof{bipoles/battery/height}} |
| 2126 |
{\ctikzvalof{bipoles/battery/width}} |
| 2127 |
{ |
| 2128 |
\pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen |
| 2129 |
\divide \pgf@circ@res@step by 6 |
| 2130 |
|
| 2131 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2132 |
|
| 2133 |
\ifpgf@circ@fixbatteries |
| 2134 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} |
| 2135 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} |
| 2136 |
|
| 2137 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 2138 |
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 2139 |
|
| 2140 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@up}} |
| 2141 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.5\pgf@circ@res@down}} |
| 2142 |
|
| 2143 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2144 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2145 |
\else |
| 2146 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 2147 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 2148 |
|
| 2149 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}} |
| 2150 |
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}} |
| 2151 |
|
| 2152 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 2153 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 2154 |
|
| 2155 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 2156 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}} |
| 2157 |
\fi |
| 2158 |
\pgfusepath{draw} |
| 2159 |
} |
| 2160 |
|
| 2161 |
|
| 2162 |
%% Battery 1 % poles with equl thickness |
| 2163 |
|
| 2164 |
\pgfcircdeclarebipolescaled{batteries} |
| 2165 |
{} |
| 2166 |
{\ctikzvalof{bipoles/battery1/height}} |
| 2167 |
{battery1} |
| 2168 |
{\ctikzvalof{bipoles/battery1/height}} |
| 2169 |
{\ctikzvalof{bipoles/battery1/width}} |
| 2170 |
{ |
| 2171 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} |
| 2172 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} |
| 2173 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}} |
| 2174 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2175 |
\pgfusepath{draw} |
| 2176 |
|
| 2177 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2178 |
\ifpgf@circ@fixbatteries |
| 2179 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2180 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2181 |
|
| 2182 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}} |
| 2183 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}} |
| 2184 |
\else |
| 2185 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 2186 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}} |
| 2187 |
|
| 2188 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 2189 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 2190 |
\fi |
| 2191 |
\pgfusepath{draw} |
| 2192 |
} |
| 2193 |
|
| 2194 |
%% Battery 2 % negative pole thicker |
| 2195 |
|
| 2196 |
\pgfcircdeclarebipolescaled{batteries} |
| 2197 |
{} |
| 2198 |
{\ctikzvalof{bipoles/battery2/height}} |
| 2199 |
{battery2} |
| 2200 |
{\ctikzvalof{bipoles/battery2/height}} |
| 2201 |
{\ctikzvalof{bipoles/battery2/width}} |
| 2202 |
{ |
| 2203 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} |
| 2204 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} |
| 2205 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}} |
| 2206 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2207 |
\pgfusepath{draw} |
| 2208 |
|
| 2209 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2210 |
\ifpgf@circ@fixbatteries |
| 2211 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2212 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2213 |
\pgfusepath{draw} |
| 2214 |
\pgfsetlinewidth{3\pgflinewidth} |
| 2215 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}} |
| 2216 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}} |
| 2217 |
\else |
| 2218 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 2219 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 2220 |
\pgfusepath{draw} |
| 2221 |
\pgfsetlinewidth{3\pgflinewidth} |
| 2222 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 2223 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}} |
| 2224 |
\fi |
| 2225 |
\pgfusepath{draw} |
| 2226 |
} |
| 2227 |
|
| 2228 |
% Solar cell |
| 2229 |
\pgfcircdeclarebipolescaled{batteries} |
| 2230 |
{} |
| 2231 |
{\ctikzvalof{bipoles/solar/height}} |
| 2232 |
{solar} |
| 2233 |
{\ctikzvalof{bipoles/solar/height}} |
| 2234 |
{\ctikzvalof{bipoles/solar/width}} |
| 2235 |
{ |
| 2236 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} |
| 2237 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} |
| 2238 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}} |
| 2239 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2240 |
\pgfusepath{draw} |
| 2241 |
|
| 2242 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2243 |
\ifpgf@circ@fixbatteries |
| 2244 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2245 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2246 |
\pgfusepath{draw} |
| 2247 |
\pgfsetlinewidth{3\pgflinewidth} |
| 2248 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}} |
| 2249 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}} |
| 2250 |
\else |
| 2251 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 2252 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 2253 |
\pgfusepath{draw} |
| 2254 |
\pgfsetlinewidth{3\pgflinewidth} |
| 2255 |
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 2256 |
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}} |
| 2257 |
\fi |
| 2258 |
|
| 2259 |
\pgfusepath{draw} |
| 2260 |
\pgf@circ@draw@pdarrows |
| 2261 |
} |
| 2262 |
|
| 2263 |
%%% |
| 2264 |
%%% https://xkcd.com/2818/ |
| 2265 |
%%% Also https://chat.stackexchange.com/transcript/message/64238058#64238058 |
| 2266 |
%%% |
| 2267 |
\pgfcircdeclarebipolescaled{batteries} |
| 2268 |
{} |
| 2269 |
{\ctikzvalof{bipoles/battery/height}} |
| 2270 |
{baertty} |
| 2271 |
{\ctikzvalof{bipoles/battery/height}} |
| 2272 |
{\ctikzvalof{bipoles/battery/width}} |
| 2273 |
{ |
| 2274 |
\pgf@circ@res@step = \ctikzvalof{bipoles/battery/width}\pgf@circ@scaled@Rlen |
| 2275 |
\divide \pgf@circ@res@step by 6 |
| 2276 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2277 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} |
| 2278 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} |
| 2279 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@up}} |
| 2280 |
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@step}{.5\pgf@circ@res@down}} |
| 2281 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 2282 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 2283 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2284 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2285 |
\pgfusepath{draw} |
| 2286 |
} |
| 2287 |
\pgfcirc@activate@bipole@simple@opt{v}{baertty}{\circuitikzbasekey/bipole/is voltage=true, |
| 2288 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 2289 |
|
| 2290 |
%%%%%%%%%%% |
| 2291 |
%% Round and diamond sources |
| 2292 |
%%%%%%%%%%% |
| 2293 |
|
| 2294 |
% % % symbol drawing macros (NOT for delta, wye, eyw, zig) |
| 2295 |
\def\pgf@circ@sources@symbol@setup{% called in a pgfscope |
| 2296 |
\edef\@@@auto{auto}\edef\@@@rotate{\ctikzvalof{\ctikzclass/symbol/rotate}} |
| 2297 |
\ifx\@@@auto\@@@rotate |
| 2298 |
\pgfgettransformentries\a\b\temp\temp\temp\temp |
| 2299 |
\pgfmathsetmacro{\@@@rotate}{-atan2(\b,\a)} |
| 2300 |
\fi |
| 2301 |
\pgftransformrotate{\@@@rotate}% |
| 2302 |
\pgf@circ@set@relative@thickness{symbol/thickness}% |
| 2303 |
} |
| 2304 |
|
| 2305 |
%% Independent voltage source |
| 2306 |
\pgfcircdeclarebipolescaled{sources} |
| 2307 |
{} |
| 2308 |
{\ctikzvalof{bipoles/vsource/height}} |
| 2309 |
{vsource} |
| 2310 |
{\ctikzvalof{bipoles/vsource/height}} |
| 2311 |
{\ctikzvalof{bipoles/vsource/width}} |
| 2312 |
{ |
| 2313 |
|
| 2314 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2315 |
|
| 2316 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2317 |
\pgf@circ@draworfill |
| 2318 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 2319 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 2320 |
\pgfusepath{draw} |
| 2321 |
} |
| 2322 |
|
| 2323 |
|
| 2324 |
%% macros for the sources with plus and minus internally |
| 2325 |
%% To change the internal symbols of the voltage source american style |
| 2326 |
\ctikzset{bipoles/vsourceam/inner plus/.initial={$+$}} |
| 2327 |
% In the mayority of fonts, the size of - is smaller than +, so we have |
| 2328 |
% unaligned signs when positioned independently. |
| 2329 |
% See https://github.com/circuitikz/circuitikz/issues/721 |
| 2330 |
\ctikzset{bipoles/vsourceam/inner minus/.initial={$\vphantom{+}-$}} |
| 2331 |
%% |
| 2332 |
%% add the possibility to change the orientation of signs |
| 2333 |
\ctikzset{sources/symbol/sign rotation/.initial=default}% default, auto, or value |
| 2334 |
%% this should be more or less equivalent to \ctikzset{sources/symbol/sign rotation=90}, but it's font-dependent, |
| 2335 |
%% so you never know. Let's keep the traditional one here. |
| 2336 |
\def\pgf@circ@vsources@signs@default{% |
| 2337 |
\ifpgf@circ@oldvoltagedirection |
| 2338 |
\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner plus}}% |
| 2339 |
\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{\ctikzvalof{bipoles/vsourceam/inner minus}}% |
| 2340 |
\else |
| 2341 |
\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner minus}}% |
| 2342 |
\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{\ctikzvalof{bipoles/vsourceam/inner plus}}% |
| 2343 |
\fi |
| 2344 |
} |
| 2345 |
\def\pgf@circ@vsources@sign@auto@or@fix{% |
| 2346 |
\pgfgettransformentries\a\b\temp\temp\temp\temp |
| 2347 |
\pgfmathsetmacro{\rot}{-atan2(\b,\a)} |
| 2348 |
% the distance here is choosen so that it seems ok with standard fonts... probably, it must be changed. |
| 2349 |
\pgfmathsetlength{\pgf@circ@res@temp}{% |
| 2350 |
\ctikzvalof{bipoles/vsourceam/margin}*\pgf@circ@res@up |
| 2351 |
-0.5*height("\ctikzvalof{bipoles/vsourceam/inner plus}")} |
| 2352 |
\ifx\@@rotmode\@@auto |
| 2353 |
\pgfmathsetmacro{\innerrot}{abs(\rot)<46?0:(abs(\rot)>134?0:90)} |
| 2354 |
\else |
| 2355 |
\ifx\@@rotmode\@@straight |
| 2356 |
\pgfmathsetmacro{\innerrot}{\rot} |
| 2357 |
\else |
| 2358 |
\pgfmathsetmacro{\innerrot}{\@@rotmode} |
| 2359 |
\fi |
| 2360 |
\fi |
| 2361 |
\ifpgf@circ@oldvoltagedirection |
| 2362 |
\pgfscope |
| 2363 |
\pgftransformxshift{\pgf@circ@res@temp} |
| 2364 |
\pgftext[rotate=\innerrot]{\ctikzvalof{bipoles/vsourceam/inner plus}} |
| 2365 |
\endpgfscope |
| 2366 |
\pgfscope |
| 2367 |
\pgftransformxshift{-\pgf@circ@res@temp} |
| 2368 |
\pgftext[rotate=\innerrot]{\ctikzvalof{bipoles/vsourceam/inner minus}} |
| 2369 |
\endpgfscope |
| 2370 |
\else |
| 2371 |
\pgfscope |
| 2372 |
\pgftransformxshift{\pgf@circ@res@temp} |
| 2373 |
\pgftext[rotate=\innerrot]{\ctikzvalof{bipoles/vsourceam/inner minus}} |
| 2374 |
\endpgfscope |
| 2375 |
\pgfscope |
| 2376 |
\pgftransformxshift{-\pgf@circ@res@temp} |
| 2377 |
\pgftext[rotate=\innerrot]{\ctikzvalof{bipoles/vsourceam/inner plus}} |
| 2378 |
\endpgfscope |
| 2379 |
\fi |
| 2380 |
} |
| 2381 |
\def\pgf@circ@vsources@draw@signs{% |
| 2382 |
\edef\@@auto{auto}\edef\@@default{default}\edef\@@straight{straight}% |
| 2383 |
\edef\@@rotmode{\ctikzvalof{sources/symbol/sign rotation}}% |
| 2384 |
\ifx\@@rotmode\@@default |
| 2385 |
\pgf@circ@vsources@signs@default |
| 2386 |
\else |
| 2387 |
\pgf@circ@vsources@sign@auto@or@fix |
| 2388 |
\fi |
| 2389 |
} |
| 2390 |
|
| 2391 |
%% Independent voltage source - American style |
| 2392 |
\pgfcircdeclarebipolescaled{sources} |
| 2393 |
{} |
| 2394 |
{\ctikzvalof{bipoles/vsourceam/height}} |
| 2395 |
{vsourceAM} |
| 2396 |
{\ctikzvalof{bipoles/vsourceam/height}} |
| 2397 |
{\ctikzvalof{bipoles/vsourceam/width}} |
| 2398 |
{ |
| 2399 |
|
| 2400 |
\pgfscope |
| 2401 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2402 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2403 |
\pgf@circ@draworfill |
| 2404 |
\endpgfscope |
| 2405 |
\pgf@circ@text@strokecolor |
| 2406 |
\pgf@circ@vsources@draw@signs |
| 2407 |
} |
| 2408 |
|
| 2409 |
%% Independent sinusoidal voltage source |
| 2410 |
\pgfcircdeclarebipolescaled{sources} |
| 2411 |
{} |
| 2412 |
{\ctikzvalof{bipoles/vsourcesin/height}} |
| 2413 |
{vsourcesin} |
| 2414 |
{\ctikzvalof{bipoles/vsourcesin/height}} |
| 2415 |
{\ctikzvalof{bipoles/vsourcesin/width}} |
| 2416 |
{ |
| 2417 |
|
| 2418 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2419 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2420 |
\pgf@circ@draworfill |
| 2421 |
|
| 2422 |
\pgf@circ@res@up = .5\pgf@circ@res@up |
| 2423 |
\pgfscope |
| 2424 |
\pgf@circ@sources@symbol@setup |
| 2425 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} |
| 2426 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 2427 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 2428 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 2429 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 2430 |
\pgfusepath{draw} |
| 2431 |
\endpgfscope |
| 2432 |
} |
| 2433 |
|
| 2434 |
% Square Voltage source - contributed by Alistair Kwan |
| 2435 |
\pgfcircdeclarebipolescaled{sources} |
| 2436 |
{} |
| 2437 |
{\ctikzvalof{bipoles/vsourcesquare/height}} |
| 2438 |
{vsourcesquare} |
| 2439 |
{\ctikzvalof{bipoles/vsourcesquare/height}} |
| 2440 |
{\ctikzvalof{bipoles/vsourcesquare/width}} |
| 2441 |
{ |
| 2442 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2443 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2444 |
\pgf@circ@draworfill |
| 2445 |
\pgf@circ@res@up = .5\pgf@circ@res@up |
| 2446 |
\pgfscope |
| 2447 |
\pgf@circ@sources@symbol@setup |
| 2448 |
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} |
| 2449 |
\pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}} |
| 2450 |
\pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}} |
| 2451 |
\pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{-1\pgf@circ@res@up}} |
| 2452 |
\pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{-1\pgf@circ@res@up}} |
| 2453 |
\pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} |
| 2454 |
\pgfusepath{draw} |
| 2455 |
\endpgfscope |
| 2456 |
} |
| 2457 |
|
| 2458 |
% Triangle Voltage source - contributed by Ralf Farkas |
| 2459 |
\pgfcircdeclarebipolescaled{sources} |
| 2460 |
{} |
| 2461 |
{\ctikzvalof{bipoles/vsourcetri/height}} |
| 2462 |
{vsourcetri} |
| 2463 |
{\ctikzvalof{bipoles/vsourcetri/height}} |
| 2464 |
{\ctikzvalof{bipoles/vsourcetri/width}} |
| 2465 |
{ |
| 2466 |
|
| 2467 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2468 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2469 |
\pgf@circ@draworfill |
| 2470 |
|
| 2471 |
\pgf@circ@res@up = .5\pgf@circ@res@up |
| 2472 |
\pgfscope |
| 2473 |
\pgf@circ@sources@symbol@setup |
| 2474 |
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}} |
| 2475 |
\pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}} |
| 2476 |
\pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}} |
| 2477 |
\pgfpathlineto{\pgfpoint{1\pgf@circ@res@up}{0\pgf@circ@res@up}} |
| 2478 |
\pgfusepath{draw} |
| 2479 |
\endpgfscope |
| 2480 |
} |
| 2481 |
|
| 2482 |
%% PV Source |
| 2483 |
\pgfcircdeclarebipolescaled{sources} |
| 2484 |
{} |
| 2485 |
{\ctikzvalof{bipoles/pvsource/height}} |
| 2486 |
{pvsource} |
| 2487 |
{\ctikzvalof{bipoles/pvsource/height}} |
| 2488 |
{\ctikzvalof{bipoles/pvsource/width}} |
| 2489 |
{ |
| 2490 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2491 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2492 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 2493 |
\pgf@circ@draworfill |
| 2494 |
|
| 2495 |
\pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{0}} |
| 2496 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} |
| 2497 |
\pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{0}} |
| 2498 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2499 |
\pgfusepath{draw} |
| 2500 |
|
| 2501 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2502 |
\pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@up}} |
| 2503 |
\pgfpathlineto{\pgfpoint{.15\pgf@circ@res@left}{.4\pgf@circ@res@down}} |
| 2504 |
|
| 2505 |
\pgfpathmoveto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@up}} |
| 2506 |
\pgfpathlineto{\pgfpoint{.15\pgf@circ@res@right}{.6\pgf@circ@res@down}} |
| 2507 |
\pgfusepath{draw} |
| 2508 |
|
| 2509 |
%Arrow Part |
| 2510 |
\pgfscope |
| 2511 |
\pgfsetarrowsend{latex} |
| 2512 |
\pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}} |
| 2513 |
\pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf@circ@res@left}{0}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}} |
| 2514 |
\pgfusepath{draw} |
| 2515 |
\pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{2.2\pgf@circ@res@up}}} |
| 2516 |
\pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf@circ@res@up}}{\pgfpointpolar{-45}{1.3\pgf@circ@res@up}}} |
| 2517 |
\pgfusepath{draw} |
| 2518 |
\endpgfscope |
| 2519 |
|
| 2520 |
} |
| 2521 |
|
| 2522 |
%% PV Module - contributed by Andre Alves |
| 2523 |
\pgfcircdeclarebipolescaled{sources} |
| 2524 |
{} |
| 2525 |
{\ctikzvalof{bipoles/pvmodule/height}} |
| 2526 |
{pvmodule} |
| 2527 |
{\ctikzvalof{bipoles/pvmodule/height}} |
| 2528 |
{\ctikzvalof{bipoles/pvmodule/width}} |
| 2529 |
{ |
| 2530 |
|
| 2531 |
% Draw rectangle |
| 2532 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2533 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2534 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2535 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 2536 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 2537 |
\pgfpathclose |
| 2538 |
\pgf@circ@draworfill |
| 2539 |
|
| 2540 |
% Draw triangle |
| 2541 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2542 |
\pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0}} |
| 2543 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2544 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 2545 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 2546 |
\pgf@circ@draworfill |
| 2547 |
\pgfusepath{draw} |
| 2548 |
} |
| 2549 |
|
| 2550 |
%% Empty Source |
| 2551 |
\pgfcircdeclarebipolescaled{sources} |
| 2552 |
{} |
| 2553 |
{\ctikzvalof{bipoles/esource/height}} |
| 2554 |
{esource} |
| 2555 |
{\ctikzvalof{bipoles/esource/height}} |
| 2556 |
{\ctikzvalof{bipoles/esource/width}} |
| 2557 |
{ |
| 2558 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2559 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2560 |
\pgf@circ@draworfill |
| 2561 |
} |
| 2562 |
|
| 2563 |
%% DC Current Source with open shape |
| 2564 |
\pgfcircdeclarebipolescaled{sources} |
| 2565 |
{} |
| 2566 |
{\ctikzvalof{bipoles/dcisource/height}} |
| 2567 |
{dcisource} |
| 2568 |
{\ctikzvalof{bipoles/dcisource/height}} |
| 2569 |
{\ctikzvalof{bipoles/dcisource/width}} |
| 2570 |
{ |
| 2571 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2572 |
\pgfpathmoveto{\pgfpointorigin} |
| 2573 |
\pgfscope |
| 2574 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2575 |
\pgf@circ@maybefill |
| 2576 |
\endpgfscope |
| 2577 |
\edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}} |
| 2578 |
\pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}} |
| 2579 |
\pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up} |
| 2580 |
\pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}} |
| 2581 |
\pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up} |
| 2582 |
\pgfusepath{draw} |
| 2583 |
|
| 2584 |
\pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 2585 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 2586 |
\pgfusepath{draw} |
| 2587 |
\pgfscope |
| 2588 |
\pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 2589 |
\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} |
| 2590 |
\endpgfscope |
| 2591 |
} |
| 2592 |
|
| 2593 |
%% DC-Voltage source |
| 2594 |
\pgfcircdeclarebipolescaled{sources} |
| 2595 |
{} |
| 2596 |
{\ctikzvalof{bipoles/dcvsource/height}} |
| 2597 |
{dcvsource} |
| 2598 |
{\ctikzvalof{bipoles/dcvsource/height}} |
| 2599 |
{\ctikzvalof{bipoles/dcvsource/width}} |
| 2600 |
{ |
| 2601 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2602 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2603 |
\pgf@circ@draworfill |
| 2604 |
\pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@left}} |
| 2605 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{.5\pgf@circ@res@right}} |
| 2606 |
\pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@left}} |
| 2607 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@down}{.5\pgf@circ@res@right}} |
| 2608 |
\pgfusepath{draw} |
| 2609 |
} |
| 2610 |
|
| 2611 |
%% Independent current source |
| 2612 |
\pgfcircdeclarebipolescaled{sources} |
| 2613 |
{} |
| 2614 |
{\ctikzvalof{bipoles/isource/height}} |
| 2615 |
{isource} |
| 2616 |
{\ctikzvalof{bipoles/isource/height}} |
| 2617 |
{\ctikzvalof{bipoles/isource/width}} |
| 2618 |
{ |
| 2619 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2620 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2621 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 2622 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 2623 |
\pgf@circ@draworfill |
| 2624 |
} |
| 2625 |
|
| 2626 |
%% Independent double oo source |
| 2627 |
\pgfcircdeclarebipolescaled{sources} |
| 2628 |
{ |
| 2629 |
\anchor{centerprim}{ |
| 2630 |
\northeast |
| 2631 |
\advance \pgf@x by -\pgf@y \pgf@x=-\pgf@x |
| 2632 |
\pgf@y=0pt\relax |
| 2633 |
} |
| 2634 |
\anchor{centersec}{ |
| 2635 |
\northeast |
| 2636 |
\advance \pgf@x by -\pgf@y |
| 2637 |
\pgf@y=0pt\relax |
| 2638 |
} |
| 2639 |
} |
| 2640 |
{\ctikzvalof{bipoles/oosource/height}} |
| 2641 |
{oosource} |
| 2642 |
{\ctikzvalof{bipoles/oosource/height}} |
| 2643 |
{\ctikzvalof{bipoles/oosource/width}} |
| 2644 |
{ |
| 2645 |
% the offset is relative to the width (...@left/@right), and the size to the height (...@up/@down) |
| 2646 |
% the height is the circle size; the width will decide how far away the two circles are drawn |
| 2647 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2648 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{0}}{\pgf@circ@res@up} |
| 2649 |
\pgf@circ@maybefill |
| 2650 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{0}}{\pgf@circ@res@up} |
| 2651 |
\pgf@circ@draworfill |
| 2652 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{0}}{\pgf@circ@res@up} |
| 2653 |
\pgfusepath{draw} |
| 2654 |
|
| 2655 |
} |
| 2656 |
|
| 2657 |
% % % winding symbols |
| 2658 |
\ctikzset{sources/symbol/delta scale/.initial={1}} |
| 2659 |
\ctikzset{sources/symbol/wye scale/.initial={1}} |
| 2660 |
\ctikzset{sources/symbol/eyw scale/.initial={1}} |
| 2661 |
\ctikzset{sources/symbol/zig scale/.initial={1}} |
| 2662 |
\ctikzset{sources/symbol/delta rot/.initial={0}} |
| 2663 |
\ctikzset{sources/symbol/wye rot/.initial={0}} |
| 2664 |
\ctikzset{sources/symbol/eyw rot/.initial={0}} |
| 2665 |
\ctikzset{sources/symbol/zig rot/.initial={0}} |
| 2666 |
\ctikzset{sources/symbol/prim rot/.initial={0}} |
| 2667 |
\ctikzset{sources/symbol/sec rot/.initial={0}} |
| 2668 |
\ctikzset{sources/symbol/tert rot/.initial={0}} |
| 2669 |
\ctikzset{sources/symbol/upper rot/.initial={0}} |
| 2670 |
% Notice that the scale of the symbol should go with the size of the circle, which in the oo-type |
| 2671 |
% components is linked to the .../height key, which translates in ...res@up and ...res@down |
| 2672 |
% triangle |
| 2673 |
\def\pgf@circ@delta#1{ |
| 2674 |
\pgfscope |
| 2675 |
\pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/delta scale}*\pgf@circ@res@up*#1} |
| 2676 |
\pgftransformrotate{\ctikzvalof{\ctikzclass/symbol/delta rot}} |
| 2677 |
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} |
| 2678 |
\pgftransformrotate{-\pgfcircmathresult} |
| 2679 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2680 |
\pgf@circ@set@relative@thickness{symbol/thickness} |
| 2681 |
\pgfpathmoveto{\pgfpointpolar{90}{\pgf@circ@res@up}} |
| 2682 |
\pgfpathlineto{\pgfpointpolar{-30}{\pgf@circ@res@up}} |
| 2683 |
\pgfpathlineto{\pgfpointpolar{-150}{\pgf@circ@res@up}} |
| 2684 |
\pgfpathclose |
| 2685 |
\pgfusepath{stroke} |
| 2686 |
\endpgfscope |
| 2687 |
} |
| 2688 |
% star |
| 2689 |
\def\pgf@circ@wye#1{ |
| 2690 |
\pgfscope |
| 2691 |
\pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/wye scale}*\pgf@circ@res@up*#1} |
| 2692 |
\pgftransformrotate{\ctikzvalof{\ctikzclass/symbol/wye rot}} |
| 2693 |
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} |
| 2694 |
\pgftransformrotate{-\pgfcircmathresult} |
| 2695 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2696 |
\pgf@circ@set@relative@thickness{symbol/thickness} |
| 2697 |
\pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}} |
| 2698 |
\pgfpathlineto{\pgfpointorigin} |
| 2699 |
\pgfpathlineto{\pgfpointpolar{-30}{\pgf@circ@res@down}} |
| 2700 |
\pgfpathmoveto{\pgfpointorigin} |
| 2701 |
\pgfpathlineto{\pgfpointpolar{-150}{\pgf@circ@res@down}} |
| 2702 |
\pgfusepath{stroke} |
| 2703 |
\endpgfscope |
| 2704 |
} |
| 2705 |
% reverse star |
| 2706 |
\def\pgf@circ@eyw#1{ |
| 2707 |
\pgfscope |
| 2708 |
\pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/eyw scale}*\pgf@circ@res@up*#1} |
| 2709 |
\pgftransformrotate{\ctikzvalof{\ctikzclass/symbol/eyw rot}} |
| 2710 |
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} |
| 2711 |
\pgftransformrotate{-\pgfcircmathresult} |
| 2712 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2713 |
\pgf@circ@set@relative@thickness{symbol/thickness} |
| 2714 |
\pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}} |
| 2715 |
\pgfpathlineto{\pgfpointorigin} |
| 2716 |
\pgfpathlineto{\pgfpointpolar{30}{\pgf@circ@res@down}} |
| 2717 |
\pgfpathmoveto{\pgfpointorigin} |
| 2718 |
\pgfpathlineto{\pgfpointpolar{150}{\pgf@circ@res@down}} |
| 2719 |
\pgfusepath{stroke} |
| 2720 |
\endpgfscope |
| 2721 |
} |
| 2722 |
% zigzag |
| 2723 |
\def\pgf@circ@zig#1{ |
| 2724 |
\pgfscope |
| 2725 |
\pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/zig scale}*\pgf@circ@res@up*#1} |
| 2726 |
\pgftransformrotate{\ctikzvalof{\ctikzclass/symbol/zig rot}} |
| 2727 |
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} |
| 2728 |
\pgftransformrotate{-\pgfcircmathresult} |
| 2729 |
|
| 2730 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2731 |
\pgf@circ@set@relative@thickness{symbol/thickness} |
| 2732 |
\pgfpathmoveto{\pgfpointorigin} |
| 2733 |
\pgfpathlineto{\pgfpointpolar{90}{.5\pgf@circ@res@up}} |
| 2734 |
\pgfpathlineto{\pgfpointpolar{60}{\pgf@circ@res@up}} |
| 2735 |
|
| 2736 |
\pgfpathmoveto{\pgfpointorigin} |
| 2737 |
\pgfpathlineto{\pgfpointpolar{210}{.5\pgf@circ@res@up}} |
| 2738 |
\pgfpathlineto{\pgfpointpolar{0}{\pgf@circ@res@down}} |
| 2739 |
|
| 2740 |
\pgfpathmoveto{\pgfpointorigin} |
| 2741 |
\pgfpathlineto{\pgfpointpolar{330}{.5\pgf@circ@res@up}} |
| 2742 |
\pgfpathlineto{\pgfpointpolar{-60}{\pgf@circ@res@up}} |
| 2743 |
\pgfusepath{stroke} |
| 2744 |
\endpgfscope |
| 2745 |
} |
| 2746 |
% % % % round three-phase auto transformer |
| 2747 |
\pgfcircdeclarebipolescaled{sources} |
| 2748 |
{ |
| 2749 |
\savedmacro{\vectorgroupoffset}{\edef\vectorgroupoffset{% |
| 2750 |
\ctikzvalof{bipoles/oosourcetrans/vectorgroupoffset}}} |
| 2751 |
\savedmacro{\uppercirclesize}{\edef\uppercirclesize{% |
| 2752 |
\ctikzvalof{bipoles/oosourcetrans/upper circle size}}} |
| 2753 |
\savedmacro{\uppercircleoffset}{\edef\uppercircleoffset{% |
| 2754 |
\ctikzvalof{bipoles/oosourcetrans/upper circle offset}}} |
| 2755 |
% |
| 2756 |
\anchor{centerprim}{ |
| 2757 |
\northeast |
| 2758 |
\advance\pgf@x by -\pgf@y |
| 2759 |
\pgf@y=0pt\relax |
| 2760 |
} |
| 2761 |
\anchor{symbolprim}{ |
| 2762 |
\northeast |
| 2763 |
\advance\pgf@x by -\pgf@y |
| 2764 |
\pgf@y=0pt\relax |
| 2765 |
} |
| 2766 |
\anchor{symbolupper}{ |
| 2767 |
\northeast\pgf@ya=\pgf@y |
| 2768 |
\advance\pgf@x by -\pgf@ya |
| 2769 |
\pgf@ya=\uppercirclesize\pgf@ya |
| 2770 |
\advance\pgf@y by \vectorgroupoffset\pgf@ya |
| 2771 |
} |
| 2772 |
\anchor{primup}{ |
| 2773 |
\northeast |
| 2774 |
\pgf@ya=0.70711\pgf@y |
| 2775 |
\advance\pgf@x by -\pgf@y\advance\pgf@x by \pgf@ya |
| 2776 |
\pgf@y=\pgf@ya |
| 2777 |
} |
| 2778 |
\anchor{primdown}{ |
| 2779 |
\northeast |
| 2780 |
\pgf@ya=0.70711\pgf@y |
| 2781 |
\advance\pgf@x by -\pgf@y\advance\pgf@x by \pgf@ya |
| 2782 |
\pgf@y=-\pgf@ya |
| 2783 |
} |
| 2784 |
\anchor{centerupper}{ |
| 2785 |
\northeast |
| 2786 |
\pgf@ya=\pgf@y |
| 2787 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2788 |
\advance\pgf@x by -\pgf@ya |
| 2789 |
} |
| 2790 |
\anchor{uppertop}{ |
| 2791 |
\northeast |
| 2792 |
\pgf@ya=\pgf@y |
| 2793 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2794 |
\advance \pgf@y by \uppercirclesize\pgf@ya |
| 2795 |
\advance\pgf@x by -\pgf@ya |
| 2796 |
} |
| 2797 |
\anchor{topright}{ |
| 2798 |
\northeast |
| 2799 |
\pgf@ya=\pgf@y |
| 2800 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2801 |
\advance\pgf@x by -\pgf@ya |
| 2802 |
\pgf@ya=0.70711\pgf@ya\pgf@ya=\uppercirclesize\pgf@ya |
| 2803 |
\advance\pgf@y by \pgf@ya |
| 2804 |
\advance\pgf@x by \pgf@ya |
| 2805 |
} |
| 2806 |
\anchor{topleft}{ |
| 2807 |
\northeast |
| 2808 |
\pgf@ya=\pgf@y |
| 2809 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2810 |
\advance\pgf@x by -\pgf@ya |
| 2811 |
\pgf@ya=0.70711\pgf@ya\pgf@ya=\uppercirclesize\pgf@ya |
| 2812 |
\advance\pgf@y by \pgf@ya |
| 2813 |
\advance\pgf@x by -\pgf@ya |
| 2814 |
} |
| 2815 |
} |
| 2816 |
{\ctikzvalof{bipoles/oosourceatrans/height}} |
| 2817 |
{oosourceatrans} |
| 2818 |
{\ctikzvalof{bipoles/oosourceatrans/height}} |
| 2819 |
{\ctikzvalof{bipoles/oosourceatrans/width}} |
| 2820 |
{ |
| 2821 |
% we do not use the offset here; the circle is "seated" to the right side |
| 2822 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 2823 |
\pgf@circ@res@other=\dimexpr\pgf@circ@res@right-\pgf@circ@res@up\relax |
| 2824 |
% if we want to fill the extra winding, we need to pre-fill the circle |
| 2825 |
\ifpgf@circ@ooupperwinding |
| 2826 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@other}{\uppercircleoffset\pgf@circ@res@up}} |
| 2827 |
{\uppercirclesize\pgf@circ@res@up} |
| 2828 |
\pgf@circ@maybefill |
| 2829 |
\fi |
| 2830 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@other}{0}}{\pgf@circ@res@up} |
| 2831 |
\pgf@circ@draworfill |
| 2832 |
% draw arc |
| 2833 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 2834 |
\pgfpathcurveto{\pgfpoint{0.3\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 2835 |
{\pgfpoint{0.5\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 2836 |
{\pgfpoint{\pgf@circ@res@left}{0}} |
| 2837 |
\pgfusepath{draw} |
| 2838 |
\ifpgf@circ@ooupperwinding |
| 2839 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@other}{\uppercircleoffset\pgf@circ@res@up}} |
| 2840 |
{\uppercirclesize\pgf@circ@res@up} |
| 2841 |
\pgfusepath{draw} |
| 2842 |
\fi |
| 2843 |
% % % % draw inner symbols |
| 2844 |
%%only (primary) winding |
| 2845 |
\ifpgf@circ@prim@delta |
| 2846 |
\pgfscope |
| 2847 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2848 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 2849 |
\pgf@circ@delta{\ctikzvalof{bipoles/oosourceatrans/vectorgroupscale}} |
| 2850 |
\endpgfscope |
| 2851 |
\else\ifpgf@circ@prim@wye |
| 2852 |
\pgfscope |
| 2853 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2854 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 2855 |
\pgf@circ@wye{\ctikzvalof{bipoles/oosourceatrans/vectorgroupscale}} |
| 2856 |
\endpgfscope |
| 2857 |
\else\ifpgf@circ@prim@eyw |
| 2858 |
\pgfscope |
| 2859 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2860 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 2861 |
\pgf@circ@eyw{\ctikzvalof{bipoles/oosourceatrans/vectorgroupscale}} |
| 2862 |
\endpgfscope |
| 2863 |
\else\ifpgf@circ@prim@zig |
| 2864 |
\pgfscope |
| 2865 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2866 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 2867 |
\pgf@circ@zig{\ctikzvalof{bipoles/oosourceatrans/vectorgroupscale}} |
| 2868 |
\endpgfscope |
| 2869 |
\fi\fi\fi\fi |
| 2870 |
%%upper additional winding. Notice that we do *not* scale the symbol. At least not for now... |
| 2871 |
\ifpgf@circ@ooupperwinding |
| 2872 |
\ifpgf@circ@upper@delta |
| 2873 |
\pgfscope |
| 2874 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2875 |
\pgftransformyshift{\pgf@circ@res@up} |
| 2876 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 2877 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 2878 |
\pgf@circ@delta{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 2879 |
\endpgfscope |
| 2880 |
\else\ifpgf@circ@upper@wye |
| 2881 |
\pgfscope |
| 2882 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2883 |
\pgftransformyshift{\pgf@circ@res@up} |
| 2884 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 2885 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 2886 |
\pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 2887 |
\endpgfscope |
| 2888 |
\else\ifpgf@circ@upper@eyw |
| 2889 |
\pgfscope |
| 2890 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2891 |
\pgftransformyshift{\pgf@circ@res@up} |
| 2892 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 2893 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 2894 |
\pgf@circ@eyw{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 2895 |
\endpgfscope |
| 2896 |
\else\ifpgf@circ@upper@zig |
| 2897 |
\pgfscope |
| 2898 |
\pgftransformxshift{\pgf@circ@res@other} |
| 2899 |
\pgftransformyshift{\pgf@circ@res@up} |
| 2900 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 2901 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 2902 |
\pgf@circ@zig{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 2903 |
\endpgfscope |
| 2904 |
\fi\fi\fi\fi |
| 2905 |
\fi |
| 2906 |
} |
| 2907 |
% % % % round three-phase transformer |
| 2908 |
\pgfcircdeclarebipolescaled{sources} |
| 2909 |
{ |
| 2910 |
\savedmacro{\vectorgroupoffset}{\edef\vectorgroupoffset{% |
| 2911 |
\ctikzvalof{bipoles/oosourcetrans/vectorgroupoffset}}} |
| 2912 |
\savedmacro{\uppercirclesize}{\edef\uppercirclesize{% |
| 2913 |
\ctikzvalof{bipoles/oosourcetrans/upper circle size}}} |
| 2914 |
\savedmacro{\uppercircleoffset}{\edef\uppercircleoffset{% |
| 2915 |
\ctikzvalof{bipoles/oosourcetrans/upper circle offset}}} |
| 2916 |
% |
| 2917 |
\anchor{centerprim}{ |
| 2918 |
\northeast |
| 2919 |
\advance\pgf@x by -\pgf@y \pgf@x=-\pgf@x |
| 2920 |
\pgf@y=0pt\relax |
| 2921 |
} |
| 2922 |
\anchor{centersec}{ |
| 2923 |
\northeast |
| 2924 |
\advance\pgf@x by -\pgf@y |
| 2925 |
\pgf@y=0pt\relax |
| 2926 |
} |
| 2927 |
\anchor{symbolprim}{ |
| 2928 |
\northeast |
| 2929 |
\pgf@x=-\vectorgroupoffset\pgf@x |
| 2930 |
\pgf@y=0pt\relax |
| 2931 |
} |
| 2932 |
\anchor{symbolsec}{ |
| 2933 |
\northeast |
| 2934 |
\pgf@x=\vectorgroupoffset\pgf@x |
| 2935 |
\pgf@y=0pt\relax |
| 2936 |
} |
| 2937 |
\anchor{symbolupper}{ |
| 2938 |
\northeast\pgf@ya=\pgf@y |
| 2939 |
\pgf@ya=\uppercirclesize\pgf@ya |
| 2940 |
\advance\pgf@y by \vectorgroupoffset\pgf@ya |
| 2941 |
\pgf@x=0pt\relax |
| 2942 |
} |
| 2943 |
\anchor{centerupper}{ |
| 2944 |
\northeast |
| 2945 |
\pgf@x=0pt\pgf@ya=\pgf@y |
| 2946 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2947 |
} |
| 2948 |
\anchor{uppertop}{ |
| 2949 |
\northeast |
| 2950 |
\pgf@x=0pt\pgf@ya=\pgf@y |
| 2951 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2952 |
\advance \pgf@y by \uppercirclesize\pgf@ya |
| 2953 |
} |
| 2954 |
\anchor{topright}{ |
| 2955 |
\northeast |
| 2956 |
\pgf@ya=\pgf@y |
| 2957 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2958 |
\pgf@ya=0.70711\pgf@ya\pgf@ya=\uppercirclesize\pgf@ya |
| 2959 |
\pgf@x=\pgf@ya |
| 2960 |
\advance\pgf@y by \pgf@ya |
| 2961 |
} |
| 2962 |
\anchor{topleft}{ |
| 2963 |
\northeast |
| 2964 |
\pgf@ya=\pgf@y |
| 2965 |
\pgf@y=\uppercircleoffset\pgf@ya |
| 2966 |
\pgf@ya=0.70711\pgf@ya\pgf@ya=\uppercirclesize\pgf@ya |
| 2967 |
\pgf@x=-\pgf@ya |
| 2968 |
\advance\pgf@y by \pgf@ya |
| 2969 |
} |
| 2970 |
% border anchors to contact three wires if needed |
| 2971 |
\anchor{primup}{ |
| 2972 |
\northeast |
| 2973 |
\pgf@ya=0.70711\pgf@y |
| 2974 |
\advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x\advance\pgf@x by -\pgf@ya |
| 2975 |
\pgf@y=\pgf@ya |
| 2976 |
} |
| 2977 |
\anchor{primdown}{ |
| 2978 |
\northeast |
| 2979 |
\pgf@ya=0.70711\pgf@y |
| 2980 |
\advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x\advance\pgf@x by -\pgf@ya |
| 2981 |
\pgf@y=-\pgf@ya |
| 2982 |
} |
| 2983 |
\anchor{secup}{ |
| 2984 |
\northeast |
| 2985 |
\pgf@ya=0.70711\pgf@y |
| 2986 |
\advance\pgf@x by -\pgf@y\advance\pgf@x by \pgf@ya |
| 2987 |
\pgf@y=\pgf@ya |
| 2988 |
} |
| 2989 |
\anchor{secdown}{ |
| 2990 |
\northeast |
| 2991 |
\pgf@ya=0.70711\pgf@y |
| 2992 |
\advance\pgf@x by -\pgf@y\advance\pgf@x by \pgf@ya |
| 2993 |
\pgf@y=-\pgf@ya |
| 2994 |
} |
| 2995 |
} |
| 2996 |
{\ctikzvalof{bipoles/oosourcetrans/height}} |
| 2997 |
{oosourcetrans} |
| 2998 |
{\ctikzvalof{bipoles/oosourcetrans/height}} |
| 2999 |
{\ctikzvalof{bipoles/oosourcetrans/width}} |
| 3000 |
{ |
| 3001 |
% the offset is relative to the width (...@left/@right), and the size to the height (...@up/@down) |
| 3002 |
% the height is the circle size; the width will decide how far away the two circles are drawn |
| 3003 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3004 |
% if we want to fill the extra winding, we need to pre-fill the circle |
| 3005 |
\ifpgf@circ@ooupperwinding |
| 3006 |
\pgfpathcircle{\pgfpoint{0}{\uppercircleoffset\pgf@circ@res@up}} |
| 3007 |
{\uppercirclesize\pgf@circ@res@up} |
| 3008 |
\pgf@circ@maybefill |
| 3009 |
\fi |
| 3010 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{0}}{\pgf@circ@res@up} |
| 3011 |
\pgf@circ@maybefill |
| 3012 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{0}}{\pgf@circ@res@up} |
| 3013 |
\pgf@circ@draworfill |
| 3014 |
\pgfpathcircle{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{0}}{\pgf@circ@res@up} |
| 3015 |
\pgfusepath{draw} |
| 3016 |
\ifpgf@circ@ooupperwinding |
| 3017 |
\pgfpathcircle{\pgfpoint{0}{\uppercircleoffset\pgf@circ@res@up}} |
| 3018 |
{\uppercirclesize\pgf@circ@res@up} |
| 3019 |
\pgfusepath{draw} |
| 3020 |
\fi |
| 3021 |
% % % % draw inner symbols |
| 3022 |
%%primary winding |
| 3023 |
\ifpgf@circ@prim@delta |
| 3024 |
\pgfscope |
| 3025 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@left} |
| 3026 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3027 |
\pgf@circ@delta{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3028 |
\endpgfscope |
| 3029 |
\else\ifpgf@circ@prim@wye |
| 3030 |
\pgfscope |
| 3031 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@left} |
| 3032 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3033 |
\pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3034 |
\endpgfscope |
| 3035 |
\else\ifpgf@circ@prim@eyw |
| 3036 |
\pgfscope |
| 3037 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@left} |
| 3038 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3039 |
\pgf@circ@eyw{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3040 |
\endpgfscope |
| 3041 |
\else\ifpgf@circ@prim@zig |
| 3042 |
\pgfscope |
| 3043 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@left} |
| 3044 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3045 |
\pgf@circ@zig{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3046 |
\endpgfscope |
| 3047 |
\fi\fi\fi\fi |
| 3048 |
%%secondary winding |
| 3049 |
\ifpgf@circ@sec@delta |
| 3050 |
\pgfscope |
| 3051 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@right} |
| 3052 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3053 |
\pgf@circ@delta{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3054 |
\endpgfscope |
| 3055 |
\else\ifpgf@circ@sec@wye |
| 3056 |
\pgfscope |
| 3057 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@right} |
| 3058 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3059 |
\pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3060 |
\endpgfscope |
| 3061 |
\else\ifpgf@circ@sec@eyw |
| 3062 |
\pgfscope |
| 3063 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@right} |
| 3064 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3065 |
\pgf@circ@eyw{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3066 |
\endpgfscope |
| 3067 |
\else\ifpgf@circ@sec@zig |
| 3068 |
\pgfscope |
| 3069 |
\pgftransformxshift{\vectorgroupoffset\pgf@circ@res@right} |
| 3070 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3071 |
\pgf@circ@zig{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3072 |
\endpgfscope |
| 3073 |
\fi\fi\fi\fi |
| 3074 |
%%upper additional winding. Notice that we do *not* scale the symbol. At least not for now... |
| 3075 |
\ifpgf@circ@ooupperwinding |
| 3076 |
\ifpgf@circ@upper@delta |
| 3077 |
\pgfscope |
| 3078 |
\pgftransformyshift{\pgf@circ@res@up} |
| 3079 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 3080 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 3081 |
\pgf@circ@delta{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3082 |
\endpgfscope |
| 3083 |
\else\ifpgf@circ@upper@wye |
| 3084 |
\pgfscope |
| 3085 |
\pgftransformyshift{\pgf@circ@res@up} |
| 3086 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 3087 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 3088 |
\pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3089 |
\endpgfscope |
| 3090 |
\else\ifpgf@circ@upper@eyw |
| 3091 |
\pgfscope |
| 3092 |
\pgftransformyshift{\pgf@circ@res@up} |
| 3093 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 3094 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 3095 |
\pgf@circ@eyw{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3096 |
\endpgfscope |
| 3097 |
\else\ifpgf@circ@upper@zig |
| 3098 |
\pgfscope |
| 3099 |
\pgftransformyshift{\pgf@circ@res@up} |
| 3100 |
\pgftransformyshift{\vectorgroupoffset*\uppercirclesize*\pgf@circ@res@up} |
| 3101 |
\pgftransformrotate{\ctikzvalof{sources/symbol/upper rot}} |
| 3102 |
\pgf@circ@zig{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} |
| 3103 |
\endpgfscope |
| 3104 |
\fi\fi\fi\fi |
| 3105 |
\fi |
| 3106 |
} |
| 3107 |
%%% fit the ooo-shape to the geo-anchors |
| 3108 |
\def\pgf@circ@ooo@find@other{ |
| 3109 |
%% we want the structure of height @up. The (half)height of the drawing is: |
| 3110 |
%% h=other*[(1-r)*sin(60)+r] --- so we calculate the other we need to fill the vertical space |
| 3111 |
\pgfmathsetlength{\pgf@circ@res@other}{% |
| 3112 |
\pgf@circ@res@up/(\circleoffset*sqrt(3)/2+\circlesize) |
| 3113 |
} |
| 3114 |
} |
| 3115 |
\def\pgf@circ@ooo@anchor@base{ |
| 3116 |
\pgf@circ@scaled@Rlen=\classscale\pgf@circ@Rlen |
| 3117 |
\pgf@circ@res@up=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@scaled@Rlen |
| 3118 |
\pgf@circ@res@up=0.5\pgf@circ@res@up |
| 3119 |
\pgf@circ@ooo@find@other |
| 3120 |
\pgfmathsetlength{\pgf@circ@res@temp}{\circleoffset*\pgf@circ@res@other/4} |
| 3121 |
} |
| 3122 |
% % % % ooosource for three phase transformer |
| 3123 |
%%% we find the circle size from the ratio height/width. Change with care. |
| 3124 |
\pgfcircdeclarebipolescaled{sources} |
| 3125 |
{ |
| 3126 |
% we need to save the class scale factor here because is used in plain (not saved) anchors |
| 3127 |
\savedmacro{\classscale}{\edef\classscale{\ctikzvalof{\ctikzclass/scale}}} |
| 3128 |
%% From the geometry of the component, we know that the width of the drawing is: |
| 3129 |
%% w = (1/2*r + 3/2)/((1-r)*sin(60)+r) *(h/2) |
| 3130 |
%% we reverse that and we have |
| 3131 |
%% r = (3-sqrt(3)*2*w/h)/((2-sqrt(3)*2*w/h-1) |
| 3132 |
\savedmacro{\circlesize}{% |
| 3133 |
\pgfmathparse{% |
| 3134 |
(3-sqrt(3)*2*\ctikzvalof{bipoles/ooosource/width}/\ctikzvalof{bipoles/ooosource/height})/ |
| 3135 |
((2-sqrt(3))*2*\ctikzvalof{bipoles/ooosource/width}/\ctikzvalof{bipoles/ooosource/height}-1) |
| 3136 |
} |
| 3137 |
\edef\circlesize{\pgfmathresult} |
| 3138 |
} |
| 3139 |
\savedmacro{\circleoffset}{% |
| 3140 |
\pgfmathparse{% |
| 3141 |
1-(3-sqrt(3)*2*\ctikzvalof{bipoles/ooosource/width}/\ctikzvalof{bipoles/ooosource/height})/ |
| 3142 |
((2-sqrt(3))*2*\ctikzvalof{bipoles/ooosource/width}/\ctikzvalof{bipoles/ooosource/height}-1) |
| 3143 |
} |
| 3144 |
\edef\circleoffset{\pgfmathresult}% |
| 3145 |
} |
| 3146 |
\savedmacro{\vectorgroupoffset}{\edef\vectorgroupoffset{% |
| 3147 |
\ctikzvalof{bipoles/oosourcetrans/vectorgroupoffset}}} |
| 3148 |
% redefine right to enter the shape where the two right circle crosses |
| 3149 |
% with respect to the natural center of the drawing (before the shifting) |
| 3150 |
% is offset*cos(60) + sqrt(radius^2-(offset*sin(60))^2) |
| 3151 |
\anchor{right}{ |
| 3152 |
\pgf@circ@ooo@anchor@base |
| 3153 |
\pgfmathparse{ \circleoffset*0.5 + |
| 3154 |
%%the sqrt must be > 0, the circles have to intersect |
| 3155 |
%% the abs is to avoid crashes, but the result will be baaaad |
| 3156 |
sqrt(abs(pow(\circlesize,2) - pow(\circleoffset*sqrt(3)/2,2))) |
| 3157 |
} |
| 3158 |
\pgf@x=\pgfmathresult\pgf@circ@res@other |
| 3159 |
\advance\pgf@x by \pgf@circ@res@temp |
| 3160 |
\pgf@y=0pt |
| 3161 |
} |
| 3162 |
% centers of the three circles |
| 3163 |
\savedanchor{\centerprim}{% remove me |
| 3164 |
\pgf@circ@ooo@anchor@base |
| 3165 |
\pgf@x=-\circleoffset\pgf@circ@res@other |
| 3166 |
\advance\pgf@x by \pgf@circ@res@temp |
| 3167 |
\pgf@y=0pt |
| 3168 |
} |
| 3169 |
\anchor{centerprim}{\centerprim} |
| 3170 |
\savedanchor{\centersec}{ |
| 3171 |
\pgf@circ@ooo@anchor@base |
| 3172 |
\pgfpointpolar{60}{\circleoffset*\pgf@circ@res@other} |
| 3173 |
\advance\pgf@x by \pgf@circ@res@temp |
| 3174 |
} |
| 3175 |
\anchor{centersec}{\centersec} |
| 3176 |
\savedanchor{\centertert}{ |
| 3177 |
\pgf@circ@ooo@anchor@base |
| 3178 |
\pgfpointpolar{-60}{\circleoffset\pgf@circ@res@other} |
| 3179 |
\advance\pgf@x by \pgf@circ@res@temp |
| 3180 |
} |
| 3181 |
\anchor{centertert}{\centertert} |
| 3182 |
% add some anchors in case the are needed :) |
| 3183 |
\anchor{prim1}{ |
| 3184 |
\pgf@circ@ooo@anchor@base |
| 3185 |
\pgfpointadd{\centerprim}{\pgfpointpolar{135}{\circlesize\pgf@circ@res@other}} |
| 3186 |
} |
| 3187 |
\anchor{prim2}{ |
| 3188 |
\pgf@circ@ooo@anchor@base |
| 3189 |
\pgfpointadd{\centerprim}{\pgfpointpolar{-135}{\circlesize\pgf@circ@res@other}} |
| 3190 |
} |
| 3191 |
\anchor{sec1}{ |
| 3192 |
\pgf@circ@ooo@anchor@base |
| 3193 |
\pgfpointadd{\centersec}{\pgfpointpolar{0}{\circlesize\pgf@circ@res@other}} |
| 3194 |
} |
| 3195 |
\anchor{sec2}{ |
| 3196 |
\pgf@circ@ooo@anchor@base |
| 3197 |
\pgfpointadd{\centersec}{\pgfpointpolar{45}{\circlesize\pgf@circ@res@other}} |
| 3198 |
} |
| 3199 |
\anchor{sec3}{ |
| 3200 |
\pgf@circ@ooo@anchor@base |
| 3201 |
\pgfpointadd{\centersec}{\pgfpointpolar{90}{\circlesize\pgf@circ@res@other}} |
| 3202 |
} |
| 3203 |
\anchor{tert1}{ |
| 3204 |
\pgf@circ@ooo@anchor@base |
| 3205 |
\pgfpointadd{\centertert}{\pgfpointpolar{0}{\circlesize\pgf@circ@res@other}} |
| 3206 |
} |
| 3207 |
\anchor{tert2}{ |
| 3208 |
\pgf@circ@ooo@anchor@base |
| 3209 |
\pgfpointadd{\centertert}{\pgfpointpolar{-45}{\circlesize\pgf@circ@res@other}} |
| 3210 |
} |
| 3211 |
\anchor{tert3}{ |
| 3212 |
\pgf@circ@ooo@anchor@base |
| 3213 |
\pgfpointadd{\centertert}{\pgfpointpolar{-90}{\circlesize\pgf@circ@res@other}} |
| 3214 |
} |
| 3215 |
% symbol "center" anchors |
| 3216 |
\anchor{symbolprim}{ |
| 3217 |
\pgf@circ@ooo@anchor@base |
| 3218 |
\pgf@x=-\vectorgroupoffset\pgf@circ@res@other |
| 3219 |
\advance\pgf@x by \pgf@circ@res@temp |
| 3220 |
\pgf@y=0pt |
| 3221 |
} |
| 3222 |
\anchor{symbolsec}{ |
| 3223 |
\pgf@circ@ooo@anchor@base |
| 3224 |
\pgfpointpolar{60}{\vectorgroupoffset\pgf@circ@res@other} |
| 3225 |
\advance\pgf@x by \pgf@circ@res@temp |
| 3226 |
} |
| 3227 |
\anchor{symboltert}{ |
| 3228 |
\pgf@circ@ooo@anchor@base |
| 3229 |
\pgfpointpolar{-60}{\vectorgroupoffset\pgf@circ@res@other} |
| 3230 |
\advance\pgf@x by \pgf@circ@res@temp |
| 3231 |
} |
| 3232 |
\savedanchor{\textanchor}{% |
| 3233 |
\pgf@circ@ooo@anchor@base |
| 3234 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 3235 |
\pgf@y=.6\ht\pgfnodeparttextbox |
| 3236 |
\advance\pgf@y by \pgf@circ@res@up |
| 3237 |
} |
| 3238 |
\anchor{text}{\textanchor} |
| 3239 |
} |
| 3240 |
{\ctikzvalof{bipoles/ooosource/height}} |
| 3241 |
{ooosource} |
| 3242 |
{\ctikzvalof{bipoles/ooosource/height}} |
| 3243 |
{\ctikzvalof{bipoles/ooosource/width}}% Notice that only very tied values of height and width will work |
| 3244 |
{ |
| 3245 |
%% find the drawing parameter @other: |
| 3246 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3247 |
\pgf@circ@ooo@find@other |
| 3248 |
\pgfmathsetlength{\pgf@circ@res@temp}{\circleoffset*\pgf@circ@res@other/4} |
| 3249 |
%% move the origin 1/4 of the circle offset |
| 3250 |
\pgftransformxshift{\pgf@circ@res@temp} |
| 3251 |
% filling |
| 3252 |
% left |
| 3253 |
\pgfscope |
| 3254 |
\pgfpathcircle{\pgfpoint{-\circleoffset\pgf@circ@res@other}{0}}{\circlesize\pgf@circ@res@other} |
| 3255 |
\pgf@circ@maybefill |
| 3256 |
\endpgfscope |
| 3257 |
% up |
| 3258 |
\pgfscope |
| 3259 |
\pgfpathcircle{\pgfpointpolar{60}{\circleoffset\pgf@circ@res@other}}{\circlesize\pgf@circ@res@other} |
| 3260 |
\pgf@circ@maybefill |
| 3261 |
\endpgfscope |
| 3262 |
% down also draw |
| 3263 |
\pgfscope |
| 3264 |
\pgfpathcircle{\pgfpointpolar{-60}{\circleoffset\pgf@circ@res@other}}{\circlesize\pgf@circ@res@other} |
| 3265 |
\pgf@circ@draworfill |
| 3266 |
\endpgfscope |
| 3267 |
% drawing |
| 3268 |
% left |
| 3269 |
\pgfscope |
| 3270 |
\pgfpathcircle{\pgfpoint{-\circleoffset\pgf@circ@res@other}{0}}{\circlesize\pgf@circ@res@other} |
| 3271 |
\pgfusepath{draw} |
| 3272 |
\endpgfscope |
| 3273 |
% up |
| 3274 |
\pgfscope |
| 3275 |
\pgfpathcircle{\pgfpointpolar{60}{\circleoffset\pgf@circ@res@other}}{\circlesize\pgf@circ@res@other} |
| 3276 |
\pgfusepath{draw} |
| 3277 |
\endpgfscope |
| 3278 |
% % % draw inner symbols |
| 3279 |
% % primary winding |
| 3280 |
\ifpgf@circ@prim@delta |
| 3281 |
\pgfscope |
| 3282 |
\pgftransformxshift{-\vectorgroupoffset\pgf@circ@res@other} |
| 3283 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3284 |
\pgf@circ@delta{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3285 |
\endpgfscope |
| 3286 |
\else\ifpgf@circ@prim@wye |
| 3287 |
\pgfscope |
| 3288 |
\pgftransformxshift{-\vectorgroupoffset\pgf@circ@res@other} |
| 3289 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3290 |
\pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3291 |
\endpgfscope |
| 3292 |
\else\ifpgf@circ@prim@eyw |
| 3293 |
\pgfscope |
| 3294 |
\pgftransformxshift{-\vectorgroupoffset\pgf@circ@res@other} |
| 3295 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3296 |
\pgf@circ@eyw{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3297 |
\endpgfscope |
| 3298 |
\else\ifpgf@circ@prim@zig |
| 3299 |
\pgfscope |
| 3300 |
\pgftransformxshift{-\vectorgroupoffset\pgf@circ@res@other} |
| 3301 |
\pgftransformrotate{\ctikzvalof{sources/symbol/prim rot}} |
| 3302 |
\pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3303 |
\endpgfscope |
| 3304 |
\fi\fi\fi\fi |
| 3305 |
% % secondary winding |
| 3306 |
\ifpgf@circ@sec@delta |
| 3307 |
\pgfscope |
| 3308 |
\pgftransformshift{\pgfpointpolar{60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3309 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3310 |
\pgf@circ@delta{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3311 |
\endpgfscope |
| 3312 |
\else\ifpgf@circ@sec@wye |
| 3313 |
\pgfscope |
| 3314 |
\pgftransformshift{\pgfpointpolar{60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3315 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3316 |
\pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3317 |
\endpgfscope |
| 3318 |
\else\ifpgf@circ@sec@eyw |
| 3319 |
\pgfscope |
| 3320 |
\pgftransformshift{\pgfpointpolar{60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3321 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3322 |
\pgf@circ@eyw{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3323 |
\endpgfscope |
| 3324 |
\else\ifpgf@circ@sec@zig |
| 3325 |
\pgfscope |
| 3326 |
\pgftransformshift{\pgfpointpolar{60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3327 |
\pgftransformrotate{\ctikzvalof{sources/symbol/sec rot}} |
| 3328 |
\pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3329 |
\endpgfscope |
| 3330 |
\fi\fi\fi\fi |
| 3331 |
% % tertiary winding |
| 3332 |
\ifpgf@circ@tert@delta |
| 3333 |
\pgfscope |
| 3334 |
\pgftransformshift{\pgfpointpolar{-60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3335 |
\pgftransformrotate{\ctikzvalof{sources/symbol/tert rot}} |
| 3336 |
\pgf@circ@delta{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3337 |
\endpgfscope |
| 3338 |
\else\ifpgf@circ@tert@wye |
| 3339 |
\pgfscope |
| 3340 |
\pgftransformshift{\pgfpointpolar{-60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3341 |
\pgftransformrotate{\ctikzvalof{sources/symbol/tert rot}} |
| 3342 |
\pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3343 |
\endpgfscope |
| 3344 |
\else\ifpgf@circ@tert@eyw |
| 3345 |
\pgfscope |
| 3346 |
\pgftransformshift{\pgfpointpolar{-60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3347 |
\pgftransformrotate{\ctikzvalof{sources/symbol/tert rot}} |
| 3348 |
\pgf@circ@eyw{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3349 |
\endpgfscope |
| 3350 |
\else\ifpgf@circ@tert@zig |
| 3351 |
\pgfscope |
| 3352 |
\pgftransformshift{\pgfpointpolar{-60}{\vectorgroupoffset\pgf@circ@res@other}} |
| 3353 |
\pgftransformrotate{\ctikzvalof{sources/symbol/tert rot}} |
| 3354 |
\pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} |
| 3355 |
\endpgfscope |
| 3356 |
\fi\fi\fi\fi |
| 3357 |
} |
| 3358 |
|
| 3359 |
%% Independent current source - American |
| 3360 |
\pgfcircdeclarebipolescaled{sources} |
| 3361 |
{} |
| 3362 |
{\ctikzvalof{bipoles/isourceam/height}} |
| 3363 |
{isourceAM} |
| 3364 |
{\ctikzvalof{bipoles/isourceam/height}} |
| 3365 |
{\ctikzvalof{bipoles/isourceam/width}} |
| 3366 |
{ |
| 3367 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3368 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 3369 |
\pgf@circ@draworfill |
| 3370 |
|
| 3371 |
\pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3372 |
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3373 |
\pgfusepath{draw} |
| 3374 |
\pgfscope |
| 3375 |
\pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3376 |
\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} |
| 3377 |
\endpgfscope |
| 3378 |
} |
| 3379 |
|
| 3380 |
%% Independent sinusoidal current source with open shape |
| 3381 |
\pgfcircdeclarebipolescaled{sources} |
| 3382 |
{} |
| 3383 |
{\ctikzvalof{bipoles/isource/height}} |
| 3384 |
{isourcesin} |
| 3385 |
{\ctikzvalof{bipoles/isource/height}} |
| 3386 |
{\ctikzvalof{bipoles/isource/width}} |
| 3387 |
{ |
| 3388 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3389 |
\pgfscope |
| 3390 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 3391 |
\pgf@circ@maybefill |
| 3392 |
\endpgfscope |
| 3393 |
\edef\@@angle{\ctikzvalof{bipoles/isourcesin/angle}} |
| 3394 |
\pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}} |
| 3395 |
\pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up} |
| 3396 |
\pgfpathmoveto{\pgfpointpolar{180-\@@angle}{\pgf@circ@res@up}} |
| 3397 |
\pgfpatharc{180-\@@angle}{180+\@@angle}{\pgf@circ@res@up} |
| 3398 |
\pgfusepath{draw} |
| 3399 |
|
| 3400 |
\pgf@circ@res@up = .5\pgf@circ@res@up |
| 3401 |
\pgfscope |
| 3402 |
\pgf@circ@sources@symbol@setup |
| 3403 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} |
| 3404 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 3405 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 3406 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 3407 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 3408 |
\pgfusepath{draw} |
| 3409 |
\endpgfscope |
| 3410 |
} |
| 3411 |
|
| 3412 |
%% Empty controlled source |
| 3413 |
\pgfcircdeclarebipolescaled{csources} |
| 3414 |
{} |
| 3415 |
{\ctikzvalof{bipoles/ecsource/height}} |
| 3416 |
{ecsource} |
| 3417 |
{\ctikzvalof{bipoles/ecsource/height}} |
| 3418 |
{\ctikzvalof{bipoles/ecsource/width}} |
| 3419 |
{ |
| 3420 |
|
| 3421 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3422 |
|
| 3423 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3424 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3425 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3426 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3427 |
\pgfpathclose |
| 3428 |
\pgf@circ@draworfill |
| 3429 |
} |
| 3430 |
|
| 3431 |
%% Controlled voltage source |
| 3432 |
\pgfcircdeclarebipolescaled{csources} |
| 3433 |
{} |
| 3434 |
{\ctikzvalof{bipoles/cvsource/height}} |
| 3435 |
{cvsource} |
| 3436 |
{\ctikzvalof{bipoles/cvsource/height}} |
| 3437 |
{\ctikzvalof{bipoles/cvsource/width}} |
| 3438 |
{ |
| 3439 |
|
| 3440 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3441 |
|
| 3442 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3443 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3444 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3445 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3446 |
\pgfpathclose |
| 3447 |
\pgf@circ@draworfill |
| 3448 |
|
| 3449 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3450 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3451 |
\pgfusepath{draw} |
| 3452 |
} |
| 3453 |
|
| 3454 |
%% To change the internal symbols of the controlled voltage source american style |
| 3455 |
\ctikzset{bipoles/cvsourceam/inner plus/.initial={$+$}} |
| 3456 |
% In the mayority of fonts, the size of - is smaller than +, so we have |
| 3457 |
% unaligned signs when positioned independently. |
| 3458 |
% See https://github.com/circuitikz/circuitikz/issues/721 |
| 3459 |
\ctikzset{bipoles/cvsourceam/inner minus/.initial={$\vphantom{+}-$}} |
| 3460 |
%% Controlled voltage source - American |
| 3461 |
\pgfcircdeclarebipolescaled{csources} |
| 3462 |
{} |
| 3463 |
{\ctikzvalof{bipoles/cvsourceam/height}} |
| 3464 |
{cvsourceAM} |
| 3465 |
{\ctikzvalof{bipoles/cvsourceam/height}} |
| 3466 |
{\ctikzvalof{bipoles/cvsourceam/width}} |
| 3467 |
{ |
| 3468 |
\pgfscope |
| 3469 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3470 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3471 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3472 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3473 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3474 |
\pgfpathclose |
| 3475 |
\pgf@circ@draworfill |
| 3476 |
\endpgfscope |
| 3477 |
\pgf@circ@text@strokecolor |
| 3478 |
\pgf@circ@vsources@draw@signs |
| 3479 |
} |
| 3480 |
|
| 3481 |
%% Controlled sinusoidal voltage source |
| 3482 |
\pgfcircdeclarebipolescaled{csources} |
| 3483 |
{} |
| 3484 |
{\ctikzvalof{bipoles/cvsourcesin/height}} |
| 3485 |
{cvsourcesin} |
| 3486 |
{\ctikzvalof{bipoles/cvsourcesin/height}} |
| 3487 |
{\ctikzvalof{bipoles/cvsourcesin/width}} |
| 3488 |
{ |
| 3489 |
|
| 3490 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3491 |
|
| 3492 |
\pgfscope |
| 3493 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3494 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3495 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3496 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3497 |
\pgfpathclose |
| 3498 |
\pgf@circ@draworfill |
| 3499 |
\endpgfscope |
| 3500 |
|
| 3501 |
\pgf@circ@res@up = .5\pgf@circ@res@up |
| 3502 |
\pgfscope |
| 3503 |
\pgf@circ@sources@symbol@setup |
| 3504 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} |
| 3505 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 3506 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 3507 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 3508 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 3509 |
\pgfusepath{draw} |
| 3510 |
\endpgfscope |
| 3511 |
} |
| 3512 |
|
| 3513 |
%% Controlled sinusoidal current source |
| 3514 |
\pgfcircdeclarebipolescaled{csources} |
| 3515 |
{} |
| 3516 |
{\ctikzvalof{bipoles/cvsourcesin/height}} |
| 3517 |
{cisourcesin} |
| 3518 |
{\ctikzvalof{bipoles/cvsourcesin/height}} |
| 3519 |
{\ctikzvalof{bipoles/cvsourcesin/width}} |
| 3520 |
{ |
| 3521 |
|
| 3522 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3523 |
|
| 3524 |
\pgfscope |
| 3525 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3526 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3527 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3528 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3529 |
\pgfpathclose |
| 3530 |
\pgf@circ@draworfill |
| 3531 |
\endpgfscope |
| 3532 |
|
| 3533 |
\pgf@circ@res@up = .5\pgf@circ@res@up |
| 3534 |
\pgfscope |
| 3535 |
\pgf@circ@sources@symbol@setup |
| 3536 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}} |
| 3537 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 3538 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 3539 |
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}} |
| 3540 |
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 3541 |
\pgfusepath{draw} |
| 3542 |
\endpgfscope |
| 3543 |
} |
| 3544 |
|
| 3545 |
%% Controlled current source |
| 3546 |
\pgfcircdeclarebipolescaled{csources} |
| 3547 |
{} |
| 3548 |
{\ctikzvalof{bipoles/cisource/height}} |
| 3549 |
{cisource} |
| 3550 |
{\ctikzvalof{bipoles/cisource/height}} |
| 3551 |
{\ctikzvalof{bipoles/cisource/width}} |
| 3552 |
{ |
| 3553 |
|
| 3554 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3555 |
|
| 3556 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3557 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3558 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3559 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3560 |
\pgfpathclose |
| 3561 |
\pgf@circ@draworfill |
| 3562 |
|
| 3563 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3564 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3565 |
\pgfusepath{draw} |
| 3566 |
} |
| 3567 |
|
| 3568 |
%% Controlled current source - American |
| 3569 |
\pgfcircdeclarebipolescaled{csources} |
| 3570 |
{} |
| 3571 |
{\ctikzvalof{bipoles/cisourceam/height}} |
| 3572 |
{cisourceAM} |
| 3573 |
{\ctikzvalof{bipoles/cisourceam/height}} |
| 3574 |
{\ctikzvalof{bipoles/cisourceam/width}} |
| 3575 |
{ |
| 3576 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3577 |
|
| 3578 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3579 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3580 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3581 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3582 |
\pgfpathclose |
| 3583 |
\pgf@circ@draworfill |
| 3584 |
\pgfpathmoveto{\pgfpoint{.7\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3585 |
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3586 |
\pgfusepath{draw} |
| 3587 |
\pgfscope |
| 3588 |
\pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3589 |
\pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}} |
| 3590 |
\endpgfscope |
| 3591 |
} |
| 3592 |
|
| 3593 |
%% Cute Independent voltage source |
| 3594 |
\pgfcircdeclarebipolescaled{sources} |
| 3595 |
{} |
| 3596 |
{\ctikzvalof{bipoles/vsource/height}} |
| 3597 |
{vsourceC} |
| 3598 |
{\ctikzvalof{bipoles/vsource/height}} |
| 3599 |
{\ctikzvalof{bipoles/vsource/width}} |
| 3600 |
{ |
| 3601 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3602 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 3603 |
\pgf@circ@draworfill |
| 3604 |
\pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}} |
| 3605 |
\pgfsetlinewidth{\@@thicker\pgfstartlinewidth} |
| 3606 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3607 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3608 |
\pgfsetroundcap\pgfusepath{draw} |
| 3609 |
} |
| 3610 |
|
| 3611 |
%% Cute Independent current source |
| 3612 |
\pgfcircdeclarebipolescaled{sources} |
| 3613 |
{} |
| 3614 |
{\ctikzvalof{bipoles/isource/height}} |
| 3615 |
{isourceC} |
| 3616 |
{\ctikzvalof{bipoles/isource/height}} |
| 3617 |
{\ctikzvalof{bipoles/isource/width}} |
| 3618 |
{ |
| 3619 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3620 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 3621 |
\pgf@circ@draworfill |
| 3622 |
\pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}} |
| 3623 |
\pgfsetlinewidth{\@@thicker\pgfstartlinewidth} |
| 3624 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}} |
| 3625 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}} |
| 3626 |
\pgfsetroundcap\pgfusepath{draw} |
| 3627 |
} |
| 3628 |
|
| 3629 |
%% Cute Controlled voltage source |
| 3630 |
\pgfcircdeclarebipolescaled{csources} |
| 3631 |
{} |
| 3632 |
{\ctikzvalof{bipoles/cvsource/height}} |
| 3633 |
{cvsourceC} |
| 3634 |
{\ctikzvalof{bipoles/cvsource/height}} |
| 3635 |
{\ctikzvalof{bipoles/cvsource/width}} |
| 3636 |
{ |
| 3637 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3638 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3639 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3640 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3641 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3642 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3643 |
\pgf@circ@draworfill |
| 3644 |
\pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}} |
| 3645 |
\pgfsetlinewidth{\@@thicker\pgfstartlinewidth} |
| 3646 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3647 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3648 |
\pgfsetroundcap\pgfusepath{draw} |
| 3649 |
} |
| 3650 |
|
| 3651 |
%% Cute Controlled current source |
| 3652 |
\pgfcircdeclarebipolescaled{csources} |
| 3653 |
{} |
| 3654 |
{\ctikzvalof{bipoles/cisource/height}} |
| 3655 |
{cisourceC} |
| 3656 |
{\ctikzvalof{bipoles/cisource/height}} |
| 3657 |
{\ctikzvalof{bipoles/cisource/width}} |
| 3658 |
{ |
| 3659 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3660 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3661 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} |
| 3662 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3663 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} |
| 3664 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3665 |
\pgf@circ@draworfill |
| 3666 |
\pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}} |
| 3667 |
\pgfsetlinewidth{\@@thicker\pgfstartlinewidth} |
| 3668 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@up}} |
| 3669 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{.6\pgf@circ@res@down}} |
| 3670 |
\pgfsetroundcap\pgfusepath{draw} |
| 3671 |
} |
| 3672 |
|
| 3673 |
%% Noise voltage source |
| 3674 |
\pgfcircdeclarebipolescaled{sources} |
| 3675 |
{} |
| 3676 |
{\ctikzvalof{bipoles/vsource/height}} |
| 3677 |
{vsourceN} |
| 3678 |
{\ctikzvalof{bipoles/vsource/height}} |
| 3679 |
{\ctikzvalof{bipoles/vsource/width}} |
| 3680 |
{ |
| 3681 |
\pgfscope |
| 3682 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3683 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 3684 |
% |
| 3685 |
\pgf@circ@scaled@Rlen=\scaledRlen |
| 3686 |
\pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax |
| 3687 |
\edef\pgf@noise@temp{dashed} |
| 3688 |
\edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}} |
| 3689 |
\ifx\pgf@noise@temp\pgf@noise@fill |
| 3690 |
% fillable in this case |
| 3691 |
\pgf@circ@draworfillandclip |
| 3692 |
\pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}} |
| 3693 |
\pgfsetlinewidth{\@@thinner\pgfstartlinewidth} |
| 3694 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3695 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3696 |
\advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step |
| 3697 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3698 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3699 |
\advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step |
| 3700 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3701 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3702 |
\advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step |
| 3703 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3704 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3705 |
% |
| 3706 |
\advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step |
| 3707 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3708 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3709 |
\advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step |
| 3710 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3711 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3712 |
\advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step |
| 3713 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3714 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3715 |
\pgfusepath{draw} |
| 3716 |
\else |
| 3717 |
\pgfsetfillcolor{\pgf@noise@fill} |
| 3718 |
\pgfusepath{draw,fill} |
| 3719 |
\fi |
| 3720 |
\endpgfscope |
| 3721 |
\pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}} |
| 3722 |
\pgfsetlinewidth{\@@thicker\pgfstartlinewidth} |
| 3723 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 3724 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 3725 |
\pgfsetroundcap\pgfusepath{draw} |
| 3726 |
} |
| 3727 |
%% Noise current source |
| 3728 |
|
| 3729 |
\pgfcircdeclarebipolescaled{sources} |
| 3730 |
{} |
| 3731 |
{\ctikzvalof{bipoles/isource/height}} |
| 3732 |
{isourceN} |
| 3733 |
{\ctikzvalof{bipoles/isource/height}} |
| 3734 |
{\ctikzvalof{bipoles/isource/width}} |
| 3735 |
{ |
| 3736 |
\pgfscope |
| 3737 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3738 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 3739 |
% |
| 3740 |
\pgf@circ@scaled@Rlen=\scaledRlen |
| 3741 |
\pgf@circ@res@step=0.125\pgf@circ@scaled@Rlen\relax |
| 3742 |
\edef\pgf@noise@temp{dashed} |
| 3743 |
\edef\pgf@noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}} |
| 3744 |
\ifx\pgf@noise@temp\pgf@noise@fill |
| 3745 |
% fillable in this case |
| 3746 |
\pgf@circ@draworfillandclip |
| 3747 |
\pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}} |
| 3748 |
\pgfsetlinewidth{\@@thinner\pgfstartlinewidth} |
| 3749 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3750 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3751 |
\advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step |
| 3752 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3753 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3754 |
\advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step |
| 3755 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3756 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3757 |
\advance\pgf@circ@res@up by \pgf@circ@res@step\advance\pgf@circ@res@down by \pgf@circ@res@step |
| 3758 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3759 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3760 |
% |
| 3761 |
\advance\pgf@circ@res@up by -4\pgf@circ@res@step \advance\pgf@circ@res@down by -4\pgf@circ@res@step |
| 3762 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3763 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3764 |
\advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step |
| 3765 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3766 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3767 |
\advance\pgf@circ@res@up by -\pgf@circ@res@step\advance\pgf@circ@res@down by -\pgf@circ@res@step |
| 3768 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 3769 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 3770 |
\pgfusepath{draw} |
| 3771 |
\else |
| 3772 |
\pgfsetfillcolor{\pgf@noise@fill} |
| 3773 |
\pgfusepath{draw,fill} |
| 3774 |
\fi |
| 3775 |
\endpgfscope |
| 3776 |
\pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}} |
| 3777 |
\pgfsetlinewidth{\@@thicker\pgfstartlinewidth} |
| 3778 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@up}} |
| 3779 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}} |
| 3780 |
\pgfsetroundcap\pgfusepath{draw} |
| 3781 |
} |
| 3782 |
|
| 3783 |
% nullator |
| 3784 |
\pgfcircdeclarebipolescaled{sources} |
| 3785 |
{} |
| 3786 |
{\ctikzvalof{bipoles/nullator/height}} |
| 3787 |
{nullator} |
| 3788 |
{\ctikzvalof{bipoles/nullator/height}} |
| 3789 |
{\ctikzvalof{bipoles/nullator/width}} |
| 3790 |
{ |
| 3791 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3792 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 3793 |
\pgf@circ@draworfill |
| 3794 |
} |
| 3795 |
% norator |
| 3796 |
\pgfcircdeclarebipolescaled{sources} |
| 3797 |
{} |
| 3798 |
{\ctikzvalof{bipoles/norator/height}} |
| 3799 |
{norator} |
| 3800 |
{\ctikzvalof{bipoles/norator/height}} |
| 3801 |
{\ctikzvalof{bipoles/norator/width}} |
| 3802 |
{ |
| 3803 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 3804 |
\pgf@circ@res@other=\dimexpr\pgf@circ@res@right-\pgf@circ@res@up\relax |
| 3805 |
\pgfmathsetmacro{\@@angle}{atan2(\pgf@circ@res@other,\pgf@circ@res@up)} |
| 3806 |
% \typeout{ANGLE\space\@@angle} |
| 3807 |
\pgfmathsetlength{\pgf@circ@res@step}{\pgf@circ@res@up*cos(\@@angle)} |
| 3808 |
\pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@res@up*sin(\@@angle)} |
| 3809 |
% right semicircle |
| 3810 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgf@circ@res@temp}} |
| 3811 |
\pgfpatharc{180-\@@angle}{-180+\@@angle}{\pgf@circ@res@up} |
| 3812 |
% connect to left semicircle |
| 3813 |
\pgfpathlineto |
| 3814 |
{\pgfpoint{-\pgf@circ@res@other+\pgf@circ@res@step}{\pgf@circ@res@temp}} |
| 3815 |
% left semicircle |
| 3816 |
\pgfpatharc{\@@angle}{360-\@@angle}{\pgf@circ@res@up} |
| 3817 |
% connect to right semicircle |
| 3818 |
\pgfpathlineto |
| 3819 |
{\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgf@circ@res@temp}} |
| 3820 |
\pgfpathclose |
| 3821 |
\pgf@circ@draworfill |
| 3822 |
} |
| 3823 |
|
| 3824 |
% %>>> |
| 3825 |
|
| 3826 |
%% Paths definitions for Sources%<<< |
| 3827 |
|
| 3828 |
%% Batteries |
| 3829 |
|
| 3830 |
\pgfcirc@activate@bipole@simple@opt{v}{battery}{\circuitikzbasekey/bipole/is voltage=true, |
| 3831 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3832 |
\pgfcirc@activate@bipole@opt{v}{batteryone}{battery1}{battery1}{\circuitikzbasekey/bipole/is voltage=true, |
| 3833 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3834 |
\pgfcirc@activate@bipole@opt{v}{batterytwo}{battery2}{battery2}{\circuitikzbasekey/bipole/is voltage=true, |
| 3835 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3836 |
\pgfcirc@activate@bipole@opt{v}{solarsource}{solar}{solar}{\circuitikzbasekey/bipole/is voltage=true, |
| 3837 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3838 |
|
| 3839 |
%% Sources: voltage |
| 3840 |
|
| 3841 |
\pgfcirc@activate@bipole@opt{v}{vsource}{vsource}{european voltage source}{% |
| 3842 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3843 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3844 |
\pgfcirc@activate@bipole@opt{v}{vsourceam}{vsourceAM}{american voltage source}{% |
| 3845 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3846 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=false} |
| 3847 |
\pgfcirc@style@to@style{\ifpgf@circuit@europeanvoltage european \else american \fi voltage source}{voltage source} |
| 3848 |
\pgfcirc@style@to@style{voltage source}{vsource} |
| 3849 |
\pgfcirc@style@to@style{voltage source}{V} |
| 3850 |
|
| 3851 |
\pgfcirc@activate@bipole@opt{v}{cvsource}{cvsource}{european controlled voltage source}{% |
| 3852 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3853 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3854 |
\pgfcirc@activate@bipole@opt{v}{cvsourceam}{cvsourceAM}{american controlled voltage source}{% |
| 3855 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3856 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=false} |
| 3857 |
\pgfcirc@style@to@style{\ifpgf@circuit@europeanvoltage european \else american \fi controlled voltage source}{controlled voltage source} |
| 3858 |
\pgfcirc@style@to@style{controlled voltage source}{cvsource} |
| 3859 |
\pgfcirc@style@to@style{controlled voltage source}{controlled vsource} |
| 3860 |
\pgfcirc@style@to@style{controlled voltage source}{cV} |
| 3861 |
%% fix the mess about not having the shortcut accessible in every mode... |
| 3862 |
\pgfcirc@style@to@style{american voltage source}{vsourceAM} |
| 3863 |
\pgfcirc@style@to@style{american controlled voltage source}{cvsourceAM} |
| 3864 |
\pgfcirc@style@to@style{european voltage source}{vsourceEU} |
| 3865 |
\pgfcirc@style@to@style{european controlled voltage source}{cvsourceEU} |
| 3866 |
|
| 3867 |
\pgfcirc@activate@bipole@simple@opt{v}{esource}{% |
| 3868 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3869 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3870 |
|
| 3871 |
\pgfcirc@activate@bipole@opt{v}{ecsource}{ecsource}{empty controlled source}{% |
| 3872 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3873 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3874 |
\pgfcirc@style@to@style{empty controlled source}{ecsource} |
| 3875 |
|
| 3876 |
\pgfcirc@activate@bipole@opt{v}{vsourcesin}{vsourcesin}{sinusoidal voltage source}{% |
| 3877 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3878 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3879 |
\pgfcirc@style@to@style{sinusoidal voltage source}{vsourcesin} |
| 3880 |
\pgfcirc@style@to@style{sinusoidal voltage source}{sV} |
| 3881 |
|
| 3882 |
\pgfcirc@activate@bipole@opt{v}{cvsourcesin}{cvsourcesin}{controlled sinusoidal voltage source}{% |
| 3883 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3884 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3885 |
\pgfcirc@style@to@style{controlled sinusoidal voltage source}{cvsourcesin} |
| 3886 |
\pgfcirc@style@to@style{controlled sinusoidal voltage source}{controlled vsourcesin} |
| 3887 |
\pgfcirc@style@to@style{controlled sinusoidal voltage source}{csV} |
| 3888 |
|
| 3889 |
\pgfcirc@activate@bipole@opt{v}{vsourcesquare}{vsourcesquare}{square voltage source}{% |
| 3890 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3891 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3892 |
\pgfcirc@style@to@style{square voltage source}{vsourcesquare} |
| 3893 |
\pgfcirc@style@to@style{square voltage source}{sqV} |
| 3894 |
|
| 3895 |
\pgfcirc@activate@bipole@opt{v}{vsourcetri}{vsourcetri}{triangle voltage source}{% |
| 3896 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3897 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3898 |
\pgfcirc@style@to@style{triangle voltage source}{vsourcetri} |
| 3899 |
\pgfcirc@style@to@style{triangle voltage source}{tV} |
| 3900 |
|
| 3901 |
\pgfcirc@activate@bipole@simple@opt{v}{pvsource}{% |
| 3902 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3903 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3904 |
|
| 3905 |
\pgfcirc@activate@bipole@simple@opt{v}{pvmodule}{% |
| 3906 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3907 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3908 |
|
| 3909 |
\pgfcirc@activate@bipole@simple@opt{v}{dcvsource}{% |
| 3910 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3911 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3912 |
|
| 3913 |
\pgfcirc@activate@bipole@opt{v}{oosource}{oosource}{voosource}{% |
| 3914 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3915 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3916 |
|
| 3917 |
\pgfcirc@activate@bipole@simple@opt{v}{ooosource}{% |
| 3918 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3919 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3920 |
|
| 3921 |
\pgfcirc@activate@bipole@simple@opt{v}{oosourceatrans}{% |
| 3922 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3923 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3924 |
|
| 3925 |
\pgfcirc@activate@bipole@simple@opt{v}{oosourcetrans}{% |
| 3926 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3927 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3928 |
|
| 3929 |
\pgfcirc@activate@bipole@opt{v}{vsourceC}{vsourceC}{cute european voltage source}{% |
| 3930 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3931 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3932 |
\pgfcirc@style@to@style{cute european voltage source}{vsourceC} |
| 3933 |
\pgfcirc@style@to@style{cute european voltage source}{ceV} |
| 3934 |
|
| 3935 |
\pgfcirc@activate@bipole@opt{v}{cvsourceC}{cvsourceC}{cute european controlled voltage source}{% |
| 3936 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3937 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3938 |
\pgfcirc@style@to@style{cute european controlled voltage source}{cvsourceC} |
| 3939 |
\pgfcirc@style@to@style{cute european controlled voltage source}{cceV} |
| 3940 |
|
| 3941 |
\pgfcirc@activate@bipole@opt{v}{vsourceN}{vsourceN}{noise voltage source}{% |
| 3942 |
\circuitikzbasekey/bipole/is voltage=true, |
| 3943 |
\circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} |
| 3944 |
\pgfcirc@style@to@style{noise voltage source}{vsourceN} |
| 3945 |
\pgfcirc@style@to@style{noise voltage source}{nV} |
| 3946 |
|
| 3947 |
%% Sources: current |
| 3948 |
|
| 3949 |
\pgfcirc@activate@bipole@opt{i}{isource}{isource}{european current source}{% |
| 3950 |
\circuitikzbasekey/bipole/is current=true} |
| 3951 |
\pgfcirc@activate@bipole@opt{i}{isourceam}{isourceAM}{american current source}{% |
| 3952 |
\circuitikzbasekey/bipole/is current=true} |
| 3953 |
\pgfcirc@style@to@style{\ifpgf@circuit@europeancurrent european \else american \fi current source}{current source} |
| 3954 |
\pgfcirc@style@to@style{current source}{isource} |
| 3955 |
\pgfcirc@style@to@style{current source}{I} |
| 3956 |
|
| 3957 |
\pgfcirc@activate@bipole@opt{i}{cisource}{cisource}{european controlled current source}{% |
| 3958 |
\circuitikzbasekey/bipole/is current=true} |
| 3959 |
\pgfcirc@activate@bipole@opt{i}{cisourceam}{cisourceAM}{american controlled current source}{% |
| 3960 |
\circuitikzbasekey/bipole/is current=true} |
| 3961 |
\pgfcirc@style@to@style{\ifpgf@circuit@europeanvoltage european \else american \fi controlled current source}{controlled current source} |
| 3962 |
\pgfcirc@style@to@style{controlled current source}{cisource} |
| 3963 |
\pgfcirc@style@to@style{controlled current source}{controlled isource} |
| 3964 |
\pgfcirc@style@to@style{controlled current source}{cI} |
| 3965 |
%% fix the mess about not having the shortcut accessible in every mode... |
| 3966 |
\pgfcirc@style@to@style{american current source}{isourceAM} |
| 3967 |
\pgfcirc@style@to@style{american controlled current source}{cisourceAM} |
| 3968 |
\pgfcirc@style@to@style{european current source}{isourceEU} |
| 3969 |
\pgfcirc@style@to@style{european controlled current source}{cisourceEU} |
| 3970 |
|
| 3971 |
\pgfcirc@activate@bipole@opt{i}{isourcesin}{isourcesin}{sinusoidal current source}{% |
| 3972 |
\circuitikzbasekey/bipole/is current=true} |
| 3973 |
\pgfcirc@style@to@style{sinusoidal current source}{isourcesin} |
| 3974 |
\pgfcirc@style@to@style{sinusoidal current source}{sI} |
| 3975 |
|
| 3976 |
\pgfcirc@activate@bipole@opt{i}{cisourcesin}{cisourcesin}{controlled sinusoidal current source}{% |
| 3977 |
\circuitikzbasekey/bipole/is current=true} |
| 3978 |
\pgfcirc@style@to@style{controlled sinusoidal current source}{cisourcesin} |
| 3979 |
\pgfcirc@style@to@style{controlled sinusoidal current source}{controlled isourcesin} |
| 3980 |
\pgfcirc@style@to@style{controlled sinusoidal current source}{csI} |
| 3981 |
|
| 3982 |
\pgfcirc@activate@bipole@simple@opt{i}{dcisource}{% |
| 3983 |
\circuitikzbasekey/bipole/is current=true} |
| 3984 |
|
| 3985 |
\pgfcirc@activate@bipole@opt{i}{oosource}{oosource}{ioosource}{% |
| 3986 |
\circuitikzbasekey/bipole/is current=true} |
| 3987 |
|
| 3988 |
\pgfcirc@activate@bipole@opt{i}{isourceC}{isourceC}{cute european current source}{% |
| 3989 |
\circuitikzbasekey/bipole/is current=true} |
| 3990 |
\pgfcirc@style@to@style{cute european current source}{isourceC} |
| 3991 |
\pgfcirc@style@to@style{cute european current source}{ceI} |
| 3992 |
|
| 3993 |
\pgfcirc@activate@bipole@opt{i}{cisourceC}{cisourceC}{cute european controlled current source}{% |
| 3994 |
\circuitikzbasekey/bipole/is current=true} |
| 3995 |
\pgfcirc@style@to@style{cute european controlled current source}{cisourceC} |
| 3996 |
\pgfcirc@style@to@style{cute european controlled current source}{cceI} |
| 3997 |
|
| 3998 |
\pgfcirc@activate@bipole@opt{i}{isourceN}{isourceN}{noise current source}{% |
| 3999 |
\circuitikzbasekey/bipole/is current=true} |
| 4000 |
\pgfcirc@style@to@style{noise current source}{isourceN} |
| 4001 |
\pgfcirc@style@to@style{noise current source}{nI} |
| 4002 |
|
| 4003 |
% norator, nullator |
| 4004 |
\pgfcirc@activate@bipole@simple{l}{nullator} |
| 4005 |
\pgfcirc@activate@bipole@simple{l}{norator} |
| 4006 |
|
| 4007 |
% build alias with voltage and current directions (legacy) |
| 4008 |
|
| 4009 |
\def\pgf@temp#1{ |
| 4010 |
\pgfcirc@style@to@style@label{voltage source}{V#1}{v#1} |
| 4011 |
\pgfcirc@style@to@style@label{controlled voltage source}{cV#1}{v#1} |
| 4012 |
\pgfcirc@style@to@style@label{sinusoidal voltage source}{sV#1}{v#1} |
| 4013 |
\pgfcirc@style@to@style@label{controlled sinusoidal voltage source}{csV#1}{v#1} |
| 4014 |
} |
| 4015 |
\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} |
| 4016 |
\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} |
| 4017 |
\def\pgf@temp#1{ |
| 4018 |
\pgfcirc@style@to@style@label{current source}{I#1}{i#1} |
| 4019 |
\pgfcirc@style@to@style@label{controlled current source}{cI#1}{i#1} |
| 4020 |
\pgfcirc@style@to@style@label{sinusoidal current source}{sI#1}{i#1} |
| 4021 |
\pgfcirc@style@to@style@label{controlled sinusoidal current source}{csI#1}{i#1} |
| 4022 |
} |
| 4023 |
\pgf@temp{_>} \pgf@temp{_<} \pgf@temp{^>} \pgf@temp{^<} |
| 4024 |
\pgf@temp{>_} \pgf@temp{<_} \pgf@temp{>^} \pgf@temp{<^} |
| 4025 |
\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} |
| 4026 |
% %>>> |
| 4027 |
|
| 4028 |
|
| 4029 |
%%%%%%%%%%%%%% |
| 4030 |
%% Diodes |
| 4031 |
%%%%%%%%%%%%%% |
| 4032 |
|
| 4033 |
% Definitions for diodes%<<<1 |
| 4034 |
|
| 4035 |
\ctikzset{bipoles/diode/height/.initial=.50} |
| 4036 |
\ctikzset{bipoles/diode/width/.initial=.40} |
| 4037 |
% for horizontally-double-sided diodes, like tvs diodes (transorb) |
| 4038 |
\ctikzset{bipoles/ddiode/width/.initial=.80}% must be 2*diode width |
| 4039 |
% for vertically taller diodes |
| 4040 |
\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1} |
| 4041 |
\ctikzset{bipoles/bidirectionaldiode/width/.initial=1} |
| 4042 |
\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3} |
| 4043 |
\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3} |
| 4044 |
\ctikzset{bipoles/varcap/height/.initial=.50} |
| 4045 |
\ctikzset{bipoles/varcap/width/.initial=.45} |
| 4046 |
|
| 4047 |
\ctikzset{tripoles/thyristor/height/.initial=1.10} |
| 4048 |
\ctikzset{tripoles/thyristor/height 2/.initial=.5} |
| 4049 |
\ctikzset{tripoles/thyristor/width/.initial=1.0} |
| 4050 |
\ctikzset{tripoles/thyristor/diode height/.initial=.5} |
| 4051 |
\ctikzset{tripoles/thyristor/diode width left/.initial=.4} |
| 4052 |
\ctikzset{tripoles/thyristor/diode width right/.initial=.3} |
| 4053 |
\ctikzset{tripoles/thyristor/gate height/.initial=0.0} % legacy 0 |
| 4054 |
\ctikzset{tripoles/thyristor/gate kink/.initial=1.0} % legacy 1.0 |
| 4055 |
\ctikzset{tripoles/thyristor/gto space up/.initial=0.5} % legacy 0.5 |
| 4056 |
\ctikzset{tripoles/thyristor/gto space down/.initial=0.0} % legacy 0.0 |
| 4057 |
\ctikzset{tripoles/thyristor/gto bar width/.initial=0.2} % legacy 0.2 |
| 4058 |
|
| 4059 |
\ctikzset{tripoles/triac/height/.initial=1.1} |
| 4060 |
\ctikzset{tripoles/triac/width/.initial=1} |
| 4061 |
\ctikzset{tripoles/triac/diode width left/.initial=.3} |
| 4062 |
\ctikzset{tripoles/triac/diode width right/.initial=.3} |
| 4063 |
\ctikzset{tripoles/triac/gate kink/.initial=1} |
| 4064 |
|
| 4065 |
\ctikzset{thyristor style/.is choice} |
| 4066 |
\ctikzset{thyristor style/legacy/.code={% |
| 4067 |
\ctikzset{tripoles/thyristor/height=1.1}% |
| 4068 |
\ctikzset{tripoles/thyristor/height 2=.5}% |
| 4069 |
\ctikzset{tripoles/thyristor/width=1.0}% |
| 4070 |
\ctikzset{tripoles/thyristor/diode height=.5}% |
| 4071 |
\ctikzset{tripoles/thyristor/diode width left=.4}% |
| 4072 |
\ctikzset{tripoles/thyristor/diode width right=.3}% |
| 4073 |
\ctikzset{tripoles/thyristor/gate height=0.0}% |
| 4074 |
\ctikzset{tripoles/thyristor/gate kink=1.0}% |
| 4075 |
\ctikzset{tripoles/thyristor/gto space up=0.5}% |
| 4076 |
\ctikzset{tripoles/thyristor/gto space down=0.0}% |
| 4077 |
\ctikzset{tripoles/thyristor/gto bar width=0.2}% |
| 4078 |
\ctikzset{tripoles/triac/gate kink=1}% |
| 4079 |
}} |
| 4080 |
\ctikzset{thyristor style/compact/.code={% |
| 4081 |
\ctikzset{tripoles/thyristor/height=0.8}% legacy 1.1 |
| 4082 |
\ctikzset{tripoles/thyristor/height 2=.5}% |
| 4083 |
\ctikzset{tripoles/thyristor/width=1.0}% |
| 4084 |
\ctikzset{tripoles/thyristor/diode height=.5}% |
| 4085 |
\ctikzset{tripoles/thyristor/diode width left=.4}% |
| 4086 |
\ctikzset{tripoles/thyristor/diode width right=.4}%legacy 0.3 |
| 4087 |
\ctikzset{tripoles/thyristor/gate height=0.5}% legacy 0 |
| 4088 |
\ctikzset{tripoles/thyristor/gate kink=0.7}% legacy 1.0 |
| 4089 |
\ctikzset{tripoles/thyristor/gto space up=0.25}% legacy 0.5 |
| 4090 |
\ctikzset{tripoles/thyristor/gto space down=0.25}% legacy 0.0 |
| 4091 |
\ctikzset{tripoles/thyristor/gto bar width=0.2}% |
| 4092 |
\ctikzset{tripoles/triac/gate kink=.7}% |
| 4093 |
}} |
| 4094 |
|
| 4095 |
% |
| 4096 |
% Whiskers for ZZener and TVS |
| 4097 |
% |
| 4098 |
\newif\ifpgf@zz@straightwhisk |
| 4099 |
\pgf@zz@straightwhiskfalse |
| 4100 |
\ctikzset{diode straight whiskers/.code=\pgf@zz@straightwhisktrue} |
| 4101 |
\ctikzset{diode sloped whiskers/.code=\pgf@zz@straightwhiskfalse} |
| 4102 |
% |
| 4103 |
% Flipping arrows in LED and photodiodes |
| 4104 |
% |
| 4105 |
\newif\ifpgf@led@fliparrows |
| 4106 |
\newif\ifpgf@pd@fliparrows |
| 4107 |
\pgf@led@fliparrowsfalse |
| 4108 |
\pgf@pd@fliparrowsfalse |
| 4109 |
% |
| 4110 |
% by default the arrows start (LED) and go (PD) to the anode. |
| 4111 |
% |
| 4112 |
\ctikzset{led arrows from anode/.code=\pgf@led@fliparrowsfalse} |
| 4113 |
\ctikzset{pd arrows to anode/.code=\pgf@pd@fliparrowsfalse} |
| 4114 |
% |
| 4115 |
% but they can start form the cathode (LED) or go to it (PD) |
| 4116 |
% |
| 4117 |
\ctikzset{led arrows from cathode/.code=\pgf@led@fliparrowstrue} |
| 4118 |
\ctikzset{pd arrows to cathode/.code=\pgf@pd@fliparrowstrue} |
| 4119 |
|
| 4120 |
\newif\ifpgf@circuit@strokediode |
| 4121 |
\newif\ifpgf@circuit@fulldiode |
| 4122 |
\pgf@circuit@strokediodefalse |
| 4123 |
\pgf@circuit@fulldiodefalse |
| 4124 |
|
| 4125 |
\ctikzset{diode/.is choice} |
| 4126 |
\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default |
| 4127 |
\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue\pgf@circuit@strokediodefalse} |
| 4128 |
\ctikzset{diode/stroke/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodetrue} |
| 4129 |
|
| 4130 |
\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}} |
| 4131 |
\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}} |
| 4132 |
\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}} |
| 4133 |
|
| 4134 |
%%>>> |
| 4135 |
|
| 4136 |
%% Node components for diodes %<<<1 |
| 4137 |
|
| 4138 |
% beware, this shift to the left the coordinates |
| 4139 |
\def\pgf@circ@fulldiode@triangle@shift{% |
| 4140 |
\pgftransformxshift{\pgf@circ@res@left} |
| 4141 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} |
| 4142 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 4143 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} |
| 4144 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} |
| 4145 |
\pgf@circ@fill@strokecolor |
| 4146 |
\pgfusepath{draw,fill} |
| 4147 |
% \pgf@circ@debug@colors |
| 4148 |
} |
| 4149 |
|
| 4150 |
%% Black generic diode |
| 4151 |
\pgfcircdeclarebipolescaled{diodes} |
| 4152 |
{} |
| 4153 |
{\ctikzvalof{bipoles/diode/height}} |
| 4154 |
{fulldiode} |
| 4155 |
{\ctikzvalof{bipoles/diode/height}} |
| 4156 |
{\ctikzvalof{bipoles/diode/width}} |
| 4157 |
{ |
| 4158 |
|
| 4159 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4160 |
\pgfscope |
| 4161 |
\pgf@circ@fulldiode@triangle@shift |
| 4162 |
\endpgfscope |
| 4163 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4164 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4165 |
\pgfusepath{draw} |
| 4166 |
} |
| 4167 |
|
| 4168 |
%% Black Zener diode |
| 4169 |
\pgfcircdeclarebipolescaled{diodes} |
| 4170 |
{} |
| 4171 |
{\ctikzvalof{bipoles/diode/height}} |
| 4172 |
{fullzdiode} |
| 4173 |
{\ctikzvalof{bipoles/diode/height}} |
| 4174 |
{\ctikzvalof{bipoles/diode/width}} |
| 4175 |
{ |
| 4176 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4177 |
\pgf@circ@fulldiode@triangle@shift |
| 4178 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4179 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4180 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4181 |
\pgfusepath{draw} |
| 4182 |
} |
| 4183 |
|
| 4184 |
%% Black alternative zigzag Zener diode |
| 4185 |
\pgfcircdeclarebipolescaled{diodes} |
| 4186 |
{% fix the anchor border |
| 4187 |
\pgfcirc@border@extend@updown{1.3}{1.3} |
| 4188 |
} |
| 4189 |
{\ctikzvalof{bipoles/diode/height}} |
| 4190 |
{fullzzdiode} |
| 4191 |
{\ctikzvalof{bipoles/diode/height}} |
| 4192 |
{\ctikzvalof{bipoles/diode/width}} |
| 4193 |
{ |
| 4194 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4195 |
\pgf@circ@fulldiode@triangle@shift |
| 4196 |
\ifpgf@zz@straightwhisk |
| 4197 |
\edef\@@tmp{0.0} |
| 4198 |
\else |
| 4199 |
\edef\@@tmp{0.5} |
| 4200 |
\fi |
| 4201 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down-\@@tmp\pgf@circ@res@up}} |
| 4202 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4203 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4204 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up-\@@tmp\pgf@circ@res@down}} |
| 4205 |
\pgfusepath{draw} |
| 4206 |
} |
| 4207 |
|
| 4208 |
%% Black Schottky diode |
| 4209 |
\pgfcircdeclarebipolescaled{diodes} |
| 4210 |
{} |
| 4211 |
{\ctikzvalof{bipoles/diode/height}} |
| 4212 |
{fullsdiode} |
| 4213 |
{\ctikzvalof{bipoles/diode/height}} |
| 4214 |
{\ctikzvalof{bipoles/diode/width}} |
| 4215 |
{ |
| 4216 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4217 |
\pgf@circ@fulldiode@triangle@shift |
| 4218 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}} |
| 4219 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4220 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4221 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4222 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4223 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4224 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}} |
| 4225 |
\pgfusepath{draw} |
| 4226 |
} |
| 4227 |
|
| 4228 |
%% Black tunnel diode |
| 4229 |
\pgfcircdeclarebipolescaled{diodes} |
| 4230 |
{} |
| 4231 |
{\ctikzvalof{bipoles/diode/height}} |
| 4232 |
{fulltdiode} |
| 4233 |
{\ctikzvalof{bipoles/diode/height}} |
| 4234 |
{\ctikzvalof{bipoles/diode/width}} |
| 4235 |
{ |
| 4236 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4237 |
\pgf@circ@fulldiode@triangle@shift |
| 4238 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4239 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4240 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4241 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4242 |
\pgfusepath{draw} |
| 4243 |
} |
| 4244 |
% the styling of optical arrows is defined in pgfcirc.define.tex because |
| 4245 |
% they are common to phototransistors |
| 4246 |
|
| 4247 |
% |
| 4248 |
% draw LED arrows |
| 4249 |
% |
| 4250 |
\def\pgf@circ@draw@ledarrows{% |
| 4251 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 4252 |
\pgf@circ@fill@strokecolor |
| 4253 |
\pgf@circ@set@optoarrow@style |
| 4254 |
\ifpgf@led@fliparrows |
| 4255 |
\pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}} |
| 4256 |
\pgfpathlineto{\pgfpoint{-0.6\pgf@circ@res@right}{1.8\pgf@circ@res@up}} |
| 4257 |
\pgfusepath{draw} |
| 4258 |
\pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@right}{0.6\pgf@circ@res@up}} |
| 4259 |
\pgfpathlineto{\pgfpoint{0pt}{1.6\pgf@circ@res@up}} |
| 4260 |
\pgfusepath{draw} |
| 4261 |
\else |
| 4262 |
\pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4263 |
\pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} |
| 4264 |
\pgfusepath{draw} |
| 4265 |
\pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} |
| 4266 |
\pgfpathlineto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} |
| 4267 |
\pgfusepath{draw} |
| 4268 |
\fi |
| 4269 |
} |
| 4270 |
% |
| 4271 |
% ---and photodiode arrows |
| 4272 |
% |
| 4273 |
\def\pgf@circ@draw@pdarrows{% |
| 4274 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 4275 |
\pgf@circ@fill@strokecolor |
| 4276 |
\pgf@circ@set@optoarrow@style |
| 4277 |
\ifpgf@pd@fliparrows |
| 4278 |
\pgfpathmoveto{\pgfpoint{-0.6\pgf@circ@res@right}{1.8\pgf@circ@res@up}} |
| 4279 |
\pgfpathlineto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}} |
| 4280 |
\pgfusepath{draw} |
| 4281 |
\pgfpathmoveto{\pgfpoint{0pt}{1.6\pgf@circ@res@up}} |
| 4282 |
\pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@right}{0.6\pgf@circ@res@up}} |
| 4283 |
\pgfusepath{draw} |
| 4284 |
\else |
| 4285 |
\pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@right}{2\pgf@circ@res@up}} |
| 4286 |
\pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4287 |
\pgfusepath{draw} |
| 4288 |
\pgfpathmoveto{\pgfpoint{1.2\pgf@circ@res@right}{1.8\pgf@circ@res@up}} |
| 4289 |
\pgfpathlineto{\pgfpoint{0.2\pgf@circ@res@right}{0.8\pgf@circ@res@up}} |
| 4290 |
\pgfusepath{draw} |
| 4291 |
\fi |
| 4292 |
} |
| 4293 |
% |
| 4294 |
% --and laser diode arrows - contributed by Andre Alves |
| 4295 |
% |
| 4296 |
\def\pgf@circ@draw@laserarrows{% |
| 4297 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 4298 |
\pgf@circ@fill@strokecolor |
| 4299 |
\pgf@circ@set@optoarrow@style |
| 4300 |
\pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{1.1\pgf@circ@res@up}} |
| 4301 |
\pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{2.1\pgf@circ@res@up}} |
| 4302 |
\pgfusepath{draw} |
| 4303 |
\pgfpathmoveto{\pgfpoint{0.2\pgf@circ@res@right}{1.1\pgf@circ@res@up}} |
| 4304 |
\pgfpathlineto{\pgfpoint{0.2\pgf@circ@res@right}{2.1\pgf@circ@res@up}} |
| 4305 |
\pgfusepath{draw} |
| 4306 |
} |
| 4307 |
|
| 4308 |
\def\pgf@circ@generate@diode@saved@arrows#1#2#3#4#5{% |
| 4309 |
\savedanchor{\arrows}{% |
| 4310 |
\pgf@circ@scaled@Rlen=\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen |
| 4311 |
\pgf@ya=\ctikzvalof{bipoles/diode/height}\pgf@circ@scaled@Rlen |
| 4312 |
\pgf@xa=\ctikzvalof{bipoles/diode/width}\pgf@circ@scaled@Rlen |
| 4313 |
\pgf@x=.5\pgf@xa\pgf@y=.5\pgf@ya |
| 4314 |
\csname ifpgf@#5@fliparrows\endcsname |
| 4315 |
\pgf@x=#1\pgf@x\pgf@y=#2\pgf@y |
| 4316 |
\else |
| 4317 |
\pgf@x=#3\pgf@x\pgf@y=#4\pgf@y |
| 4318 |
\fi |
| 4319 |
} |
| 4320 |
} |
| 4321 |
%% Black light emitting diode |
| 4322 |
\pgfcircdeclarebipolescaled{diodes} |
| 4323 |
{% fix the anchor border |
| 4324 |
\pgfcirc@border@extend@updown{1.8}{1} |
| 4325 |
\pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{led} |
| 4326 |
\anchor{arrows}{\arrows} |
| 4327 |
} |
| 4328 |
{\ctikzvalof{bipoles/diode/height}} |
| 4329 |
{fulllediode} |
| 4330 |
{\ctikzvalof{bipoles/diode/height}} |
| 4331 |
{\ctikzvalof{bipoles/diode/width}} |
| 4332 |
{ |
| 4333 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4334 |
\pgfscope |
| 4335 |
\pgf@circ@fulldiode@triangle@shift |
| 4336 |
\endpgfscope |
| 4337 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4338 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4339 |
\pgfusepath{draw} |
| 4340 |
\pgf@circ@draw@ledarrows |
| 4341 |
} |
| 4342 |
|
| 4343 |
%% Black laser diode - contributed by Andre Alves |
| 4344 |
\pgfcircdeclarebipolescaled{diodes} |
| 4345 |
{% fix the anchor border |
| 4346 |
\pgfcirc@border@extend@updown{1.8}{1} |
| 4347 |
\pgf@circ@generate@diode@saved@arrows{-0.1}{2.2}{-0.1}{2.2}{pd}%pd or led dosen't matter |
| 4348 |
\anchor{arrows}{\arrows} |
| 4349 |
} |
| 4350 |
{\ctikzvalof{bipoles/diode/height}} |
| 4351 |
{fulllaserdiode} |
| 4352 |
{\ctikzvalof{bipoles/diode/height}} |
| 4353 |
{\ctikzvalof{bipoles/diode/width}} |
| 4354 |
{ |
| 4355 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4356 |
\pgfscope |
| 4357 |
\pgf@circ@fulldiode@triangle@shift |
| 4358 |
\endpgfscope |
| 4359 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4360 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4361 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4362 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4363 |
\pgfusepath{draw} |
| 4364 |
\pgf@circ@draw@laserarrows |
| 4365 |
} |
| 4366 |
|
| 4367 |
%% Black photodiode |
| 4368 |
\pgfcircdeclarebipolescaled{diodes} |
| 4369 |
{% fix the anchor border |
| 4370 |
\pgfcirc@border@extend@updown{1.8}{1} |
| 4371 |
\pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{pd} |
| 4372 |
\anchor{arrows}{\arrows} |
| 4373 |
} |
| 4374 |
{\ctikzvalof{bipoles/diode/height}} |
| 4375 |
{fullpdiode} |
| 4376 |
{\ctikzvalof{bipoles/diode/height}} |
| 4377 |
{\ctikzvalof{bipoles/diode/width}} |
| 4378 |
{ |
| 4379 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4380 |
\pgfscope |
| 4381 |
\pgf@circ@fulldiode@triangle@shift |
| 4382 |
\endpgfscope |
| 4383 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4384 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4385 |
\pgfusepath{draw} |
| 4386 |
\pgf@circ@draw@pdarrows |
| 4387 |
} |
| 4388 |
|
| 4389 |
%% Black varcap |
| 4390 |
\pgfcircdeclarebipolescaled{diodes} |
| 4391 |
{} |
| 4392 |
{\ctikzvalof{bipoles/varcap/height}} |
| 4393 |
{fullvarcap} |
| 4394 |
{\ctikzvalof{bipoles/varcap/height}} |
| 4395 |
{\ctikzvalof{bipoles/varcap/width}} |
| 4396 |
{ |
| 4397 |
\pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth |
| 4398 |
\pgfsetlinewidth{\pgf@circ@res@temp} |
| 4399 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}} |
| 4400 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4401 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4402 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}} |
| 4403 |
\pgf@circ@fill@strokecolor |
| 4404 |
\pgfusepath{draw,fill} |
| 4405 |
% |
| 4406 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}} |
| 4407 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}} |
| 4408 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4409 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4410 |
\pgfusepath{draw} |
| 4411 |
} |
| 4412 |
|
| 4413 |
%% Code for the diode triangle |
| 4414 |
\def\pgf@circ@basicdiodeshape{ |
| 4415 |
% \pgfscope |
| 4416 |
\pgftransformxshift{\pgf@circ@res@left} |
| 4417 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} |
| 4418 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 4419 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} |
| 4420 |
\pgfpathclose |
| 4421 |
\pgf@circ@draworfill |
| 4422 |
\pgfscope |
| 4423 |
% to allow filling, we need to draw explicitly the stroke here. |
| 4424 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 4425 |
\ifpgf@circuit@bipole@strokedsymbol |
| 4426 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} |
| 4427 |
\pgfpathlineto{\pgfpoint{0pt}{0pt}} |
| 4428 |
\pgfusepath{draw} |
| 4429 |
\fi |
| 4430 |
\endpgfscope |
| 4431 |
% \endpgfscope |
| 4432 |
} |
| 4433 |
|
| 4434 |
%% Empty generic diode |
| 4435 |
\pgfcircdeclarebipolescaled{diodes} |
| 4436 |
{} |
| 4437 |
{\ctikzvalof{bipoles/diode/height}} |
| 4438 |
{emptydiode} |
| 4439 |
{\ctikzvalof{bipoles/diode/height}} |
| 4440 |
{\ctikzvalof{bipoles/diode/width}} |
| 4441 |
{ |
| 4442 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4443 |
\pgfscope |
| 4444 |
\pgf@circ@basicdiodeshape |
| 4445 |
\endpgfscope |
| 4446 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4447 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4448 |
\pgfusepath{draw} |
| 4449 |
} |
| 4450 |
|
| 4451 |
%% Empty Zener diode |
| 4452 |
\pgfcircdeclarebipolescaled{diodes} |
| 4453 |
{} |
| 4454 |
{\ctikzvalof{bipoles/diode/height}} |
| 4455 |
{emptyzdiode} |
| 4456 |
{\ctikzvalof{bipoles/diode/height}} |
| 4457 |
{\ctikzvalof{bipoles/diode/width}} |
| 4458 |
{ |
| 4459 |
|
| 4460 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4461 |
|
| 4462 |
\pgfscope |
| 4463 |
\pgf@circ@basicdiodeshape |
| 4464 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4465 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4466 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4467 |
\pgfusepath{draw} |
| 4468 |
\endpgfscope |
| 4469 |
} |
| 4470 |
|
| 4471 |
%% Empty alternative zigzag Zener diode |
| 4472 |
\pgfcircdeclarebipolescaled{diodes} |
| 4473 |
{% fix the anchor border |
| 4474 |
\pgfcirc@border@extend@updown{1.3}{1.3} |
| 4475 |
} |
| 4476 |
{\ctikzvalof{bipoles/diode/height}} |
| 4477 |
{emptyzzdiode} |
| 4478 |
{\ctikzvalof{bipoles/diode/height}} |
| 4479 |
{\ctikzvalof{bipoles/diode/width}} |
| 4480 |
{ |
| 4481 |
|
| 4482 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4483 |
|
| 4484 |
\pgfscope |
| 4485 |
\pgf@circ@basicdiodeshape |
| 4486 |
\ifpgf@zz@straightwhisk |
| 4487 |
\edef\@@tmp{0.0} |
| 4488 |
\else |
| 4489 |
\edef\@@tmp{0.5} |
| 4490 |
\fi |
| 4491 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down-\@@tmp\pgf@circ@res@up}} |
| 4492 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4493 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4494 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up-\@@tmp\pgf@circ@res@down}} |
| 4495 |
\pgfusepath{draw} |
| 4496 |
\endpgfscope |
| 4497 |
} |
| 4498 |
%% Empty Schottky diode |
| 4499 |
\pgfcircdeclarebipolescaled{diodes} |
| 4500 |
{} |
| 4501 |
{\ctikzvalof{bipoles/diode/height}} |
| 4502 |
{emptysdiode} |
| 4503 |
{\ctikzvalof{bipoles/diode/height}} |
| 4504 |
{\ctikzvalof{bipoles/diode/width}} |
| 4505 |
{ |
| 4506 |
|
| 4507 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4508 |
\pgfscope |
| 4509 |
\pgf@circ@basicdiodeshape |
| 4510 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@down}} |
| 4511 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4512 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4513 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4514 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4515 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4516 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{.6\pgf@circ@res@up}} |
| 4517 |
\pgfusepath{draw} |
| 4518 |
\endpgfscope |
| 4519 |
|
| 4520 |
} |
| 4521 |
|
| 4522 |
%% Empty tunnel diode |
| 4523 |
\pgfcircdeclarebipolescaled{diodes} |
| 4524 |
{} |
| 4525 |
{\ctikzvalof{bipoles/diode/height}} |
| 4526 |
{emptytdiode} |
| 4527 |
{\ctikzvalof{bipoles/diode/height}} |
| 4528 |
{\ctikzvalof{bipoles/diode/width}} |
| 4529 |
{ |
| 4530 |
|
| 4531 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4532 |
\pgfscope |
| 4533 |
\pgf@circ@basicdiodeshape |
| 4534 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4535 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4536 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4537 |
\pgfpathlineto{\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4538 |
\pgfusepath{draw} |
| 4539 |
\endpgfscope |
| 4540 |
} |
| 4541 |
|
| 4542 |
%% Empty light emitting diode |
| 4543 |
\pgfcircdeclarebipolescaled{diodes} |
| 4544 |
{% fix the anchor border |
| 4545 |
\pgfcirc@border@extend@updown{1.8}{1} |
| 4546 |
\pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{led} |
| 4547 |
\anchor{arrows}{\arrows} |
| 4548 |
} |
| 4549 |
{\ctikzvalof{bipoles/diode/height}} |
| 4550 |
{emptylediode} |
| 4551 |
{\ctikzvalof{bipoles/diode/height}} |
| 4552 |
{\ctikzvalof{bipoles/diode/width}} |
| 4553 |
{ |
| 4554 |
|
| 4555 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4556 |
\pgfscope |
| 4557 |
\pgf@circ@basicdiodeshape |
| 4558 |
\endpgfscope |
| 4559 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4560 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4561 |
\pgfusepath{draw} |
| 4562 |
|
| 4563 |
\pgf@circ@draw@ledarrows |
| 4564 |
} |
| 4565 |
|
| 4566 |
%% Empty laser diode - contributed by Andre Alves |
| 4567 |
\pgfcircdeclarebipolescaled{diodes} |
| 4568 |
{% fix the anchor border |
| 4569 |
\pgfcirc@border@extend@updown{1.8}{1} |
| 4570 |
\pgf@circ@generate@diode@saved@arrows{-0.1}{2.2}{-0.1}{2.2}{pd}%pd or led dosen't matter |
| 4571 |
\anchor{arrows}{\arrows} |
| 4572 |
} |
| 4573 |
{\ctikzvalof{bipoles/diode/height}} |
| 4574 |
{emptylaserdiode} |
| 4575 |
{\ctikzvalof{bipoles/diode/height}} |
| 4576 |
{\ctikzvalof{bipoles/diode/width}} |
| 4577 |
{ |
| 4578 |
|
| 4579 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4580 |
\pgfscope |
| 4581 |
\pgf@circ@basicdiodeshape |
| 4582 |
\endpgfscope |
| 4583 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4584 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4585 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4586 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4587 |
\pgfusepath{draw} |
| 4588 |
|
| 4589 |
\pgf@circ@draw@laserarrows |
| 4590 |
} |
| 4591 |
|
| 4592 |
%% Empty photodiode |
| 4593 |
\pgfcircdeclarebipolescaled{diodes} |
| 4594 |
{% fix the anchor border |
| 4595 |
\pgfcirc@border@extend@updown{1.8}{1} |
| 4596 |
\pgf@circ@generate@diode@saved@arrows{-0.2}{2.0}{1.0}{2.0}{pd} |
| 4597 |
\anchor{arrows}{\arrows} |
| 4598 |
} |
| 4599 |
{\ctikzvalof{bipoles/diode/height}} |
| 4600 |
{emptypdiode} |
| 4601 |
{\ctikzvalof{bipoles/diode/height}} |
| 4602 |
{\ctikzvalof{bipoles/diode/width}} |
| 4603 |
{ |
| 4604 |
|
| 4605 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4606 |
\pgfscope |
| 4607 |
\pgf@circ@basicdiodeshape |
| 4608 |
\endpgfscope |
| 4609 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4610 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4611 |
\pgfusepath{draw} |
| 4612 |
|
| 4613 |
\pgf@circ@draw@pdarrows |
| 4614 |
} |
| 4615 |
|
| 4616 |
%% Empty varcap |
| 4617 |
\pgfcircdeclarebipolescaled{diodes} |
| 4618 |
{} |
| 4619 |
{\ctikzvalof{bipoles/varcap/height}} |
| 4620 |
{emptyvarcap} |
| 4621 |
{\ctikzvalof{bipoles/varcap/height}} |
| 4622 |
{\ctikzvalof{bipoles/varcap/width}} |
| 4623 |
{ |
| 4624 |
\pgf@circ@res@temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth |
| 4625 |
\pgfsetlinewidth{\pgf@circ@res@temp} |
| 4626 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}} |
| 4627 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4628 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4629 |
% \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}} |
| 4630 |
\pgfpathclose |
| 4631 |
\pgf@circ@draworfill |
| 4632 |
\pgfscope |
| 4633 |
% to allow filling, we need to draw explicitily the stroke here. |
| 4634 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 4635 |
\ifpgf@circuit@bipole@strokedsymbol |
| 4636 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}} |
| 4637 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 4638 |
\pgfusepath{draw} |
| 4639 |
\fi |
| 4640 |
\endpgfscope |
| 4641 |
% |
| 4642 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}} |
| 4643 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@up}} |
| 4644 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4645 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4646 |
\pgfusepath{draw} |
| 4647 |
} |
| 4648 |
|
| 4649 |
%% Transorbs |
| 4650 |
%% Empty zigzag TVS diode (transorb) |
| 4651 |
\pgfcircdeclarebipolescaled{diodes} |
| 4652 |
{% fix the anchor border |
| 4653 |
\pgfcirc@border@extend@updown{1.3}{1.3} |
| 4654 |
} |
| 4655 |
{\ctikzvalof{bipoles/diode/height}} |
| 4656 |
{emptytvsdiode} |
| 4657 |
{\ctikzvalof{bipoles/diode/height}} |
| 4658 |
{\ctikzvalof{bipoles/ddiode/width}} |
| 4659 |
{ |
| 4660 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4661 |
\pgfscope |
| 4662 |
\pgfscope |
| 4663 |
\pgftransformxscale{0.5} |
| 4664 |
\pgftransformxshift{\pgf@circ@res@left} |
| 4665 |
\pgf@circ@basicdiodeshape |
| 4666 |
\endpgfscope |
| 4667 |
\pgfscope |
| 4668 |
\pgftransformxscale{-0.5} |
| 4669 |
\pgftransformxshift{\pgf@circ@res@left} |
| 4670 |
\pgf@circ@basicdiodeshape |
| 4671 |
\endpgfscope |
| 4672 |
\ifpgf@zz@straightwhisk |
| 4673 |
\edef\@@tmp{1.0} |
| 4674 |
\else |
| 4675 |
\edef\@@tmp{1.3} |
| 4676 |
\fi |
| 4677 |
\pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{\@@tmp\pgf@circ@res@up}} |
| 4678 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 4679 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} |
| 4680 |
\pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{\@@tmp\pgf@circ@res@down}} |
| 4681 |
\pgfusepath{draw} |
| 4682 |
\endpgfscope |
| 4683 |
} |
| 4684 |
%% Black zigzag TVS diode (transorb) |
| 4685 |
\pgfcircdeclarebipolescaled{diodes} |
| 4686 |
{% fix the anchor border |
| 4687 |
\pgfcirc@border@extend@updown{1.3}{1.3} |
| 4688 |
} |
| 4689 |
{\ctikzvalof{bipoles/diode/height}} |
| 4690 |
{fulltvsdiode} |
| 4691 |
{\ctikzvalof{bipoles/diode/height}} |
| 4692 |
{\ctikzvalof{bipoles/ddiode/width}} |
| 4693 |
{ |
| 4694 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4695 |
\pgfscope |
| 4696 |
\pgftransformxscale{0.5} |
| 4697 |
\pgftransformxshift{\pgf@circ@res@left} |
| 4698 |
\pgf@circ@fulldiode@triangle@shift |
| 4699 |
\endpgfscope |
| 4700 |
\pgfscope |
| 4701 |
\pgftransformxscale{-0.5} |
| 4702 |
\pgftransformxshift{\pgf@circ@res@left} |
| 4703 |
\pgf@circ@fulldiode@triangle@shift |
| 4704 |
\endpgfscope |
| 4705 |
\ifpgf@zz@straightwhisk |
| 4706 |
\edef\@@tmp{1.0} |
| 4707 |
\else |
| 4708 |
\edef\@@tmp{1.3} |
| 4709 |
\fi |
| 4710 |
\pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{\@@tmp\pgf@circ@res@up}} |
| 4711 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 4712 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} |
| 4713 |
\pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{\@@tmp\pgf@circ@res@down}} |
| 4714 |
\pgfusepath{draw} |
| 4715 |
} |
| 4716 |
|
| 4717 |
%% Black Shockley diode |
| 4718 |
\pgfcircdeclarebipolescaled{diodes} |
| 4719 |
{} |
| 4720 |
{\ctikzvalof{bipoles/diode/height}} |
| 4721 |
{fullshdiode} |
| 4722 |
{\ctikzvalof{bipoles/diode/height}} |
| 4723 |
{\ctikzvalof{bipoles/diode/width}} |
| 4724 |
{ |
| 4725 |
|
| 4726 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4727 |
\pgfscope |
| 4728 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4729 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4730 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 4731 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 4732 |
\pgfpathclose |
| 4733 |
\pgf@circ@fill@strokecolor |
| 4734 |
\pgfusepath{draw,fill} |
| 4735 |
\endpgfscope |
| 4736 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4737 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4738 |
\pgfusepath{draw} |
| 4739 |
} |
| 4740 |
%% Empty generic diode |
| 4741 |
\pgfcircdeclarebipolescaled{diodes} |
| 4742 |
{} |
| 4743 |
{\ctikzvalof{bipoles/diode/height}} |
| 4744 |
{emptyshdiode} |
| 4745 |
{\ctikzvalof{bipoles/diode/height}} |
| 4746 |
{\ctikzvalof{bipoles/diode/width}} |
| 4747 |
{ |
| 4748 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4749 |
\pgfscope |
| 4750 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 4751 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 4752 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 4753 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 4754 |
\pgfpathclose |
| 4755 |
\pgf@circ@draworfill |
| 4756 |
\endpgfscope |
| 4757 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 4758 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 4759 |
\pgfusepath{draw} |
| 4760 |
} |
| 4761 |
|
| 4762 |
%% Empty bidirectionaldiode |
| 4763 |
\pgfcircdeclarebipolescaled{diodes} |
| 4764 |
{} |
| 4765 |
{\ctikzvalof{bipoles/bidirectionaldiode/height}} |
| 4766 |
{emptybidirectionaldiode} |
| 4767 |
{\ctikzvalof{bipoles/bidirectionaldiode/height}} |
| 4768 |
{\ctikzvalof{bipoles/bidirectionaldiode/width}} |
| 4769 |
{ |
| 4770 |
|
| 4771 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4772 |
|
| 4773 |
\pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left |
| 4774 |
\pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right |
| 4775 |
|
| 4776 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 4777 |
\pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 4778 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4779 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4780 |
|
| 4781 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4782 |
\pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 4783 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4784 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4785 |
|
| 4786 |
\pgf@circ@draworfill |
| 4787 |
|
| 4788 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 4789 |
|
| 4790 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 4791 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 4792 |
|
| 4793 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4794 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 4795 |
|
| 4796 |
\pgfusepath{draw} |
| 4797 |
} |
| 4798 |
|
| 4799 |
%% Full bidirectionaldiode |
| 4800 |
\pgfcircdeclarebipolescaled{diodes} |
| 4801 |
{} |
| 4802 |
{\ctikzvalof{bipoles/bidirectionaldiode/height}} |
| 4803 |
{fullbidirectionaldiode} |
| 4804 |
{\ctikzvalof{bipoles/bidirectionaldiode/height}} |
| 4805 |
{\ctikzvalof{bipoles/bidirectionaldiode/width}} |
| 4806 |
{ |
| 4807 |
|
| 4808 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4809 |
|
| 4810 |
\pgf@circ@res@other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf@circ@res@left |
| 4811 |
\pgf@circ@res@step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf@circ@res@right |
| 4812 |
|
| 4813 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 4814 |
\pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 4815 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4816 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4817 |
|
| 4818 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4819 |
\pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 4820 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4821 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 4822 |
|
| 4823 |
\pgf@circ@fill@strokecolor |
| 4824 |
\pgfusepath{draw, fill} |
| 4825 |
|
| 4826 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 4827 |
|
| 4828 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 4829 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 4830 |
|
| 4831 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4832 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 4833 |
|
| 4834 |
\pgfusepath{draw} |
| 4835 |
} |
| 4836 |
|
| 4837 |
%%% Thyristors in general |
| 4838 |
|
| 4839 |
\def\pgfcircdeclarethyristor#1#2#3#4{%name, fill (0-> black; 1-empty), gate position (1: catode, -1: anode), extra code |
| 4840 |
\pgfcircdeclarebipolescaled{diodes} |
| 4841 |
{ |
| 4842 |
\savedmacro{\gatekink}{\edef\gatekink{\ctikzvalof{tripoles/thyristor/gate kink}}} |
| 4843 |
\anchor{gate}{\northeast\pgf@x=\gatekink\pgf@x\pgf@x=#3\pgf@x} |
| 4844 |
\anchor{G}{\northeast\pgf@x=\gatekink\pgf@x\pgf@x=#3\pgf@x} |
| 4845 |
\anchor{anode}{\southwest\pgf@y=0cm} |
| 4846 |
\anchor{cathode}{\northeast\pgf@y=0cm } |
| 4847 |
} |
| 4848 |
{\ctikzvalof{tripoles/thyristor/height 2}} |
| 4849 |
{#1} |
| 4850 |
{\ctikzvalof{tripoles/thyristor/height}} |
| 4851 |
{\ctikzvalof{tripoles/thyristor/width}} |
| 4852 |
{ |
| 4853 |
\pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left |
| 4854 |
\pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right |
| 4855 |
\pgfscope |
| 4856 |
% draw the thick parts here (shifted horizontally) |
| 4857 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 4858 |
% draw the basic triangle |
| 4859 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4860 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} |
| 4861 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 4862 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4863 |
\pgfpathclose |
| 4864 |
\ifnum#2=0\relax |
| 4865 |
\pgf@circ@fill@strokecolor |
| 4866 |
\pgfusepath{draw,fill} |
| 4867 |
\else |
| 4868 |
\pgf@circ@draworfill |
| 4869 |
\fi |
| 4870 |
% draw the vertical bar |
| 4871 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 4872 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}} |
| 4873 |
\pgfusepath{draw} |
| 4874 |
\endpgfscope |
| 4875 |
% back to normal linewidth |
| 4876 |
% stroke if needed |
| 4877 |
\ifpgf@circuit@bipole@strokedsymbol |
| 4878 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4879 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 4880 |
\pgfusepath{draw} |
| 4881 |
\fi |
| 4882 |
% draw the gate thing; |
| 4883 |
#4% |
| 4884 |
% draw the leads in/out |
| 4885 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 4886 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 4887 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 4888 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 4889 |
\pgfusepath{draw} |
| 4890 |
} |
| 4891 |
} |
| 4892 |
|
| 4893 |
\def\pgfcirc@thyristor@simplegate{% |
| 4894 |
\pgfpathmoveto{\pgfpoint |
| 4895 |
{\pgf@circ@res@step} |
| 4896 |
{\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4897 |
} |
| 4898 |
\pgfpathlineto{\pgfpoint |
| 4899 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4900 |
{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up} |
| 4901 |
} |
| 4902 |
\pgfpathlineto{\pgfpoint |
| 4903 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4904 |
{\pgf@circ@res@up} |
| 4905 |
} |
| 4906 |
\pgfusepath{draw} |
| 4907 |
} |
| 4908 |
|
| 4909 |
%% Black thyristor |
| 4910 |
\pgfcircdeclarethyristor{fullthyristor}{0}{1}{\pgfcirc@thyristor@simplegate} |
| 4911 |
%% Empty thyristor |
| 4912 |
\pgfcircdeclarethyristor{emptythyristor}{1}{1}{\pgfcirc@thyristor@simplegate} |
| 4913 |
%% black and empty GTO (standard: double line symbol, no arrow) |
| 4914 |
|
| 4915 |
\def\pgfcirc@doublegate@gto@add{ |
| 4916 |
% connection to gate terminal |
| 4917 |
\pgfpathmoveto{\pgfpoint |
| 4918 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4919 |
{\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up - |
| 4920 |
\ctikzvalof{tripoles/thyristor/gto space down}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4921 |
} |
| 4922 |
\pgfpathlineto{\pgfpoint |
| 4923 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4924 |
{\pgf@circ@res@up} |
| 4925 |
} |
| 4926 |
\pgfusepath{draw} |
| 4927 |
\pgfscope |
| 4928 |
\pgfcirc@set@arrows{gto gate}{}{} |
| 4929 |
% \pgfsetarrowsstart{latexslim} |
| 4930 |
% first (lower) gto line: from body to gate |
| 4931 |
\pgfpathmoveto{\pgfpoint |
| 4932 |
{\pgf@circ@res@step} |
| 4933 |
{(\ctikzvalof{tripoles/thyristor/gate height}-\ctikzvalof{tripoles/thyristor/gto space down}) |
| 4934 |
*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4935 |
} |
| 4936 |
\pgfpathlineto{\pgfpoint |
| 4937 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4938 |
{\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up - |
| 4939 |
\ctikzvalof{tripoles/thyristor/gto space down}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4940 |
} |
| 4941 |
\pgfusepath{draw} |
| 4942 |
% second (higher) gto line: from gate to body |
| 4943 |
\pgfpathmoveto{\pgfpoint |
| 4944 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4945 |
{\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up + |
| 4946 |
\ctikzvalof{tripoles/thyristor/gto space up}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4947 |
} |
| 4948 |
\pgfpathlineto{\pgfpoint |
| 4949 |
{\pgf@circ@res@step} |
| 4950 |
{(\ctikzvalof{tripoles/thyristor/gate height}+\ctikzvalof{tripoles/thyristor/gto space up}) |
| 4951 |
*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4952 |
} |
| 4953 |
\pgfusepath{draw} |
| 4954 |
\endpgfscope |
| 4955 |
} |
| 4956 |
\pgfcircdeclarethyristor{fullgto}{0}{1}{\pgfcirc@doublegate@gto@add} |
| 4957 |
\pgfcircdeclarethyristor{emptygto}{1}{1}{\pgfcirc@doublegate@gto@add} |
| 4958 |
|
| 4959 |
\def\pgfcirc@bargate@gto@add{% |
| 4960 |
\pgfpathmoveto{\pgfpoint |
| 4961 |
{\pgf@circ@res@step} |
| 4962 |
{\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4963 |
} |
| 4964 |
\pgfpathlineto{\pgfpoint |
| 4965 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4966 |
{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up} |
| 4967 |
} |
| 4968 |
\pgfpathlineto{\pgfpoint |
| 4969 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 4970 |
{\pgf@circ@res@up} |
| 4971 |
} |
| 4972 |
% draw bar line. |
| 4973 |
\pgfpathmoveto{\pgfpoint |
| 4974 |
{(\ctikzvalof{tripoles/thyristor/gate kink}-\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@right} |
| 4975 |
{(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up} |
| 4976 |
} |
| 4977 |
\pgfpathlineto{\pgfpoint |
| 4978 |
{(\ctikzvalof{tripoles/thyristor/gate kink}+\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@right} |
| 4979 |
{(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up} |
| 4980 |
} |
| 4981 |
\pgfusepath{draw} |
| 4982 |
} |
| 4983 |
|
| 4984 |
\pgfcircdeclarethyristor{fullgtobar}{0}{1}{\pgfcirc@bargate@gto@add} |
| 4985 |
\pgfcircdeclarethyristor{emptygtobar}{1}{1}{\pgfcirc@bargate@gto@add} |
| 4986 |
|
| 4987 |
%% Thyristors with anode-connected gate |
| 4988 |
|
| 4989 |
\def\pgfcirc@thyristor@anodegate{% |
| 4990 |
\pgfpathmoveto{\pgfpoint |
| 4991 |
{\pgf@circ@res@other} |
| 4992 |
{\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 4993 |
} |
| 4994 |
\pgfpathlineto{\pgfpoint |
| 4995 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left} |
| 4996 |
{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up} |
| 4997 |
} |
| 4998 |
\pgfpathlineto{\pgfpoint |
| 4999 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left} |
| 5000 |
{\pgf@circ@res@up} |
| 5001 |
} |
| 5002 |
\pgfusepath{draw} |
| 5003 |
} |
| 5004 |
|
| 5005 |
%% Black PUT |
| 5006 |
\pgfcircdeclarethyristor{fullput}{0}{-1}{\pgfcirc@thyristor@anodegate} |
| 5007 |
%% Empty PUT |
| 5008 |
\pgfcircdeclarethyristor{emptyput}{1}{-1}{\pgfcirc@thyristor@anodegate} |
| 5009 |
%% black and empty GTO (standard: double line symbol, no arrow) |
| 5010 |
|
| 5011 |
\def\pgfcirc@anodebargate@gto@add{% |
| 5012 |
\pgfpathmoveto{\pgfpoint |
| 5013 |
{\pgf@circ@res@other} |
| 5014 |
{\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 5015 |
} |
| 5016 |
\pgfpathlineto{\pgfpoint |
| 5017 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left} |
| 5018 |
{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up} |
| 5019 |
} |
| 5020 |
\pgfpathlineto{\pgfpoint |
| 5021 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@left} |
| 5022 |
{\pgf@circ@res@up} |
| 5023 |
} |
| 5024 |
% draw bar line. |
| 5025 |
\pgfpathmoveto{\pgfpoint |
| 5026 |
{(\ctikzvalof{tripoles/thyristor/gate kink}-\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@left} |
| 5027 |
{(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up} |
| 5028 |
} |
| 5029 |
\pgfpathlineto{\pgfpoint |
| 5030 |
{(\ctikzvalof{tripoles/thyristor/gate kink}+\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@left} |
| 5031 |
{(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up} |
| 5032 |
} |
| 5033 |
\pgfusepath{draw} |
| 5034 |
} |
| 5035 |
|
| 5036 |
\pgfcircdeclarethyristor{fullagtobar}{0}{-1}{\pgfcirc@anodebargate@gto@add} |
| 5037 |
\pgfcircdeclarethyristor{emptyagtobar}{1}{-1}{\pgfcirc@anodebargate@gto@add} |
| 5038 |
|
| 5039 |
% Triacs |
| 5040 |
|
| 5041 |
\def\pgfcircdeclaretriac#1#2{%name, fill (0-> black; 1-empty) |
| 5042 |
\pgfcircdeclarebipolescaled{diodes} |
| 5043 |
{ |
| 5044 |
\savedmacro{\gatekink}{\edef\gatekink{\ctikzvalof{tripoles/triac/gate kink}}} |
| 5045 |
\anchor{gate}{\northeast\pgf@x=\gatekink\pgf@x} |
| 5046 |
\anchor{G}{\northeast\pgf@x=\gatekink\pgf@x} |
| 5047 |
\anchor{anode}{\southwest\pgf@y=0cm} |
| 5048 |
\anchor{cathode}{\northeast\pgf@y=0cm } |
| 5049 |
} |
| 5050 |
{\ctikzvalof{tripoles/triac/height}} |
| 5051 |
{#1} |
| 5052 |
{\ctikzvalof{tripoles/triac/height}} |
| 5053 |
{\ctikzvalof{tripoles/triac/width}} |
| 5054 |
{ |
| 5055 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5056 |
|
| 5057 |
\pgf@circ@res@other = \ctikzvalof{tripoles/triac/diode width left}\pgf@circ@res@left |
| 5058 |
\pgf@circ@res@step = \ctikzvalof{tripoles/triac/diode width right}\pgf@circ@res@right |
| 5059 |
|
| 5060 |
% diodes forms |
| 5061 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 5062 |
\pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@step}{0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 5063 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 5064 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 5065 |
|
| 5066 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 5067 |
\pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@other}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 5068 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 5069 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} |
| 5070 |
|
| 5071 |
\ifnum#2=0\relax |
| 5072 |
\pgf@circ@fill@strokecolor |
| 5073 |
\pgfusepath{draw,fill} |
| 5074 |
\else |
| 5075 |
\pgf@circ@draworfill |
| 5076 |
\fi |
| 5077 |
|
| 5078 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 5079 |
|
| 5080 |
% draw gate |
| 5081 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-0.707*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 5082 |
\pgfpathlineto{\pgfpoint |
| 5083 |
{\ctikzvalof{tripoles/triac/gate kink}*\pgf@circ@res@right} |
| 5084 |
{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} % sqrt(1/2) |
| 5085 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/triac/gate kink}*\pgf@circ@res@right}{\pgf@circ@res@up}} % sqrt(1/2) |
| 5086 |
|
| 5087 |
% draw leads |
| 5088 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 5089 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5090 |
|
| 5091 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 5092 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5093 |
|
| 5094 |
\pgfusepath{draw} |
| 5095 |
|
| 5096 |
} |
| 5097 |
} |
| 5098 |
|
| 5099 |
\pgfcircdeclaretriac{fulltriac}{0} |
| 5100 |
\pgfcircdeclaretriac{emptytriac}{1} |
| 5101 |
|
| 5102 |
% IGCT : contributed by Paul Sacco |
| 5103 |
|
| 5104 |
\def\pgfcircdeclareIGCT#1#2#3{%name, fill (0-> black; 1-empty), gate position (1: catode, -1: anode) |
| 5105 |
\pgfcircdeclarebipolescaled{diodes} |
| 5106 |
{ |
| 5107 |
\savedmacro{\gatekink}{\edef\gatekink{\ctikzvalof{tripoles/thyristor/gate kink}}} |
| 5108 |
\anchor{gate}{\northeast\pgf@x=\gatekink\pgf@x\pgf@x=#3\pgf@x} |
| 5109 |
\anchor{G}{\northeast\pgf@x=\gatekink\pgf@x\pgf@x=#3\pgf@x} |
| 5110 |
\anchor{anode}{\southwest\pgf@y=0cm} |
| 5111 |
\anchor{cathode}{\northeast\pgf@y=0cm } |
| 5112 |
} |
| 5113 |
{\ctikzvalof{tripoles/thyristor/height 2}} |
| 5114 |
{#1} |
| 5115 |
{\ctikzvalof{tripoles/thyristor/height}} |
| 5116 |
{\ctikzvalof{tripoles/thyristor/width}} |
| 5117 |
{ |
| 5118 |
\pgf@circ@res@other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf@circ@res@left |
| 5119 |
\pgf@circ@res@step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf@circ@res@right |
| 5120 |
\pgfscope |
| 5121 |
% draw the thick parts here (shifted horizontally) |
| 5122 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5123 |
% draw the basic triangle |
| 5124 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 5125 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} |
| 5126 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 5127 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 5128 |
\pgfpathclose |
| 5129 |
\ifnum#2=0\relax |
| 5130 |
\pgfusepath{draw,fill} |
| 5131 |
\else |
| 5132 |
\pgf@circ@draworfill |
| 5133 |
\fi |
| 5134 |
% draw the vertical bar + IGCT symbol |
| 5135 |
\pgfsetroundjoin |
| 5136 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@down}} |
| 5137 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@down}} |
| 5138 |
% compute the endpoint of the line starting from the bottom of the bar |
| 5139 |
% and landing perpendicular to the lower part of the triangle |
| 5140 |
\pgfmathsetmacro{\@@alpha}{atan(-\pgf@circ@res@down/(\pgf@circ@res@step-\pgf@circ@res@other))} |
| 5141 |
\pgfmathsetmacro{\@@len}{-\pgf@circ@res@down*sin(\@@alpha)} |
| 5142 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\@@len*cos(\@@alpha)}{-\@@len*sin(\@@alpha)}} |
| 5143 |
\pgfusepath{draw} |
| 5144 |
\endpgfscope |
| 5145 |
% back to normal linewidth |
| 5146 |
% stroke if needed |
| 5147 |
\ifpgf@circuit@bipole@strokedsymbol |
| 5148 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 5149 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 5150 |
\pgfusepath{draw} |
| 5151 |
\fi |
| 5152 |
% draw the gate thing; |
| 5153 |
\pgfpathmoveto{\pgfpoint |
| 5154 |
{\pgf@circ@res@step} |
| 5155 |
{\ctikzvalof{tripoles/thyristor/gate height}*\ctikzvalof{tripoles/thyristor/diode height}*\pgf@circ@res@up} |
| 5156 |
} |
| 5157 |
\pgfpathlineto{\pgfpoint |
| 5158 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 5159 |
{\ctikzvalof{tripoles/thyristor/diode height}\pgf@circ@res@up} |
| 5160 |
} |
| 5161 |
\pgfpathlineto{\pgfpoint |
| 5162 |
{\ctikzvalof{tripoles/thyristor/gate kink}*\pgf@circ@res@right} |
| 5163 |
{\pgf@circ@res@up} |
| 5164 |
} |
| 5165 |
% draw bar line. |
| 5166 |
\pgfpathmoveto{\pgfpoint |
| 5167 |
{(\ctikzvalof{tripoles/thyristor/gate kink}-\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@right} |
| 5168 |
{(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up} |
| 5169 |
} |
| 5170 |
\pgfpathlineto{\pgfpoint |
| 5171 |
{(\ctikzvalof{tripoles/thyristor/gate kink}+\ctikzvalof{tripoles/thyristor/gto bar width})*\pgf@circ@res@right} |
| 5172 |
{(1+\ctikzvalof{tripoles/thyristor/diode height})*0.5*\pgf@circ@res@up} |
| 5173 |
} |
| 5174 |
\pgfusepath{draw} |
| 5175 |
% draw the leads in/out |
| 5176 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 5177 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5178 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}} |
| 5179 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5180 |
\pgfusepath{draw} |
| 5181 |
} |
| 5182 |
} |
| 5183 |
|
| 5184 |
\pgfcircdeclareIGCT{fulligct}{0}{1} |
| 5185 |
\pgfcircdeclareIGCT{emptyigct}{1}{1} |
| 5186 |
|
| 5187 |
% end of shape definitions for diodes%>>> |
| 5188 |
|
| 5189 |
%% Paths definitions for Diodes%<<< |
| 5190 |
|
| 5191 |
\def\pgfcirc@tmp@generatediodes#1#2{ |
| 5192 |
\pgfcirc@activate@bipole{l}{#1diode}{#1diode}{#1 diode} |
| 5193 |
\pgfcirc@style@to@style{#1 diode}{D#2} |
| 5194 |
\pgfcirc@activate@bipole{l}{#1zdiode}{#1zdiode}{#1 Zener diode} |
| 5195 |
\pgfcirc@style@to@style{#1 Zener diode}{zD#2} |
| 5196 |
\pgfcirc@activate@bipole{l}{#1zzdiode}{#1zzdiode}{#1 ZZener diode} |
| 5197 |
\pgfcirc@style@to@style{#1 ZZener diode}{zzD#2} |
| 5198 |
\pgfcirc@activate@bipole{l}{#1sdiode}{#1sdiode}{#1 Schottky diode} |
| 5199 |
\pgfcirc@style@to@style{#1 Schottky diode}{sD#2} |
| 5200 |
\pgfcirc@activate@bipole{l}{#1tdiode}{#1tdiode}{#1 tunnel diode} |
| 5201 |
\pgfcirc@style@to@style{#1 tunnel diode}{tD#2} |
| 5202 |
\pgfcirc@activate@bipole{l}{#1lediode}{#1lediode}{#1 led} |
| 5203 |
\pgfcirc@style@to@style{#1 led}{leD#2} |
| 5204 |
\pgfcirc@activate@bipole{l}{#1laserdiode}{#1laserdiode}{#1 laser diode} |
| 5205 |
\pgfcirc@style@to@style{#1 laser diode}{lasD#2} |
| 5206 |
\pgfcirc@activate@bipole{l}{#1pdiode}{#1pdiode}{#1 photodiode} |
| 5207 |
\pgfcirc@style@to@style{#1 photodiode}{pD#2} |
| 5208 |
\pgfcirc@activate@bipole{l}{#1varcap}{#1varcap}{#1 varcap} |
| 5209 |
\pgfcirc@style@to@style{#1 varcap}{VC#2} |
| 5210 |
\pgfcirc@activate@bipole{l}{#1tvsdiode}{#1tvsdiode}{#1 TVS diode} |
| 5211 |
\pgfcirc@style@to@style{#1 TVS diode}{tvsD#2} |
| 5212 |
\pgfcirc@activate@bipole{l}{#1shdiode}{#1shdiode}{#1 Shockley diode} |
| 5213 |
\pgfcirc@style@to@style{#1 Shockley diode}{shD#2} |
| 5214 |
\pgfcirc@activate@bipole{l}{#1bidirectionaldiode}{#1bidirectionaldiode}{#1 bidirectionaldiode} |
| 5215 |
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2} |
| 5216 |
\pgfcirc@activate@bipole{l}{#1thyristor}{#1thyristor}{#1 thyristor} |
| 5217 |
\pgfcirc@style@to@style{#1 thyristor}{Ty#2} |
| 5218 |
\pgfcirc@activate@bipole{l}{#1put}{#1put}{#1 put} |
| 5219 |
\pgfcirc@style@to@style{#1 put}{PUT#2} |
| 5220 |
\pgfcirc@activate@bipole{l}{#1gto}{#1gto}{#1 gto} |
| 5221 |
\pgfcirc@style@to@style{#1 gto}{GTO#2} |
| 5222 |
\pgfcirc@activate@bipole{l}{#1gtobar}{#1gtobar}{#1 gtobar} |
| 5223 |
\pgfcirc@style@to@style{#1 gtobar}{GTOb#2} |
| 5224 |
\pgfcirc@activate@bipole{l}{#1agtobar}{#1agtobar}{#1 agtobar} |
| 5225 |
\pgfcirc@style@to@style{#1 agtobar}{aGTOb#2} |
| 5226 |
\pgfcirc@activate@bipole{l}{#1igct}{#1igct}{#1 igct} |
| 5227 |
\pgfcirc@style@to@style{#1 igct}{IGCT#2} |
| 5228 |
\pgfcirc@activate@bipole{l}{#1triac}{#1triac}{#1 triac} |
| 5229 |
\pgfcirc@style@to@style{#1 triac}{Tr#2} |
| 5230 |
} |
| 5231 |
\pgfcirc@tmp@generatediodes{full}{*} |
| 5232 |
\pgfcirc@tmp@generatediodes{empty}{o} |
| 5233 |
\def\pgfcirc@tmp@generatestrokeddiodes#1#2{ |
| 5234 |
\pgfcirc@node@to@style{l}{emptydiode}{#1 diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5235 |
\pgfcirc@style@to@style{#1 diode}{D#2} |
| 5236 |
\pgfcirc@node@to@style{l}{emptyzdiode}{#1 Zener diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5237 |
\pgfcirc@style@to@style{#1 Zener diode}{zD#2} |
| 5238 |
\pgfcirc@node@to@style{l}{emptyzzdiode}{#1 ZZener diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5239 |
\pgfcirc@style@to@style{#1 ZZener diode}{zzD#2} |
| 5240 |
\pgfcirc@node@to@style{l}{emptysdiode}{#1 Schottky diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5241 |
\pgfcirc@style@to@style{#1 Schottky diode}{sD#2} |
| 5242 |
\pgfcirc@node@to@style{l}{emptytdiode}{#1 tunnel diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5243 |
\pgfcirc@style@to@style{#1 tunnel diode}{tD#2} |
| 5244 |
\pgfcirc@node@to@style{l}{emptylediode}{#1 led}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5245 |
\pgfcirc@style@to@style{#1 led}{leD#2} |
| 5246 |
\pgfcirc@node@to@style{l}{emptylaserdiode}{#1 laser diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5247 |
\pgfcirc@style@to@style{#1 laser diode}{lasD#2} |
| 5248 |
\pgfcirc@node@to@style{l}{emptypdiode}{#1 photodiode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5249 |
\pgfcirc@style@to@style{#1 photodiode}{pD#2} |
| 5250 |
\pgfcirc@node@to@style{l}{emptyvarcap}{#1 varcap}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5251 |
\pgfcirc@style@to@style{#1 varcap}{VC#2} |
| 5252 |
\pgfcirc@node@to@style{l}{emptytvsdiode}{#1 TVS diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5253 |
\pgfcirc@style@to@style{#1 TVS diode}{tvsD#2} |
| 5254 |
\pgfcirc@node@to@style{l}{emptyshdiode}{#1 Shockley diode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5255 |
\pgfcirc@style@to@style{#1 Shockley diode}{shD#2} |
| 5256 |
\pgfcirc@node@to@style{l}{emptybidirectionaldiode}{#1 bidirectionaldiode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5257 |
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2} |
| 5258 |
\pgfcirc@node@to@style{l}{emptythyristor}{#1 thyristor}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5259 |
\pgfcirc@style@to@style{#1 thyristor}{Ty#2} |
| 5260 |
\pgfcirc@node@to@style{l}{emptyput}{#1 put}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5261 |
\pgfcirc@style@to@style{#1 put}{PUT#2} |
| 5262 |
\pgfcirc@node@to@style{l}{emptygto}{#1 gto}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5263 |
\pgfcirc@style@to@style{#1 gto}{GTO#2} |
| 5264 |
\pgfcirc@node@to@style{l}{emptygtobar}{#1 gtobar}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5265 |
\pgfcirc@style@to@style{#1 gtobar}{GTOb#2} |
| 5266 |
\pgfcirc@node@to@style{l}{emptyagtobar}{#1 agtobar}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5267 |
\pgfcirc@style@to@style{#1 agtobar}{aGTOb#2} |
| 5268 |
\pgfcirc@style@to@style{#1 igct}{IGCT#2} |
| 5269 |
\pgfcirc@node@to@style{l}{emptyigct}{#1 igct}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5270 |
\pgfcirc@node@to@style{l}{emptytriac}{#1 triac}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5271 |
\pgfcirc@style@to@style{#1 triac}{Tr#2} |
| 5272 |
\pgfcirc@node@to@style{l}{emptytvsdiode}{#1 tvsdiode}{\circuitikzbasekey/bipole/is strokedsymbol=true} |
| 5273 |
\pgfcirc@style@to@style{#1 tvsdiode}{Tr#2} |
| 5274 |
} |
| 5275 |
\pgfcirc@tmp@generatestrokeddiodes{stroke}{-} |
| 5276 |
\def\pgfcircdiodestylemacro{\ifpgf@circuit@strokediode stroke \else\ifpgf@circuit@fulldiode full \else empty \fi\fi} |
| 5277 |
% these are auto-switching styles |
| 5278 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro diode}{diode} |
| 5279 |
\pgfcirc@style@to@style{diode}{D} |
| 5280 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro Zener diode}{Zener diode} |
| 5281 |
\pgfcirc@style@to@style{Zener diode}{zD} |
| 5282 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro ZZener diode}{ZZener diode} |
| 5283 |
\pgfcirc@style@to@style{ZZener diode}{zzD} |
| 5284 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro Schottky diode}{Schottky diode} |
| 5285 |
\pgfcirc@style@to@style{Schottky diode}{sD} |
| 5286 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro tunnel diode}{tunnel diode} |
| 5287 |
\pgfcirc@style@to@style{tunnel diode}{tD} |
| 5288 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro led}{led} |
| 5289 |
\pgfcirc@style@to@style{led}{leD} |
| 5290 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro photodiode}{photodiode} |
| 5291 |
\pgfcirc@style@to@style{photodiode}{pD} |
| 5292 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro laser diode}{laser diode} |
| 5293 |
\pgfcirc@style@to@style{laser diode}{lasD} |
| 5294 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro varcap}{varcap} |
| 5295 |
\pgfcirc@style@to@style{varcap}{VC} |
| 5296 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro TVS diode}{TVS diode} |
| 5297 |
\pgfcirc@style@to@style{TVS diode}{tvsD} |
| 5298 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro Shockley diode}{Shockley diode} |
| 5299 |
\pgfcirc@style@to@style{Shockley diode}{shD} |
| 5300 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro bidirectionaldiode}{bidirectionaldiode} |
| 5301 |
\pgfcirc@style@to@style{bidirectionaldiode}{biD} |
| 5302 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro thyristor}{thyristor} |
| 5303 |
\pgfcirc@style@to@style{thyristor}{Ty} |
| 5304 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro put}{put} |
| 5305 |
\pgfcirc@style@to@style{put}{PUT} |
| 5306 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro gto}{gto} |
| 5307 |
\pgfcirc@style@to@style{gto}{GTO} |
| 5308 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro gtobar}{gtobar} |
| 5309 |
\pgfcirc@style@to@style{gtobar}{GTOb} |
| 5310 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro agtobar}{agtobar} |
| 5311 |
\pgfcirc@style@to@style{agtobar}{aGTOb} |
| 5312 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro igct}{igct} |
| 5313 |
\pgfcirc@style@to@style{igct}{IGCT} |
| 5314 |
\pgfcirc@style@to@style{\pgfcircdiodestylemacro triac}{triac} |
| 5315 |
\pgfcirc@style@to@style{triac}{Tr} |
| 5316 |
% %>>> |
| 5317 |
|
| 5318 |
%%%%%%%%%%%%% |
| 5319 |
%% switches, buttons and jumpers |
| 5320 |
%%%%%%%%%%%%% |
| 5321 |
|
| 5322 |
%% Definitions for switches%<<<1 |
| 5323 |
|
| 5324 |
\ctikzset{bipoles/spst/height/.initial=.35} |
| 5325 |
\ctikzset{bipoles/spst/width/.initial=.35} |
| 5326 |
\ctikzset{bipoles/spst/depth/.initial=.2} |
| 5327 |
\ctikzset{bipoles/nos/height/.initial=.3} |
| 5328 |
\ctikzset{bipoles/nos/width/.initial=.35} |
| 5329 |
\ctikzset{bipoles/nos/depth/.initial=.2} |
| 5330 |
\ctikzset{bipoles/ncs/height/.initial=.35} |
| 5331 |
\ctikzset{bipoles/ncs/width/.initial=.35} |
| 5332 |
\ctikzset{bipoles/ncs/depth/.initial=.2} |
| 5333 |
\ctikzset{bipoles/pushbutton/height/.initial=.5} |
| 5334 |
\ctikzset{bipoles/pushbutton/height 2/.initial=.2} |
| 5335 |
\ctikzset{bipoles/pushbutton/width/.initial=.50} |
| 5336 |
%%% reed switch |
| 5337 |
\ctikzset{bipoles/reed/height/.initial=.4} |
| 5338 |
\ctikzset{bipoles/reed/width/.initial=.8}% 0.35 in nos |
| 5339 |
\ctikzset{bipoles/reed/depth/.initial=.4} |
| 5340 |
%% Cute switches |
| 5341 |
\ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}} |
| 5342 |
\ctikzset{bipoles/cuteswitch/height/.initial=.6} |
| 5343 |
\ctikzset{bipoles/cuteswitch/height 2/.initial=.2} |
| 5344 |
\ctikzset{bipoles/cuteswitch/width/.initial=.50} |
| 5345 |
\ctikzset{bipoles/cuteswitch/thickness/.initial=1} |
| 5346 |
|
| 5347 |
\ctikzset{tripoles/spdt/width/.initial=.85} |
| 5348 |
\ctikzset{tripoles/spdt/height/.initial=.45} |
| 5349 |
\ctikzset{tripoles/spdt/margin/.initial=.45} |
| 5350 |
|
| 5351 |
\ctikzset{tripoles/toggleswitch/height/.initial=.8} |
| 5352 |
\ctikzset{tripoles/toggleswitch/height 2/.initial=.0} |
| 5353 |
\ctikzset{tripoles/toggleswitch/width/.initial=.80} |
| 5354 |
%% arrow configurability |
| 5355 |
\ctikzset{switch arrows/.is family} |
| 5356 |
\ctikzset{switch arrows/relative thickness/.initial=1} |
| 5357 |
\ctikzset{switch arrows/color/.initial=default} |
| 5358 |
\ctikzset{switch arrows/dash/.initial=default} |
| 5359 |
\def\pgf@circ@set@switcharrow@style{% |
| 5360 |
% You *must* be sure that this is called inside a \pgfscope! |
| 5361 |
\pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} |
| 5362 |
\pgf@circ@subset@color@dash{switch arrows} |
| 5363 |
\pgfcirc@set@arrows{switch}{}{latexslim} |
| 5364 |
} |
| 5365 |
\def\pgf@circ@savedanchor@trad@midlever#1#2{% #1 -> name #2 -> relative height |
| 5366 |
\savedanchor\midlever{% this is the full height of the "handle" of switch |
| 5367 |
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} |
| 5368 |
\pgf@y=\ctikzvalof{bipoles/#1/height}\pgf@circ@scaled@Rlen |
| 5369 |
\pgf@x=0pt\pgf@y=0.5\pgf@y |
| 5370 |
} |
| 5371 |
\anchor{mid}{\midlever\pgf@y=#2\pgf@y} |
| 5372 |
} |
| 5373 |
%%>>> |
| 5374 |
|
| 5375 |
%% Shapes Node for bipoles switches and similar things%<<< |
| 5376 |
%% (Closing) SPST |
| 5377 |
\pgfcircdeclarebipolescaled{switches} |
| 5378 |
{ |
| 5379 |
\pgf@circ@savedanchor@trad@midlever{spst}{0.6} |
| 5380 |
} |
| 5381 |
{\ctikzvalof{bipoles/spst/depth}} |
| 5382 |
{cspst} |
| 5383 |
{\ctikzvalof{bipoles/spst/height}} |
| 5384 |
{\ctikzvalof{bipoles/spst/width}} |
| 5385 |
{ |
| 5386 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5387 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5388 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5389 |
\pgfusepath{draw} |
| 5390 |
\pgfscope |
| 5391 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5392 |
\pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}} |
| 5393 |
\pgfpatharc{90}{-20}{1.2\pgf@circ@res@right} |
| 5394 |
\pgf@circ@set@switcharrow@style |
| 5395 |
\pgfsetbeveljoin |
| 5396 |
\pgfusepath{draw} |
| 5397 |
\endpgfscope |
| 5398 |
} |
| 5399 |
|
| 5400 |
%% Opening SPST |
| 5401 |
\pgfcircdeclarebipolescaled{switches} |
| 5402 |
{ |
| 5403 |
\pgf@circ@savedanchor@trad@midlever{spst}{0.6} |
| 5404 |
} |
| 5405 |
{\ctikzvalof{bipoles/spst/depth}} |
| 5406 |
{ospst} |
| 5407 |
{\ctikzvalof{bipoles/spst/height}} |
| 5408 |
{\ctikzvalof{bipoles/spst/width}} |
| 5409 |
{ |
| 5410 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5411 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5412 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5413 |
\pgfusepath{draw} |
| 5414 |
\pgfscope |
| 5415 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5416 |
\pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}} |
| 5417 |
\pgfpatharc{-10}{90}{1.2\pgf@circ@res@right} |
| 5418 |
\pgf@circ@set@switcharrow@style |
| 5419 |
\pgfsetbeveljoin |
| 5420 |
\pgfusepath{draw} |
| 5421 |
\endpgfscope |
| 5422 |
} |
| 5423 |
|
| 5424 |
%% Normal open Switch |
| 5425 |
\pgfcircdeclarebipolescaled{switches} |
| 5426 |
{ |
| 5427 |
\pgf@circ@savedanchor@trad@midlever{nos}{0.5} |
| 5428 |
} |
| 5429 |
{\ctikzvalof{bipoles/nos/depth}} |
| 5430 |
{nos} |
| 5431 |
{\ctikzvalof{bipoles/nos/height}} |
| 5432 |
{\ctikzvalof{bipoles/nos/width}} |
| 5433 |
{ |
| 5434 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5435 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5436 |
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5437 |
\pgfsetbuttcap |
| 5438 |
\pgfusepath{draw} |
| 5439 |
} |
| 5440 |
|
| 5441 |
%% Normal closed Switch |
| 5442 |
\pgfcircdeclarebipolescaled{switches} |
| 5443 |
{ |
| 5444 |
\pgf@circ@savedanchor@trad@midlever{ncs}{0.5} |
| 5445 |
} |
| 5446 |
{\ctikzvalof{bipoles/ncs/depth}} |
| 5447 |
{ncs} |
| 5448 |
{\ctikzvalof{bipoles/ncs/height}} |
| 5449 |
{\ctikzvalof{bipoles/ncs/width}} |
| 5450 |
{ |
| 5451 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5452 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5453 |
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5454 |
\pgfusepath{draw} |
| 5455 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 5456 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5457 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} |
| 5458 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5459 |
\pgfusepath{draw} |
| 5460 |
} |
| 5461 |
|
| 5462 |
% Opening normal closed Switch |
| 5463 |
\pgfcircdeclarebipolescaled{switches} |
| 5464 |
{ |
| 5465 |
\pgf@circ@savedanchor@trad@midlever{ncs}{0.5} |
| 5466 |
} |
| 5467 |
{\ctikzvalof{bipoles/ncs/depth}} |
| 5468 |
{oncs} |
| 5469 |
{\ctikzvalof{bipoles/ncs/height}} |
| 5470 |
{\ctikzvalof{bipoles/ncs/width}} |
| 5471 |
{ |
| 5472 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5473 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5474 |
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5475 |
\pgfusepath{draw} |
| 5476 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 5477 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5478 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} |
| 5479 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5480 |
\pgfusepath{draw} |
| 5481 |
\pgfscope |
| 5482 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5483 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5484 |
\pgfpathmoveto{\pgfpointpolar{-10}{.9\pgf@circ@res@right}} |
| 5485 |
\pgfpatharc{-10}{95}{.9\pgf@circ@res@right} |
| 5486 |
\pgf@circ@set@switcharrow@style |
| 5487 |
\pgfsetbeveljoin |
| 5488 |
\pgfusepath{draw} |
| 5489 |
\endpgfscope |
| 5490 |
} |
| 5491 |
|
| 5492 |
%% Closing normal closed Switch |
| 5493 |
\pgfcircdeclarebipolescaled{switches} |
| 5494 |
{ |
| 5495 |
\pgf@circ@savedanchor@trad@midlever{ncs}{0.5} |
| 5496 |
} |
| 5497 |
{\ctikzvalof{bipoles/ncs/depth}} |
| 5498 |
{cncs} |
| 5499 |
{\ctikzvalof{bipoles/ncs/height}} |
| 5500 |
{\ctikzvalof{bipoles/ncs/width}} |
| 5501 |
{ |
| 5502 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5503 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5504 |
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5505 |
\pgfusepath{draw} |
| 5506 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 5507 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5508 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} |
| 5509 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5510 |
\pgfusepath{draw} |
| 5511 |
\pgfscope |
| 5512 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5513 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5514 |
\pgfpathmoveto{\pgfpointpolar{90}{.9\pgf@circ@res@right}} |
| 5515 |
\pgfpatharc{90}{-35}{.9\pgf@circ@res@right} |
| 5516 |
\pgf@circ@set@switcharrow@style |
| 5517 |
\pgfsetbeveljoin |
| 5518 |
\pgfusepath{draw} |
| 5519 |
\endpgfscope |
| 5520 |
} |
| 5521 |
|
| 5522 |
%% Opening normal open Switch |
| 5523 |
\pgfcircdeclarebipolescaled{switches} |
| 5524 |
{ |
| 5525 |
\pgf@circ@savedanchor@trad@midlever{ncs}{0.5} |
| 5526 |
} |
| 5527 |
{\ctikzvalof{bipoles/ncs/depth}} |
| 5528 |
{onos} |
| 5529 |
{\ctikzvalof{bipoles/ncs/height}} |
| 5530 |
{\ctikzvalof{bipoles/ncs/width}} |
| 5531 |
{ |
| 5532 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5533 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5534 |
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5535 |
\pgfusepath{draw} |
| 5536 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 5537 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5538 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} |
| 5539 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{.4\pgf@circ@res@up}} |
| 5540 |
\pgfusepath{draw} |
| 5541 |
\pgfscope |
| 5542 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5543 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5544 |
\pgfpathmoveto{\pgfpointpolar{-10}{.9\pgf@circ@res@right}} |
| 5545 |
\pgfpatharc{-10}{95}{.9\pgf@circ@res@right} |
| 5546 |
\pgf@circ@set@switcharrow@style |
| 5547 |
\pgfsetbeveljoin |
| 5548 |
\pgfusepath{draw} |
| 5549 |
\endpgfscope |
| 5550 |
} |
| 5551 |
|
| 5552 |
%% Closing normal open Switch |
| 5553 |
\pgfcircdeclarebipolescaled{switches} |
| 5554 |
{ |
| 5555 |
\pgf@circ@savedanchor@trad@midlever{ncs}{0.5} |
| 5556 |
} |
| 5557 |
{\ctikzvalof{bipoles/ncs/depth}} |
| 5558 |
{cnos} |
| 5559 |
{\ctikzvalof{bipoles/ncs/height}} |
| 5560 |
{\ctikzvalof{bipoles/ncs/width}} |
| 5561 |
{ |
| 5562 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5563 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5564 |
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5565 |
\pgfusepath{draw} |
| 5566 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 5567 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5568 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{0pt}} |
| 5569 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{.4\pgf@circ@res@up}} |
| 5570 |
\pgfusepath{draw} |
| 5571 |
\pgfscope |
| 5572 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5573 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5574 |
\pgfpathmoveto{\pgfpointpolar{90}{.9\pgf@circ@res@right}} |
| 5575 |
\pgfpatharc{90}{-35}{.9\pgf@circ@res@right} |
| 5576 |
\pgf@circ@set@switcharrow@style |
| 5577 |
\pgfsetbeveljoin |
| 5578 |
\pgfusepath{draw} |
| 5579 |
\endpgfscope |
| 5580 |
} |
| 5581 |
|
| 5582 |
%% Push Button |
| 5583 |
\pgfcircdeclarebipolescaled{switches} |
| 5584 |
{ |
| 5585 |
\anchor{tip}{\northeast\pgf@x=0pt\relax} |
| 5586 |
% we can use the generic here, the "bar" is related to bipoles/*/height |
| 5587 |
\pgf@circ@savedanchor@trad@midlever{pushbutton}{0.5} |
| 5588 |
} |
| 5589 |
{\ctikzvalof{bipoles/pushbutton/height 2}} |
| 5590 |
{pushbutton} |
| 5591 |
{\ctikzvalof{bipoles/pushbutton/height}} |
| 5592 |
{\ctikzvalof{bipoles/pushbutton/width}} |
| 5593 |
{ |
| 5594 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5595 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@up}} |
| 5596 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 5597 |
\pgfpathmoveto{\pgfpoint{0}{.5\pgf@circ@res@up}} |
| 5598 |
\pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}} |
| 5599 |
\pgfusepath{draw} |
| 5600 |
|
| 5601 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5602 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5603 |
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} |
| 5604 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5605 |
} |
| 5606 |
|
| 5607 |
%% Normally closed Push Button |
| 5608 |
\pgfcircdeclarebipolescaled{switches} |
| 5609 |
{ |
| 5610 |
\anchor{tip}{\northeast\pgf@x=0pt\relax} |
| 5611 |
\savedanchor{\nodeheight}{ |
| 5612 |
\pgf@x=0pt\pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen |
| 5613 |
} |
| 5614 |
\anchor{mid}{\nodeheight\pgf@y=-\pgf@y} |
| 5615 |
% \pgf@circ@savedanchor@trad@midlever{pushbutton}{0.5} |
| 5616 |
} |
| 5617 |
{\ctikzvalof{bipoles/pushbutton/height 2}} |
| 5618 |
{ncpushbutton} |
| 5619 |
{\ctikzvalof{bipoles/pushbutton/height}} |
| 5620 |
{\ctikzvalof{bipoles/pushbutton/width}} |
| 5621 |
{ |
| 5622 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5623 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 5624 |
% Warning, if the nodes will have a class, we have to touch this. |
| 5625 |
\pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen |
| 5626 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp}} |
| 5627 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}} |
| 5628 |
\pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@temp}} |
| 5629 |
\pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up}} |
| 5630 |
\pgfusepath{draw} |
| 5631 |
% |
| 5632 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5633 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5634 |
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} |
| 5635 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5636 |
} |
| 5637 |
%% Push Button (normally closed but now open :-) see |
| 5638 |
%% https://github.com/circuitikz/circuitikz/issues/128#issuecomment-731771299 |
| 5639 |
\pgfcircdeclarebipolescaled{switches} |
| 5640 |
{ |
| 5641 |
\savedanchor{\nodeheight}{ |
| 5642 |
\pgf@x=0pt\pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen |
| 5643 |
} |
| 5644 |
\anchor{tip}{ |
| 5645 |
\nodeheight\pgf@circ@res@temp=\pgf@y |
| 5646 |
\northeast\divide\pgf@y by 2\advance\pgf@y by \pgf@circ@res@temp |
| 5647 |
\pgf@x=0pt\relax |
| 5648 |
} |
| 5649 |
\anchor{mid}{\nodeheight} |
| 5650 |
} |
| 5651 |
{\ctikzvalof{bipoles/pushbutton/height 2}} |
| 5652 |
{pushbuttonc} |
| 5653 |
{\ctikzvalof{bipoles/pushbutton/height}} |
| 5654 |
{\ctikzvalof{bipoles/pushbutton/width}} |
| 5655 |
{ |
| 5656 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5657 |
\pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen |
| 5658 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}} |
| 5659 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp}} |
| 5660 |
\pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@temp}} |
| 5661 |
\pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up/2+\pgf@circ@res@temp}} |
| 5662 |
\pgfusepath{draw} |
| 5663 |
|
| 5664 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5665 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5666 |
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} |
| 5667 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5668 |
} |
| 5669 |
|
| 5670 |
%% Normally closed Push Button now open |
| 5671 |
\pgfcircdeclarebipolescaled{switches} |
| 5672 |
{ |
| 5673 |
\savedanchor{\nodeheight}{ |
| 5674 |
\pgf@x=0pt\pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen |
| 5675 |
} |
| 5676 |
\anchor{tip}{ |
| 5677 |
\nodeheight\pgf@circ@res@temp=\pgf@y |
| 5678 |
\northeast\divide\pgf@y by 2\advance\pgf@y by \pgf@circ@res@temp |
| 5679 |
\pgf@x=0pt\relax |
| 5680 |
} |
| 5681 |
\anchor{mid}{\northeast\pgf@x=0pt\pgf@y=-0.5\pgf@y} |
| 5682 |
} |
| 5683 |
{\ctikzvalof{bipoles/pushbutton/height 2}} |
| 5684 |
{ncpushbuttono} |
| 5685 |
{\ctikzvalof{bipoles/pushbutton/height}} |
| 5686 |
{\ctikzvalof{bipoles/pushbutton/width}} |
| 5687 |
{ |
| 5688 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5689 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 5690 |
% Warning, if the nodes will have a class, we have to touch this. |
| 5691 |
\pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen |
| 5692 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up/2}} |
| 5693 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@up/2}} |
| 5694 |
\pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@up/2}} |
| 5695 |
\pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up/2+\pgf@circ@res@temp}} |
| 5696 |
\pgfusepath{draw} |
| 5697 |
% |
| 5698 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5699 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5700 |
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} |
| 5701 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}} |
| 5702 |
} |
| 5703 |
%%% reed switches |
| 5704 |
\pgfcircdeclarebipolescaled{switches} |
| 5705 |
{ |
| 5706 |
\pgf@circ@savedanchor@trad@midlever{nos}{0.5} |
| 5707 |
} |
| 5708 |
{\ctikzvalof{bipoles/reed/depth}} |
| 5709 |
{reed} |
| 5710 |
{\ctikzvalof{bipoles/reed/height}} |
| 5711 |
{\ctikzvalof{bipoles/reed/width}} |
| 5712 |
{ |
| 5713 |
% this is designed to be the same as a "nos". |
| 5714 |
\pgfmathsetmacro{\@@tmpx}{0.9*\ctikzvalof{bipoles/nos/width}/\ctikzvalof{bipoles/reed/width}} |
| 5715 |
\pgfmathsetmacro{\@@tmpy}{\ctikzvalof{bipoles/nos/height}/\ctikzvalof{bipoles/reed/height}} |
| 5716 |
\pgfscope |
| 5717 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5718 |
% eclosure |
| 5719 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\pgf@circ@res@up}} |
| 5720 |
\pgfpatharc{90}{-90}{\pgf@circ@res@up} |
| 5721 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{-\pgf@circ@res@up}} |
| 5722 |
\pgfpatharc{270}{90}{\pgf@circ@res@up} |
| 5723 |
\pgfpathclose |
| 5724 |
\pgf@circ@draworfill |
| 5725 |
% switch |
| 5726 |
\pgfpathmoveto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}} |
| 5727 |
\pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{\@@tmpy\pgf@circ@res@up}} |
| 5728 |
% connection lines |
| 5729 |
\pgfsetbuttcap |
| 5730 |
\pgfusepath{draw} |
| 5731 |
\endpgfscope |
| 5732 |
% connection lines |
| 5733 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5734 |
\pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@left}{0pt}} |
| 5735 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5736 |
\pgfpathlineto{\pgfpoint{\@@tmpx\pgf@circ@res@right}{0pt}} |
| 5737 |
\pgfusepath{draw} |
| 5738 |
} |
| 5739 |
|
| 5740 |
% cute switch "to" shapes help function |
| 5741 |
% #1 -> name |
| 5742 |
% #2 -> barposition |
| 5743 |
% #3 -> arrowcode |
| 5744 |
\long\def\pgfcircdeclarecutesw#1#2#3{ |
| 5745 |
\pgfcircdeclarebipolescaled{switches} |
| 5746 |
{ |
| 5747 |
\savedanchor\midlever{ |
| 5748 |
% these values are calculated when we create the definition of the shape. |
| 5749 |
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} |
| 5750 |
\pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen |
| 5751 |
\pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen |
| 5752 |
\pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp |
| 5753 |
\pgf@circ@res@down = -.5\pgf@y |
| 5754 |
\pgf@circ@res@up = .5\pgf@y |
| 5755 |
\pgfextracty{\pgf@circ@res@other}{#2} |
| 5756 |
\pgf@x=0pt |
| 5757 |
\pgf@y=.5\pgf@circ@res@other |
| 5758 |
} |
| 5759 |
% radius of the connector |
| 5760 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 5761 |
% If cnnecting nodes are scaled, we have to modify this |
| 5762 |
\saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}} |
| 5763 |
% shapename |
| 5764 |
\savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}} |
| 5765 |
% shape type |
| 5766 |
\savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}} |
| 5767 |
% mid of the lever, to stack switches |
| 5768 |
\anchor{mid}{\midlever} |
| 5769 |
\anchor{cout}{\northeast \pgf@y=0cm} |
| 5770 |
\anchor{cin}{\southwest\pgf@y=0cm} |
| 5771 |
\anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius} |
| 5772 |
\anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius} |
| 5773 |
} |
| 5774 |
{\ctikzvalof{bipoles/cuteswitch/height 2}} |
| 5775 |
{#1} |
| 5776 |
{\ctikzvalof{bipoles/cuteswitch/height}} |
| 5777 |
{\ctikzvalof{bipoles/cuteswitch/width}}{ |
| 5778 |
\pgfscope |
| 5779 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 5780 |
% If connecting nodes are scaled, we have to modify this |
| 5781 |
\pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen |
| 5782 |
\pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp |
| 5783 |
\pgfsetlinewidth{2\pgf@circ@res@temp} |
| 5784 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5785 |
\pgfpathlineto{#2} |
| 5786 |
\pgfsetroundcap\pgfusepath{draw} |
| 5787 |
\endpgfscope |
| 5788 |
\pgfscope % arrow |
| 5789 |
\pgf@circ@fill@strokecolor |
| 5790 |
#3% |
| 5791 |
\endpgfscope |
| 5792 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5793 |
\pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}} |
| 5794 |
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} |
| 5795 |
\pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}} |
| 5796 |
} |
| 5797 |
} |
| 5798 |
|
| 5799 |
%% closed cute switch |
| 5800 |
\pgfcircdeclarecutesw{cuteclosedswitch} |
| 5801 |
{\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}} |
| 5802 |
{} |
| 5803 |
|
| 5804 |
%% open cute switch |
| 5805 |
\pgfcircdeclarecutesw{cuteopenswitch} |
| 5806 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5807 |
{} |
| 5808 |
|
| 5809 |
%% closing cute switch |
| 5810 |
\pgfcircdeclarecutesw{cuteclosingswitch} |
| 5811 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5812 |
{ |
| 5813 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5814 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node |
| 5815 |
\pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}} |
| 5816 |
\pgfpatharc{70}{-10}{1.2\pgf@circ@res@right} |
| 5817 |
\pgf@circ@set@switcharrow@style |
| 5818 |
\pgfusepath{draw} |
| 5819 |
} |
| 5820 |
|
| 5821 |
%% opening cute switch |
| 5822 |
\pgfcircdeclarecutesw{cuteopeningswitch} |
| 5823 |
{\pgfpoint{\pgf@circ@res@right}{1.5\pgf@circ@res@temp}} |
| 5824 |
{ |
| 5825 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5826 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node |
| 5827 |
\pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}} |
| 5828 |
\pgfpatharc{-10}{60}{1.2\pgf@circ@res@right} |
| 5829 |
\pgf@circ@set@switcharrow@style |
| 5830 |
\pgfusepath{draw} |
| 5831 |
} |
| 5832 |
|
| 5833 |
\pgfcircdeclarebipole{ |
| 5834 |
\anchor{out 1}{\northeast\pgf@y=0pt\relax} |
| 5835 |
\anchor{out 2}{\northeast\pgf@y=.8\pgf@y} |
| 5836 |
\anchor{in}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x} |
| 5837 |
\anchor{mid}{\northeast\pgf@x=0.2\pgf@x\pgf@y=0.25\pgf@y} |
| 5838 |
} |
| 5839 |
{\ctikzvalof{tripoles/toggleswitch/height 2}} |
| 5840 |
{toggleswitch} |
| 5841 |
{\ctikzvalof{tripoles/toggleswitch/height}} |
| 5842 |
{\ctikzvalof{tripoles/toggleswitch/width}} |
| 5843 |
{ |
| 5844 |
|
| 5845 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5846 |
\pgfpathlineto{\pgfpoint{.3\pgf@circ@res@left}{0pt}} |
| 5847 |
\pgfusepath{draw} |
| 5848 |
\pgfscope |
| 5849 |
\pgfpathmoveto{\pgfpoint{.3\pgf@circ@res@left}{0pt}} |
| 5850 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 5851 |
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{.5\pgf@circ@res@up}} |
| 5852 |
\pgfusepath{draw} |
| 5853 |
\endpgfscope |
| 5854 |
|
| 5855 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 5856 |
\pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{0}} |
| 5857 |
|
| 5858 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{.8\pgf@circ@res@up}} |
| 5859 |
\pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.8\pgf@circ@res@up}} |
| 5860 |
\pgfpathlineto{\pgfpoint{.5\pgf@circ@res@right}{.15\pgf@circ@res@up}} |
| 5861 |
\pgfusepath{draw} |
| 5862 |
|
| 5863 |
|
| 5864 |
\pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 5865 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5866 |
\pgfusepath{draw} |
| 5867 |
|
| 5868 |
\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} |
| 5869 |
\pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@up}} |
| 5870 |
\pgfpathlineto{\pgfpoint{0}{.8\pgf@circ@res@up}} |
| 5871 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@left}{.6\pgf@circ@res@up}} |
| 5872 |
\pgfpathlineto{\pgfpoint{0}{.4\pgf@circ@res@up}} |
| 5873 |
\pgfpathlineto{\pgfpoint{0}{.2\pgf@circ@res@up}} |
| 5874 |
\pgfusepath{draw} |
| 5875 |
\pgfsetdash{}{0cm} |
| 5876 |
} |
| 5877 |
|
| 5878 |
% %>>> |
| 5879 |
|
| 5880 |
%% Shape nodes for switches (non-bipoles)%<<< |
| 5881 |
|
| 5882 |
%%%%%%%%%%%%% |
| 5883 |
%% switches |
| 5884 |
%%%%%%%%%%%%% |
| 5885 |
|
| 5886 |
% Legacy spdt |
| 5887 |
\pgfdeclareshape{spdt}{ |
| 5888 |
\savedmacro{\ctikzclass}{\edef\ctikzclass{switches}} |
| 5889 |
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} |
| 5890 |
\savedanchor\northwest{% |
| 5891 |
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} |
| 5892 |
\pgf@y=\ctikzvalof{tripoles/spdt/height}\pgf@circ@scaled@Rlen |
| 5893 |
\pgf@y=.5\pgf@y |
| 5894 |
\pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen |
| 5895 |
\pgf@x=.5\pgf@x |
| 5896 |
} |
| 5897 |
\pgfcirc@northwest@symmetric@geoanchors |
| 5898 |
\anchor{in}{\northwest\pgf@y=0pt} |
| 5899 |
\anchor{out 1}{\northwest\pgf@x=-\pgf@x} |
| 5900 |
% this is "by eye", it'll be wrong with non-standard ocirc |
| 5901 |
\anchor{mid}{\northwest\pgf@x=0pt\pgf@y=0.37\pgf@y} |
| 5902 |
\anchor{out 2}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y} |
| 5903 |
\anchor{center}{\pgf@y=0pt\pgf@x=0pt} |
| 5904 |
\pgf@circ@draw@component{ |
| 5905 |
\pgf@circ@setcolor |
| 5906 |
\northwest |
| 5907 |
\pgf@circ@res@up = \pgf@y |
| 5908 |
\pgf@circ@res@down = -\pgf@y |
| 5909 |
\pgf@circ@res@right = -\pgf@x |
| 5910 |
\pgf@circ@res@left = \pgf@x |
| 5911 |
\pgf@circ@res@other = \ctikzvalof{tripoles/spdt/margin}\pgf@circ@res@left |
| 5912 |
% |
| 5913 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 5914 |
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 5915 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 5916 |
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 5917 |
% |
| 5918 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 5919 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 5920 |
\pgfusepath{draw} |
| 5921 |
\pgfscope |
| 5922 |
\pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 5923 |
\pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}} |
| 5924 |
\endpgfscope |
| 5925 |
\pgfscope |
| 5926 |
\pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 5927 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}} |
| 5928 |
\endpgfscope |
| 5929 |
\pgfscope |
| 5930 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}} |
| 5931 |
\pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}} |
| 5932 |
\endpgfscope |
| 5933 |
\pgfscope |
| 5934 |
\pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}} |
| 5935 |
\pgfpathlineto{ |
| 5936 |
\pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{-\pgf@circ@res@other}{-100pt}}} |
| 5937 |
{\pgfpoint{-.05\pgf@circ@res@up}{-.05\pgf@circ@res@up}} |
| 5938 |
} |
| 5939 |
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth} |
| 5940 |
\pgfusepath{draw} |
| 5941 |
\endpgfscope |
| 5942 |
} |
| 5943 |
} |
| 5944 |
|
| 5945 |
|
| 5946 |
% cute switch "node" shapes, matching with cute "to" shapes |
| 5947 |
% #1 -> name |
| 5948 |
% #2 -> barposition |
| 5949 |
% #3 -> arrowcode |
| 5950 |
\long\def\pgfcircdeclarecutespdt#1#2#3{ |
| 5951 |
\pgfdeclareshape{#1} |
| 5952 |
{ |
| 5953 |
\savedmacro{\ctikzclass}{\edef\ctikzclass{switches}} |
| 5954 |
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} |
| 5955 |
\savedanchor\northwest{% |
| 5956 |
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} |
| 5957 |
\pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen |
| 5958 |
\pgf@y=.5\pgf@y |
| 5959 |
\pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen |
| 5960 |
\pgf@x=.25\pgf@x |
| 5961 |
} |
| 5962 |
\savedanchor\midlever{ |
| 5963 |
% these values are calculated when we create the definition of the shape. |
| 5964 |
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} |
| 5965 |
\pgf@y=\ctikzvalof{bipoles/cuteswitch/height}\pgf@circ@scaled@Rlen |
| 5966 |
\pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen |
| 5967 |
\pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp |
| 5968 |
\pgf@circ@res@down = -.5\pgf@y |
| 5969 |
\pgf@circ@res@up = .5\pgf@y |
| 5970 |
\pgfextracty{\pgf@circ@res@other}{#2} |
| 5971 |
\pgf@x=0pt |
| 5972 |
\pgf@y=.5\pgf@circ@res@other |
| 5973 |
} |
| 5974 |
% radius of the connector |
| 5975 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 5976 |
\saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}} |
| 5977 |
% shapename |
| 5978 |
\savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}} |
| 5979 |
% shape type |
| 5980 |
\savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}} |
| 5981 |
% mid of the lever, to stack switches |
| 5982 |
\anchor{mid}{\midlever} |
| 5983 |
% center anchors |
| 5984 |
\anchor{cin}{ \northwest \pgf@y=0pt} |
| 5985 |
\anchor{cout 1}{ \northwest \pgf@x=-\pgf@x } |
| 5986 |
\anchor{cout 2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } |
| 5987 |
% horizontal angles |
| 5988 |
\anchor{in}{ \northwest \pgf@y=0pt\advance\pgf@x by -\radius} |
| 5989 |
\anchor{out 1}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius} |
| 5990 |
\anchor{out 2}{ \northwest \pgf@x=-\pgf@x \advance\pgf@x by \radius \pgf@y=-\pgf@y } |
| 5991 |
|
| 5992 |
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt } |
| 5993 |
\anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x } |
| 5994 |
\anchor{west}{ \northwest \pgf@y=0pt } |
| 5995 |
\anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y } |
| 5996 |
\anchor{north}{ \northwest \pgf@x=0pt } |
| 5997 |
\anchor{south west}{ \northwest \pgf@y=-\pgf@y } |
| 5998 |
\anchor{north east}{ \northwest \pgf@x=-\pgf@x } |
| 5999 |
\anchor{north west}{ \northwest } |
| 6000 |
\anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } |
| 6001 |
|
| 6002 |
\pgf@circ@draw@component{ |
| 6003 |
\pgf@circ@setcolor |
| 6004 |
\northwest |
| 6005 |
\pgf@circ@res@up = \pgf@y |
| 6006 |
\pgf@circ@res@down = -\pgf@y |
| 6007 |
\pgf@circ@res@right = -\pgf@x |
| 6008 |
\pgf@circ@res@left = \pgf@x |
| 6009 |
|
| 6010 |
\pgfscope |
| 6011 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 6012 |
\pgf@circ@res@temp=\radius\relax |
| 6013 |
\pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp |
| 6014 |
\pgfsetlinewidth{2\pgf@circ@res@temp} |
| 6015 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 6016 |
\pgfpathlineto{#2} |
| 6017 |
\pgfsetroundcap\pgfusepath{draw} |
| 6018 |
\endpgfscope |
| 6019 |
\pgfscope % arrow |
| 6020 |
\pgf@circ@fill@strokecolor |
| 6021 |
#3% |
| 6022 |
\endpgfscope |
| 6023 |
% terminals |
| 6024 |
\pgfscope |
| 6025 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 6026 |
\pgfnode{\cshape}{center}{}{\thisshape-out 1}{\pgfusepath{stroke}} |
| 6027 |
\endpgfscope |
| 6028 |
\pgfscope |
| 6029 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 6030 |
\pgfnode{\cshape}{center}{}{\thisshape-out 2}{\pgfusepath{stroke}} |
| 6031 |
\endpgfscope |
| 6032 |
\pgfscope |
| 6033 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 6034 |
\pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{stroke}} |
| 6035 |
\endpgfscope |
| 6036 |
|
| 6037 |
} |
| 6038 |
} |
| 6039 |
} |
| 6040 |
|
| 6041 |
\pgfcircdeclarecutespdt{cute spdt up} |
| 6042 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}} |
| 6043 |
{} |
| 6044 |
|
| 6045 |
\pgfcircdeclarecutespdt{cute spdt mid} |
| 6046 |
{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 6047 |
{} |
| 6048 |
|
| 6049 |
\pgfcircdeclarecutespdt{cute spdt down} |
| 6050 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}} |
| 6051 |
{} |
| 6052 |
|
| 6053 |
\pgfcircdeclarecutespdt{cute spdt up arrow} |
| 6054 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@[email protected]\pgf@circ@res@temp}} |
| 6055 |
{ |
| 6056 |
\pgf@circ@setlinewidth{bipoles}{\pgflinewidth} |
| 6057 |
\pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} |
| 6058 |
\pgf@circ@subset@color@dash{switch arrows} |
| 6059 |
\pgfcirc@set@arrows{switch}{}{latexslim} |
| 6060 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node |
| 6061 |
\pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}} |
| 6062 |
\pgfpatharc{70}{-50}{1.5\pgf@circ@res@right} |
| 6063 |
\pgfusepath{draw} |
| 6064 |
} |
| 6065 |
|
| 6066 |
\pgfcircdeclarecutespdt{cute spdt mid arrow} |
| 6067 |
{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 6068 |
{ |
| 6069 |
\pgf@circ@setlinewidth{bipoles}{\pgflinewidth} |
| 6070 |
\pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} |
| 6071 |
\pgf@circ@subset@color@dash{switch arrows} |
| 6072 |
\pgfcirc@set@arrows{switch}{latexslim}{latexslim} |
| 6073 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node |
| 6074 |
\pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}} |
| 6075 |
\pgfpatharc{-60}{60}{1.5\pgf@circ@res@right} |
| 6076 |
\pgfusepath{draw} |
| 6077 |
} |
| 6078 |
|
| 6079 |
\pgfcircdeclarecutespdt{cute spdt down arrow} |
| 6080 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down+1.5\pgf@circ@res@temp}} |
| 6081 |
{ |
| 6082 |
\pgf@circ@setlinewidth{bipoles}{\pgflinewidth} |
| 6083 |
\pgfsetlinewidth{\ctikzvalof{switch arrows/relative thickness}\pgflinewidth} |
| 6084 |
\pgf@circ@subset@color@dash{switch arrows} |
| 6085 |
\pgfcirc@set@arrows{switch}{}{latexslim} |
| 6086 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node |
| 6087 |
\pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}} |
| 6088 |
\pgfpatharc{-50}{70}{1.5\pgf@circ@res@right} |
| 6089 |
\pgfusepath{draw} |
| 6090 |
} |
| 6091 |
% %>>> |
| 6092 |
|
| 6093 |
%% Paths Switches and buttons%<<< |
| 6094 |
|
| 6095 |
\pgfcirc@activate@bipole{l}{cspst}{cspst}{closing switch} |
| 6096 |
\pgfcirc@style@to@style{closing switch}{switch} |
| 6097 |
\pgfcirc@style@to@style{closing switch}{cspst} |
| 6098 |
\pgfcirc@style@to@style{switch}{spst} |
| 6099 |
\pgfcirc@activate@bipole{l}{ospst}{ospst}{opening switch} |
| 6100 |
\pgfcirc@style@to@style{opening switch}{ospst} |
| 6101 |
|
| 6102 |
\pgfcirc@activate@bipole@simple{l}{nos} |
| 6103 |
\pgfcirc@style@to@style{nos}{normal open switch} |
| 6104 |
\pgfcirc@activate@bipole@simple{l}{ncs} |
| 6105 |
\pgfcirc@style@to@style{ncs}{normal closed switch} |
| 6106 |
\pgfcirc@activate@bipole@simple{l}{oncs} |
| 6107 |
\pgfcirc@style@to@style{oncs}{opening normal closed switch} |
| 6108 |
\pgfcirc@activate@bipole@simple{l}{cncs} |
| 6109 |
\pgfcirc@style@to@style{cncs}{closing normal closed switch} |
| 6110 |
\pgfcirc@activate@bipole@simple{l}{onos} |
| 6111 |
\pgfcirc@style@to@style{onos}{opening normal open switch} |
| 6112 |
\pgfcirc@activate@bipole@simple{l}{cnos} |
| 6113 |
\pgfcirc@style@to@style{cnos}{closing normal open switch} |
| 6114 |
|
| 6115 |
\pgfcirc@activate@bipole{l}{pushbutton}{pushbutton}{push button} |
| 6116 |
\pgfcirc@style@to@style{push button}{nopb} |
| 6117 |
\pgfcirc@style@to@style{push button}{normally open push button} |
| 6118 |
\pgfcirc@activate@bipole{l}{ncpushbutton}{ncpushbutton}{ncpb} |
| 6119 |
\pgfcirc@style@to@style{ncpb}{normally closed push button} |
| 6120 |
\pgfcirc@activate@bipole{l}{pushbuttonc}{pushbuttonc}{nopbc} |
| 6121 |
\pgfcirc@style@to@style{nopbc}{normally open push button closed} |
| 6122 |
\pgfcirc@activate@bipole{l}{ncpushbuttono}{ncpushbuttono}{ncpbo} |
| 6123 |
\pgfcirc@style@to@style{ncpbo}{normally closed push button open} |
| 6124 |
|
| 6125 |
\pgfcirc@activate@bipole{l}{toggleswitch}{toggleswitch}{toggle switch} |
| 6126 |
\pgfcirc@activate@bipole@simple{l}{reed} |
| 6127 |
|
| 6128 |
\pgfcirc@activate@bipole{l}{cuteclosedswitch}{cuteclosedswitch}{cute closed switch} |
| 6129 |
\pgfcirc@style@to@style{cute closed switch}{ccsw} |
| 6130 |
\pgfcirc@activate@bipole{l}{cuteopenswitch}{cuteopenswitch}{cute open switch} |
| 6131 |
\pgfcirc@style@to@style{cute open switch}{cosw} |
| 6132 |
\pgfcirc@activate@bipole{l}{cuteclosingswitch}{cuteclosingswitch}{cute closing switch} |
| 6133 |
\pgfcirc@style@to@style{cute closing switch}{ccgsw} |
| 6134 |
\pgfcirc@activate@bipole{l}{cuteopeningswitch}{cuteopeningswitch}{cute opening switch} |
| 6135 |
\pgfcirc@style@to@style{cute opening switch}{cogsw}% %>>> |
| 6136 |
|
| 6137 |
%% Proximity switch auxiliary shapes%<<< |
| 6138 |
%% proximeter shape, for usage with switches |
| 6139 |
\ctikzset{proximeter/width/.initial=0.3} |
| 6140 |
\ctikzset{proximeter/hlines thickness/.initial=0.5} |
| 6141 |
\ctikzset{proximeter/hlines position/.initial=0.3} |
| 6142 |
\pgfdeclareshape{proximeter} |
| 6143 |
{ |
| 6144 |
\savedmacro{\ctikzclass}{\edef\ctikzclass{switches}} |
| 6145 |
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} |
| 6146 |
\savedmacro{\hlinepos}{\edef\hlinepos{\ctikzvalof{proximeter/hlines position}}} |
| 6147 |
\savedanchor\northeast{% |
| 6148 |
\pgfmathsetlength{\pgf@y}{\ctikzvalof{proximeter/width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} |
| 6149 |
\pgf@x=\pgf@y |
| 6150 |
} |
| 6151 |
\savedanchor\textanchor{% |
| 6152 |
\pgfmathsetlength{\pgf@y}{\ctikzvalof{proximeter/width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen} |
| 6153 |
\pgf@x=\pgf@y |
| 6154 |
\pgf@x=\dimexpr -.5\wd\pgfnodeparttextbox\relax |
| 6155 |
\advance\pgf@y by .6\ht\pgfnodeparttextbox\relax |
| 6156 |
} |
| 6157 |
\anchor{center}{\pgfpointorigin} |
| 6158 |
% geo anchors based on north-east |
| 6159 |
\pgfcirc@northeast@symmetric@geoanchors |
| 6160 |
\anchor{text}{\textanchor} |
| 6161 |
\anchor{hlines ne}{% |
| 6162 |
\northeast |
| 6163 |
\pgf@y=\hlinepos\pgf@y |
| 6164 |
\advance\pgf@x by -\pgf@y |
| 6165 |
} |
| 6166 |
\anchor{hlines nw}{% |
| 6167 |
\northeast |
| 6168 |
\pgf@y=\hlinepos\pgf@y |
| 6169 |
\advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x |
| 6170 |
} |
| 6171 |
\anchor{hlines se}{% |
| 6172 |
\northeast |
| 6173 |
\pgf@y=\hlinepos\pgf@y |
| 6174 |
\advance\pgf@x by -\pgf@y |
| 6175 |
\pgf@y=-\pgf@y |
| 6176 |
} |
| 6177 |
\anchor{hlines sw}{% |
| 6178 |
\northeast |
| 6179 |
\pgf@y=\hlinepos\pgf@y |
| 6180 |
\advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x |
| 6181 |
\pgf@y=-\pgf@y |
| 6182 |
} |
| 6183 |
\anchorborder{ |
| 6184 |
% \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y} |
| 6185 |
\pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)} |
| 6186 |
\pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)} |
| 6187 |
\pgfmathsetlength{\pgf@xa}{abs(\pgf@x)} |
| 6188 |
\pgfmathsetlength{\pgf@ya}{abs(\pgf@y)} |
| 6189 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 6190 |
% \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up} |
| 6191 |
% \typeout{MID\space SX:\@@switchx\space SY:\@@switchy} |
| 6192 |
\pgfpointintersectionoflines |
| 6193 |
{\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}} |
| 6194 |
{\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}} |
| 6195 |
% \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y} |
| 6196 |
\pgf@x=\@@switchx\pgf@x |
| 6197 |
\pgf@y=\@@switchy\pgf@y |
| 6198 |
} |
| 6199 |
\pgf@circ@draw@component{ |
| 6200 |
\northeast\pgf@circ@res@temp=\pgf@y |
| 6201 |
\pgf@circ@setcolor |
| 6202 |
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth} |
| 6203 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp}{0pt}} |
| 6204 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@temp}} |
| 6205 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{0pt}} |
| 6206 |
\pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@temp}} |
| 6207 |
\pgfpathclose |
| 6208 |
\pgf@circ@draworfill |
| 6209 |
\pgfsetlinewidth{\ctikzvalof{proximeter/hlines thickness}*\pgflinewidth} |
| 6210 |
\pgfmathsetlength{\pgf@circ@res@up}{\hlinepos*\pgf@circ@res@temp} |
| 6211 |
\pgfmathsetlength{\pgf@circ@res@right}{\pgf@circ@res@temp-\pgf@circ@res@up} |
| 6212 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 6213 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 6214 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{-\pgf@circ@res@up}} |
| 6215 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@up}} |
| 6216 |
\pgfusepath{draw} |
| 6217 |
} |
| 6218 |
|
| 6219 |
} |
| 6220 |
\pgfcirc@node@to@path{proximeter}{inline proximeter}{} |
| 6221 |
% %>>> |
| 6222 |
|
| 6223 |
% jumpers: definitions and code %<<< |
| 6224 |
% definitons for jumpers |
| 6225 |
\ctikzset{bipoles/jumper/width/.initial=0.4} |
| 6226 |
\ctikzset{bipoles/tjumper/width/.initial=0.6}% normally is less than 0.4*2 |
| 6227 |
\ctikzset{tjumper connections/.initial=00}% bare-bare |
| 6228 |
\ctikzset{bipoles/jumper/height/.initial=0.4} |
| 6229 |
\ctikzset{bipoles/jumper/depth/.initial=0.1} |
| 6230 |
\ctikzset{bipoles/jumper/shape/.initial=ocirc} |
| 6231 |
\ctikzset{bipoles/jumper/curvature/.initial=2} % curvature of the arc |
| 6232 |
\ctikzset{bipoles/jumper/open shift/.initial=3} % displacement to open the arc |
| 6233 |
|
| 6234 |
% jumpers |
| 6235 |
% simple jumpers |
| 6236 |
% #1 -> name |
| 6237 |
% #2 -> height of the link arc (0 means no link, 1 closed, 2 open) |
| 6238 |
\long\def\pgfcircdeclarejumper#1#2{ |
| 6239 |
\pgfcircdeclarebipolescaled{switches} |
| 6240 |
{ |
| 6241 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 6242 |
\saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}} |
| 6243 |
% shapename |
| 6244 |
\savedmacro{\thisshape}{\edef\thisshape{\tikz@fig@name}} |
| 6245 |
% shape type |
| 6246 |
\savedmacro{\cshape}{\edef\cshape{\ctikzvalof{bipoles/jumper/shape}}} |
| 6247 |
% arc characteristics (can vary, must be saved...) |
| 6248 |
\savedmacro{\curvature}{\edef\curvature{\ctikzvalof{bipoles/jumper/curvature}}} |
| 6249 |
\savedmacro{\openshift}{\edef\openshift{\ctikzvalof{bipoles/jumper/open shift}}} |
| 6250 |
% |
| 6251 |
\anchor{cout}{\northeast \pgf@y=0cm} |
| 6252 |
\anchor{cin}{\southwest\pgf@y=0cm} |
| 6253 |
\anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius} |
| 6254 |
\anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius} |
| 6255 |
\savedanchor{\textoffset}{% |
| 6256 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 6257 |
\pgf@y=.6\ht\pgfnodeparttextbox % (sum) |
| 6258 |
} |
| 6259 |
\anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset}% |
| 6260 |
\northeast \pgf@x=\pgf@xa \advance\pgf@y by \pgf@ya |
| 6261 |
} |
| 6262 |
\anchor{top arc}{\northeast |
| 6263 |
\pgf@circ@res@other=\pgf@x |
| 6264 |
\pgf@circ@res@temp=\radius |
| 6265 |
\ifnum #2=1 \edef\@@b{1}\else\edef\@@b{\openshift}\fi |
| 6266 |
\pgfpointcurveattime{0.5} |
| 6267 |
{\pgfpoint{-0.9\pgf@circ@res@other}{{(\@@b)*\radius}}} |
| 6268 |
{\pgfpoint{-0.5\pgf@circ@res@other}{{(\@@b+\curvature)*\radius}}} |
| 6269 |
{\pgfpoint{0.5\pgf@circ@res@other}{{(\@@b+\curvature)*\radius}}} |
| 6270 |
{\pgfpoint{0.9\pgf@circ@res@other}{{(\@@b)*\radius}}} |
| 6271 |
} |
| 6272 |
} |
| 6273 |
{\ctikzvalof{bipoles/jumper/depth}} |
| 6274 |
{#1} |
| 6275 |
{\ctikzvalof{bipoles/jumper/height}} |
| 6276 |
{\ctikzvalof{bipoles/jumper/width}}{ |
| 6277 |
% |
| 6278 |
\ifnum #2=0 \else |
| 6279 |
\ifnum #2=1 \edef\@@b{1}\else\edef\@@b{\openshift}\fi |
| 6280 |
\pgfpathmoveto{\pgfpoint{0.9*\pgf@circ@res@left}{(\@@b)*\radius}} |
| 6281 |
\pgfpathcurveto |
| 6282 |
{\pgfpoint{.5\pgf@circ@res@left}{(\@@b+\curvature)*\radius}} |
| 6283 |
{\pgfpoint{.5\pgf@circ@res@right}{(\@@b+\curvature)*\radius}} |
| 6284 |
{\pgfpoint{0.9*\pgf@circ@res@right}{(\@@b)*\radius}} |
| 6285 |
\pgfusepath{draw} |
| 6286 |
\fi |
| 6287 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 6288 |
\pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}} |
| 6289 |
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} |
| 6290 |
\pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}} |
| 6291 |
} |
| 6292 |
} |
| 6293 |
\pgfcircdeclarejumper{bjumper}{0} |
| 6294 |
\pgfcircdeclarejumper{cjumper}{1} |
| 6295 |
\pgfcircdeclarejumper{ojumper}{2} |
| 6296 |
\pgfcirc@activate@bipole{l}{bjumper}{bjumper}{bare jumper} |
| 6297 |
\pgfcirc@activate@bipole{l}{ojumper}{ojumper}{open jumper} |
| 6298 |
\pgfcirc@activate@bipole{l}{cjumper}{cjumper}{closed jumper} |
| 6299 |
% jumpers |
| 6300 |
% three pins (two-ways) jumpers |
| 6301 |
% #1 -> name |
| 6302 |
% #2 -> height of the first link arc (0 means no link, 1 closed, 2 open) |
| 6303 |
% #3 -> height of the second link arc (0 means no link, 1 closed, 2 open) |
| 6304 |
\def\pgf@circ@tjumper@splitstatus#1#2\relax{%split the two values |
| 6305 |
\edef\@@a{#1}\edef\@@b{#2}% |
| 6306 |
} |
| 6307 |
\pgfcircdeclarebipolescaled{switches} |
| 6308 |
{ |
| 6309 |
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex) |
| 6310 |
\saveddimen{\radius}{\pgfmathsetlength\pgf@x{\pgf@circ@Rlen*\ctikzvalof{nodes width}}} |
| 6311 |
% shapename |
| 6312 |
\savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}} |
| 6313 |
% shape type |
| 6314 |
\savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/jumper/shape}}} |
| 6315 |
% arc characteristics (can vary, must be saved...) |
| 6316 |
\savedmacro{\curvature}{\edef\curvature{\ctikzvalof{bipoles/jumper/curvature}}} |
| 6317 |
\savedmacro{\openshift}{\edef\openshift{\ctikzvalof{bipoles/jumper/open shift}}} |
| 6318 |
\savedmacro{\jumpertype}{\edef\jumpertype{\ctikzvalof{tjumper connections}}} |
| 6319 |
% |
| 6320 |
\anchor{cout}{\northeast \pgf@y=0cm} |
| 6321 |
\anchor{cin}{\southwest\pgf@y=0cm} |
| 6322 |
\anchor{ctap}{\pgf@x=0cm\pgf@y=0cm} |
| 6323 |
\anchor{out}{\northeast \pgf@y=0cm\advance\pgf@x by \radius} |
| 6324 |
\anchor{in}{\southwest\pgf@y=0cm\advance\pgf@x by -\radius} |
| 6325 |
\anchor{tap}{\pgf@x=0cm\pgf@y=0cm\advance\pgf@y by -\radius} |
| 6326 |
\anchor{top arc left}{\northeast |
| 6327 |
\pgf@circ@res@other=-\pgf@x |
| 6328 |
\pgf@circ@res@temp=\pgf@x |
| 6329 |
% |
| 6330 |
% read the status of the jumper |
| 6331 |
% |
| 6332 |
\expandafter\pgf@circ@tjumper@splitstatus\jumpertype\relax% a bit of magic... |
| 6333 |
\edef\@@S{S}%the "S" letter |
| 6334 |
\ifx\@@a\@@S %span, it's in the center |
| 6335 |
\ifnum \@@b=0\pgfpointorigin\else % no arc, anchor on the center-base |
| 6336 |
\ifnum \@@b=2 \edef\@@b{\openshift} \else \edef\@bb{1}\relax \fi |
| 6337 |
\pgfpointcurveattime{0.5} |
| 6338 |
{\pgfpoint{0.9*\pgf@circ@res@other}{(\@@b)*\radius}} |
| 6339 |
{\pgfpoint{.5*\pgf@circ@res@other}{(\@@b+\curvature)*\radius}} |
| 6340 |
{\pgfpoint{.5*\pgf@circ@res@temp}{(\@@b+\curvature)*\radius}} |
| 6341 |
{\pgfpoint{0.9*\pgf@circ@res@temp}{(\@@b)*\radius}} |
| 6342 |
\fi |
| 6343 |
\else |
| 6344 |
% adjust the lengths of the gap, if needed |
| 6345 |
\ifnum \@@a=2 \edef\@@a{\openshift} \else \edef\@aa{1} \relax \fi |
| 6346 |
\ifnum \@@b=2 \edef\@@b{\openshift} \else \edef\@bb{1} \relax \fi |
| 6347 |
% left join |
| 6348 |
\ifnum \@@a=0 \pgfpoint{0.475*\pgf@circ@res@other}{0pt}\else |
| 6349 |
\pgfpointcurveattime{0.5} |
| 6350 |
{\pgfpoint{0.95*\pgf@circ@res@other}{\@@a*\radius}} |
| 6351 |
{\pgfpoint{.75*\pgf@circ@res@other}{(\@@a+\curvature)*\radius}} |
| 6352 |
{\pgfpoint{.25*\pgf@circ@res@other}{(\@@a+\curvature)*\radius}} |
| 6353 |
{\pgfpoint{0.05*\pgf@circ@res@other}{\@@a*\radius}} |
| 6354 |
\fi |
| 6355 |
\fi |
| 6356 |
} |
| 6357 |
\anchor{top arc right}{\northeast |
| 6358 |
\pgf@circ@res@other=-\pgf@x |
| 6359 |
\pgf@circ@res@temp=\pgf@x |
| 6360 |
% |
| 6361 |
% read the status of the jumper |
| 6362 |
% |
| 6363 |
\expandafter\pgf@circ@tjumper@splitstatus\jumpertype\relax% a bit of magic... |
| 6364 |
\edef\@@S{S}%the "S" letter |
| 6365 |
\ifx\@@a\@@S %span, it's in the center |
| 6366 |
\ifnum \@@b=0\pgfpointorigin\else % no arc, anchor on the center-base |
| 6367 |
\ifnum \@@b=2 \edef\@@b{\openshift} \else \edef\@bb{1}\relax \fi |
| 6368 |
\pgfpointcurveattime{0.5} |
| 6369 |
{\pgfpoint{0.9*\pgf@circ@res@other}{(\@@b)*\radius}} |
| 6370 |
{\pgfpoint{.5*\pgf@circ@res@other}{(\@@b+\curvature)*\radius}} |
| 6371 |
{\pgfpoint{.5*\pgf@circ@res@temp}{(\@@b+\curvature)*\radius}} |
| 6372 |
{\pgfpoint{0.9*\pgf@circ@res@temp}{(\@@b)*\radius}} |
| 6373 |
\fi |
| 6374 |
\else |
| 6375 |
% adjust the lengths of the gap, if needed |
| 6376 |
\ifnum \@@a=2 \edef\@@a{\openshift} \else \edef\@aa{1} \relax \fi |
| 6377 |
\ifnum \@@b=2 \edef\@@b{\openshift} \else \edef\@bb{1} \relax \fi |
| 6378 |
% right join |
| 6379 |
\ifnum \@@b=0 \pgfpoint{0.475*\pgf@circ@res@temp}{0pt}\else |
| 6380 |
\pgfpointcurveattime{0.5} |
| 6381 |
{\pgfpoint{0.95*\pgf@circ@res@temp}{\@@b*\radius}} |
| 6382 |
{\pgfpoint{.75\pgf@circ@res@temp}{(\@@b+\curvature)*\radius}} |
| 6383 |
{\pgfpoint{.25\pgf@circ@res@temp}{(\@@b+\curvature)*\radius}} |
| 6384 |
{\pgfpoint{0.05*\pgf@circ@res@temp}{\@@b*\radius}} |
| 6385 |
\fi |
| 6386 |
\fi |
| 6387 |
} |
| 6388 |
} |
| 6389 |
{\ctikzvalof{bipoles/jumper/depth}} |
| 6390 |
{tjumper} |
| 6391 |
{\ctikzvalof{bipoles/jumper/height}} |
| 6392 |
{\ctikzvalof{bipoles/tjumper/width}}{ |
| 6393 |
% |
| 6394 |
% read the status of the jumper |
| 6395 |
% |
| 6396 |
\expandafter\pgf@circ@tjumper@splitstatus\jumpertype\relax% a bit of magic... |
| 6397 |
\edef\@@S{S}%the "S" letter |
| 6398 |
\ifx\@@a\@@S %span |
| 6399 |
\ifnum \@@b=0 \else |
| 6400 |
\ifnum \@@b=2 \edef\@@b{\openshift} \else \edef\@bb{1}\relax \fi |
| 6401 |
\pgfpathmoveto{\pgfpoint{0.9*\pgf@circ@res@left}{(\@@b)*\radius}} |
| 6402 |
\pgfpathcurveto |
| 6403 |
{\pgfpoint{.5\pgf@circ@res@left}{(\@@b+\curvature)*\radius}} |
| 6404 |
{\pgfpoint{.5\pgf@circ@res@right}{(\@@b+\curvature)*\radius}} |
| 6405 |
{\pgfpoint{0.9*\pgf@circ@res@right}{(\@@b)*\radius}} |
| 6406 |
\pgfusepath{draw} |
| 6407 |
\fi |
| 6408 |
\else |
| 6409 |
% let's do the connection, if needed |
| 6410 |
% adjust the lengths of the gap, if needed |
| 6411 |
\ifnum \@@a=2 \edef\@@a{\openshift} \else \edef\@aa{1} \relax \fi |
| 6412 |
\ifnum \@@b=2 \edef\@@b{\openshift} \else \edef\@bb{1} \relax \fi |
| 6413 |
% left arc |
| 6414 |
\ifnum \@@a=0 \else |
| 6415 |
\pgfpathmoveto{\pgfpoint{0.95*\pgf@circ@res@left}{\@@a*\radius}} |
| 6416 |
\pgfpathcurveto |
| 6417 |
{\pgfpoint{.75\pgf@circ@res@left}{(\@@a+\curvature)*\radius}} |
| 6418 |
{\pgfpoint{.25\pgf@circ@res@left}{(\@@a+\curvature)*\radius}} |
| 6419 |
{\pgfpoint{0.05*\pgf@circ@res@left}{\@@a*\radius}} |
| 6420 |
\pgfusepath{draw} |
| 6421 |
\fi |
| 6422 |
% right arc |
| 6423 |
\ifnum \@@b=0 \else |
| 6424 |
\pgfpathmoveto{\pgfpoint{0.95*\pgf@circ@res@right}{\@@b*\radius}} |
| 6425 |
\pgfpathcurveto |
| 6426 |
{\pgfpoint{.75\pgf@circ@res@right}{(\@@b+\curvature)*\radius}} |
| 6427 |
{\pgfpoint{.25\pgf@circ@res@right}{(\@@b+\curvature)*\radius}} |
| 6428 |
{\pgfpoint{0.05*\pgf@circ@res@right}{\@@b*\radius}} |
| 6429 |
\pgfusepath{draw} |
| 6430 |
\fi |
| 6431 |
\fi |
| 6432 |
% draw the poles (always filled!) |
| 6433 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 6434 |
\pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}} |
| 6435 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 6436 |
\pgfnode{\cshape}{center}{}{\thisshape-tap}{\pgfusepath{draw}} |
| 6437 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 6438 |
\pgfnode{\cshape}{center}{}{\thisshape-out}{\pgfusepath{draw}} |
| 6439 |
} |
| 6440 |
|
| 6441 |
\pgfcirc@activate@bipole{l}{tjumper}{tjumper}{three-pins jumper} |
| 6442 |
|
| 6443 |
% %>>> |
| 6444 |
|
| 6445 |
% solder jumpers: definitions and code %<<< |
| 6446 |
\ctikzset{bipoles/solder jumper/width/.initial=0.36} |
| 6447 |
\ctikzset{bipoles/solder jumper/height/.initial=0.3} % must be less than width, otherwise no gap! |
| 6448 |
\ctikzset{bipoles/solder jumper/close height/.initial=0.6}% fraction of the vertical gap filled |
| 6449 |
\ctikzset{bipoles/double solder jumper/width/.initial=0.57} |
| 6450 |
% |
| 6451 |
\def\pgfcirc@base@solder@jumper{% |
| 6452 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{\pgf@circ@res@up}} |
| 6453 |
\pgfpatharc{90}{270}{\pgf@circ@res@up} |
| 6454 |
\pgfpathclose |
| 6455 |
\pgfusepath{draw,fill} |
| 6456 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\pgf@circ@res@up}} |
| 6457 |
\pgfpatharc{90}{-90}{\pgf@circ@res@up} |
| 6458 |
\pgfpathclose |
| 6459 |
\pgfusepath{draw,fill} |
| 6460 |
} |
| 6461 |
% simple solder jumpers |
| 6462 |
% #1 -> name |
| 6463 |
% #2 -> open or close (0 means open, 1 closed) |
| 6464 |
\long\def\pgfcircdeclaresolderjumper#1#2{ |
| 6465 |
\pgfcircdeclarebipolescaled{switches} |
| 6466 |
{ |
| 6467 |
\anchor{out}{\northeast \pgf@y=0cm} |
| 6468 |
\anchor{in}{\southwest\pgf@y=0cm} |
| 6469 |
\savedanchor{\textoffset}{% |
| 6470 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 6471 |
\pgf@y=.6\ht\pgfnodeparttextbox % (sum) |
| 6472 |
} |
| 6473 |
\anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset}% |
| 6474 |
\northeast \pgf@x=\pgf@xa \advance\pgf@y by \pgf@ya |
| 6475 |
} |
| 6476 |
} |
| 6477 |
{\ctikzvalof{bipoles/solder jumper/height}} |
| 6478 |
{#1} |
| 6479 |
{\ctikzvalof{bipoles/solder jumper/height}} |
| 6480 |
{\ctikzvalof{bipoles/solder jumper/width}}{ |
| 6481 |
% |
| 6482 |
\pgfcirc@base@solder@jumper |
| 6483 |
\ifnum #2=0 \else |
| 6484 |
\pgfpathrectanglecorners |
| 6485 |
{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up} |
| 6486 |
{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} |
| 6487 |
{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up} |
| 6488 |
{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} |
| 6489 |
\pgfusepath{fill, draw} |
| 6490 |
\fi |
| 6491 |
} |
| 6492 |
} |
| 6493 |
\pgfcircdeclaresolderjumper{osjumper}{0} |
| 6494 |
\pgfcircdeclaresolderjumper{csjumper}{1} |
| 6495 |
\pgfcirc@activate@bipole{l}{osjumper}{osjumper}{open solder jumper} |
| 6496 |
\pgfcirc@activate@bipole{l}{csjumper}{csjumper}{closed solder jumper} |
| 6497 |
% three pins (two-ways) solder jumpers |
| 6498 |
% #1 -> name |
| 6499 |
% #2 -> first side open or closed |
| 6500 |
% #3 -> second side open or closed |
| 6501 |
\long\def\pgfcircdeclaredoublesolderjumper#1#2#3{ |
| 6502 |
\pgfcircdeclarebipolescaled{switches} |
| 6503 |
{ |
| 6504 |
% |
| 6505 |
\anchor{out}{\northeast \pgf@y=0cm} |
| 6506 |
\anchor{in}{\southwest\pgf@y=0cm} |
| 6507 |
\anchor{tap}{\northeast\pgf@x=0cm} |
| 6508 |
\anchor{tap up}{\northeast\pgf@x=0cm} |
| 6509 |
\anchor{tap down}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y} |
| 6510 |
\savedanchor{\textoffset}{% |
| 6511 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 6512 |
\pgf@y=.6\ht\pgfnodeparttextbox % (sum) |
| 6513 |
} |
| 6514 |
\anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset}% |
| 6515 |
\northeast \pgf@x=\pgf@xa \advance\pgf@y by \pgf@ya |
| 6516 |
} |
| 6517 |
} |
| 6518 |
{\ctikzvalof{bipoles/solder jumper/height}} |
| 6519 |
{#1} |
| 6520 |
{\ctikzvalof{bipoles/solder jumper/height}} |
| 6521 |
{\ctikzvalof{bipoles/double solder jumper/width}} |
| 6522 |
{ |
| 6523 |
\pgfcirc@base@solder@jumper |
| 6524 |
\pgfpathrectanglecorners |
| 6525 |
{\pgfpoint{-.5\pgf@circ@res@up}{\pgf@circ@res@up}} |
| 6526 |
{\pgfpoint{.5\pgf@circ@res@up}{\pgf@circ@res@down}} |
| 6527 |
\pgfusepath{fill, draw} |
| 6528 |
\ifnum #2=0 \else |
| 6529 |
\pgfpathrectanglecorners |
| 6530 |
{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} |
| 6531 |
{\pgfpoint{-.5\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} |
| 6532 |
\pgfusepath{fill, draw} |
| 6533 |
\fi |
| 6534 |
\ifnum #3=0 \else |
| 6535 |
\pgfpathrectanglecorners |
| 6536 |
{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@up}} |
| 6537 |
{\pgfpoint{.5\pgf@circ@res@up}{\ctikzvalof{bipoles/solder jumper/close height}\pgf@circ@res@down}} |
| 6538 |
\pgfusepath{fill, draw} |
| 6539 |
\fi |
| 6540 |
} |
| 6541 |
} |
| 6542 |
% |
| 6543 |
\pgfcircdeclaredoublesolderjumper{odsjumper}{0}{0} |
| 6544 |
\pgfcircdeclaredoublesolderjumper{ldsjumper}{1}{0} |
| 6545 |
\pgfcircdeclaredoublesolderjumper{rdsjumper}{0}{1} |
| 6546 |
\pgfcircdeclaredoublesolderjumper{cdsjumper}{1}{1} |
| 6547 |
\pgfcirc@activate@bipole{l}{odsjumper}{odsjumper}{open double solder jumper} |
| 6548 |
\pgfcirc@activate@bipole{l}{ldsjumper}{ldsjumper}{left double solder jumper} |
| 6549 |
\pgfcirc@activate@bipole{l}{rdsjumper}{rdsjumper}{right double solder jumper} |
| 6550 |
\pgfcirc@activate@bipole{l}{cdsjumper}{cdsjumper}{closed double solder jumper} |
| 6551 |
|
| 6552 |
% %>>> |
| 6553 |
|
| 6554 |
%%%%%%%%%%%%%%%%% |
| 6555 |
%% Instruments |
| 6556 |
%%%%%%%%%%%%%%%%% |
| 6557 |
|
| 6558 |
%% Definitions for Instruments %<<<1 |
| 6559 |
\ctikzset{bipoles/ammeter/height/.initial=.60} |
| 6560 |
\ctikzset{bipoles/ammeter/width/.initial=.60} |
| 6561 |
\ctikzset{bipoles/ohmmeter/height/.initial=.60} |
| 6562 |
\ctikzset{bipoles/ohmmeter/width/.initial=.60} |
| 6563 |
\ctikzset{bipoles/voltmeter/height/.initial=.60} |
| 6564 |
\ctikzset{bipoles/voltmeter/width/.initial=.60} |
| 6565 |
\ctikzset{bipoles/smeter/height/.initial=.60} |
| 6566 |
\ctikzset{bipoles/smeter/width/.initial=.60} |
| 6567 |
\ctikzset{bipoles/smeter/index position/.initial=80} |
| 6568 |
\ctikzset{bipoles/smeter/voltage/additional shift/.initial=1} |
| 6569 |
\ctikzset{bipoles/qmeter/depth/.initial=.40} |
| 6570 |
\ctikzset{bipoles/qmeter/height/.initial=.80} |
| 6571 |
\ctikzset{bipoles/qmeter/width/.initial=.60} |
| 6572 |
\ctikzset{bipoles/qmeter/index position/.initial=80} |
| 6573 |
% this must be specified for each one |
| 6574 |
\ctikzset{bipoles/qvprobe/voltage/additional shift/.initial=.5} |
| 6575 |
\ctikzset{bipoles/qiprobe/voltage/additional shift/.initial=.5} |
| 6576 |
\ctikzset{bipoles/qpprobe/voltage/additional shift/.initial=.5} |
| 6577 |
\ctikzset{bipoles/iloop/width/.initial=.40} |
| 6578 |
\ctikzset{bipoles/iloop/height/.initial=.60} |
| 6579 |
% currtap see https://github.com/circuitikz/circuitikz/issues/807 |
| 6580 |
\ctikzset{bipoles/currtap/height/.initial=0.4} |
| 6581 |
\ctikzset{bipoles/currtap/dot size/.initial=0.5} |
| 6582 |
\ctikzset{bipoles/currtap/fill/.initial=default} |
| 6583 |
\ctikzset{bipoles/currtap/dash/.initial=none} |
| 6584 |
\ctikzset{bipoles/currtap/color/.initial=default} |
| 6585 |
\ctikzset{bipoles/currtap/thickness/.initial=default} |
| 6586 |
|
| 6587 |
\ctikzset{bipoles/oscope/height/.initial=.60} |
| 6588 |
\ctikzset{bipoles/oscope/width/.initial=.60} |
| 6589 |
\ctikzset{bipoles/oscope/voltage/additional shift/.initial=1} |
| 6590 |
|
| 6591 |
|
| 6592 |
% option to not rotate the new (Romano's) instruments |
| 6593 |
\newif\ifpgf@circuit@straightinstruments\pgf@circuit@straightinstrumentstrue |
| 6594 |
\pgfkeys{/tikz/straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}} |
| 6595 |
\ctikzset{straight instruments/.add code={}{\pgf@circuit@straightinstrumentstrue}} |
| 6596 |
\pgfkeys{/tikz/rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}} |
| 6597 |
\ctikzset{rotated instruments/.add code={}{\pgf@circuit@straightinstrumentsfalse}} |
| 6598 |
%%>>> |
| 6599 |
|
| 6600 |
%% Node shapes for instruments%<<< |
| 6601 |
|
| 6602 |
% % METERINGSHAPE |
| 6603 |
\long\def\drawmeteringcircle{ |
| 6604 |
\def\pgf@circ@temp{right} |
| 6605 |
\ifx\tikz@res@label@pos\pgf@circ@temp |
| 6606 |
\pgf@circ@res@step=-1.2\pgf@circ@res@up |
| 6607 |
\else |
| 6608 |
\def\pgf@circ@temp{below} |
| 6609 |
\ifx\tikz@res@label@pos\pgf@circ@temp |
| 6610 |
\pgf@circ@res@step=-1.2\pgf@circ@res@up |
| 6611 |
\else |
| 6612 |
\pgf@circ@res@step=1.2\pgf@circ@res@up |
| 6613 |
\fi |
| 6614 |
\fi |
| 6615 |
%draw connections to circle |
| 6616 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 6617 |
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 6618 |
\pgfpathmoveto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 6619 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 6620 |
\pgfusepath{draw} |
| 6621 |
%draw circle |
| 6622 |
\pgfscope |
| 6623 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 6624 |
\pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} |
| 6625 |
\pgf@circ@draworfill |
| 6626 |
\endpgfscope |
| 6627 |
%draw arrow |
| 6628 |
\pgfscope |
| 6629 |
\pgfsetarrowsend{latex} |
| 6630 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 6631 |
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 6632 |
\pgfusepath{draw} |
| 6633 |
\endpgfscope |
| 6634 |
} |
| 6635 |
|
| 6636 |
%AMPEREMETER |
| 6637 |
\pgfcircdeclarebipolescaled{instruments} |
| 6638 |
{} |
| 6639 |
{\ctikzvalof{bipoles/ammeter/height}} |
| 6640 |
{ammeter} |
| 6641 |
{\ctikzvalof{bipoles/ammeter/height}} |
| 6642 |
{\ctikzvalof{bipoles/ammeter/width}} |
| 6643 |
{ |
| 6644 |
\drawmeteringcircle |
| 6645 |
\pgfnode{circle}{center}{\pgf@circ@font@bold{A}}{}{} |
| 6646 |
} |
| 6647 |
%OHMMETER |
| 6648 |
\pgfcircdeclarebipolescaled{instruments} |
| 6649 |
{} |
| 6650 |
{\ctikzvalof{bipoles/ohmmeter/height}} |
| 6651 |
{ohmmeter} |
| 6652 |
{\ctikzvalof{bipoles/ohmmeter/height}} |
| 6653 |
{\ctikzvalof{bipoles/ohmmeter/width}} |
| 6654 |
{ |
| 6655 |
\drawmeteringcircle |
| 6656 |
\pgfnode{circle}{center}{\boldmath$\Omega$}{}{} |
| 6657 |
} |
| 6658 |
%VOLTMETER |
| 6659 |
\pgfcircdeclarebipolescaled{instruments} |
| 6660 |
{} |
| 6661 |
{\ctikzvalof{bipoles/voltmeter/height}} |
| 6662 |
{voltmeter} |
| 6663 |
{\ctikzvalof{bipoles/voltmeter/height}} |
| 6664 |
{\ctikzvalof{bipoles/voltmeter/width}} |
| 6665 |
{ |
| 6666 |
\drawmeteringcircle |
| 6667 |
\pgfnode{circle}{center}{\pgf@circ@font@bold{V}}{}{} |
| 6668 |
|
| 6669 |
} |
| 6670 |
|
| 6671 |
% oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176 |
| 6672 |
% |
| 6673 |
% oscilloscope waveforms |
| 6674 |
|
| 6675 |
\ctikzset{% |
| 6676 |
bipoles/oscope/waveform/sin/.code={% |
| 6677 |
\pgfpathmoveto{\pgfpoint{-0.6cm}{0cm}} |
| 6678 |
\pgfpathsine{\pgfpoint{0.3cm}{0.4cm}} |
| 6679 |
\pgfpathcosine{\pgfpoint{0.3cm}{-0.4cm}} |
| 6680 |
\pgfpathsine{\pgfpoint{0.3cm}{-0.4cm}} |
| 6681 |
\pgfpathcosine{\pgfpoint{0.3cm}{0.4cm}} |
| 6682 |
\pgfusepath{draw} |
| 6683 |
}, |
| 6684 |
bipoles/oscope/waveform/ramps/.code={% |
| 6685 |
\pgfpathmoveto{\pgfpoint{-0.75cm}{-0.25cm}} |
| 6686 |
\pgfpathlineto{\pgfpoint{-0.05cm}{0.25cm}} |
| 6687 |
\pgfpathlineto{\pgfpoint{-0.05cm}{-0.25cm}} |
| 6688 |
\pgfpathlineto{\pgfpoint{0.65cm}{0.25cm}} |
| 6689 |
\pgfpathlineto{\pgfpoint{0.65cm}{-0.25cm}} |
| 6690 |
\pgfusepath{draw} |
| 6691 |
}, |
| 6692 |
bipoles/oscope/waveform/square/.code={% |
| 6693 |
\pgfpathmoveto{\pgfpoint{-0.75cm}{-0.25cm}} |
| 6694 |
\pgfpathlineto{\pgfpoint{-0.6cm}{-0.25cm}} |
| 6695 |
\pgfpathlineto{\pgfpoint{-0.6cm}{0.25cm}} |
| 6696 |
\pgfpathlineto{\pgfpoint{0cm}{0.25cm}} |
| 6697 |
\pgfpathlineto{\pgfpoint{0cm}{-0.25cm}} |
| 6698 |
\pgfpathlineto{\pgfpoint{0.6cm}{-0.25cm}} |
| 6699 |
\pgfpathlineto{\pgfpoint{0.6cm}{0.25cm}} |
| 6700 |
\pgfpathlineto{\pgfpoint{0.75cm}{0.25cm}} |
| 6701 |
\pgfusepath{draw} |
| 6702 |
}, |
| 6703 |
bipoles/oscope/waveform/triangle/.code={% |
| 6704 |
\pgfpathmoveto{\pgfpoint{-0.75cm}{0cm}} |
| 6705 |
\pgfpathlineto{\pgfpoint{-0.6cm}{-0.25cm}} |
| 6706 |
\pgfpathlineto{\pgfpoint{-0.3cm}{0.25cm}} |
| 6707 |
\pgfpathlineto{\pgfpoint{0cm}{-0.25cm}} |
| 6708 |
\pgfpathlineto{\pgfpoint{0.3cm}{0.25cm}} |
| 6709 |
\pgfpathlineto{\pgfpoint{0.6cm}{-0.25cm}} |
| 6710 |
\pgfpathlineto{\pgfpoint{0.75cm}{0cm}} |
| 6711 |
\pgfusepath{draw} |
| 6712 |
}, |
| 6713 |
bipoles/oscope/waveform/zero/.code={ |
| 6714 |
\pgfpathmoveto{\pgfpoint{-0.75cm}{0cm}} |
| 6715 |
\pgfpathlineto{\pgfpoint{0.75cm}{0cm}} |
| 6716 |
\pgfusepath{draw} |
| 6717 |
},% |
| 6718 |
bipoles/oscope/waveform/lissajous/.code={% |
| 6719 |
\pgfpathellipse{\pgfpoint{0cm}{0cm}} |
| 6720 |
{\pgfpoint{0.5cm}{0.35cm}}{\pgfpoint{-0.3cm}{0.2cm}} |
| 6721 |
\pgfusepath{draw} |
| 6722 |
}, |
| 6723 |
bipoles/oscope/waveform/none/.code={},% |
| 6724 |
} |
| 6725 |
% default waveform (backward compatible) |
| 6726 |
\ctikzset{bipoles/oscope/waveform/.initial=ramps} |
| 6727 |
|
| 6728 |
\def\pgf@circ@instruments@text@anchors{% |
| 6729 |
% put the node text above and centered |
| 6730 |
\savedanchor{\textoffset}{% |
| 6731 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 6732 |
\pgf@y=\dimexpr .5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox\relax % (sum) |
| 6733 |
} |
| 6734 |
\anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset} |
| 6735 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 6736 |
\pgfpoint{\pgf@xa}{\pgf@circ@res@up+\pgf@ya} |
| 6737 |
} |
| 6738 |
} |
| 6739 |
|
| 6740 |
\pgfcircdeclarebipolescaled{instruments} |
| 6741 |
{ |
| 6742 |
\anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x} |
| 6743 |
\anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x} |
| 6744 |
\pgf@circ@instruments@text@anchors |
| 6745 |
} |
| 6746 |
{\ctikzvalof{bipoles/oscope/height}} |
| 6747 |
{oscope} |
| 6748 |
{\ctikzvalof{bipoles/oscope/height}} |
| 6749 |
{\ctikzvalof{bipoles/oscope/width}} |
| 6750 |
{ |
| 6751 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 6752 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 6753 |
\pgfextractx{\pgf@circ@res@right}{\northeast} |
| 6754 |
\pgfextractx{\pgf@circ@res@left}{\southwest} |
| 6755 |
\pgfextracty{\pgf@circ@res@down}{\southwest} |
| 6756 |
\pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up} |
| 6757 |
\pgfscope |
| 6758 |
\pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}} |
| 6759 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 6760 |
\pgf@circ@draworfill |
| 6761 |
\endpgfscope |
| 6762 |
% get the rotation |
| 6763 |
\ifpgf@circuit@straightinstruments |
| 6764 |
\pgfgettransformentries\a\b\temp\temp\temp\temp |
| 6765 |
\pgfmathsetmacro{\rot}{-atan2(\b,\a)} |
| 6766 |
\else |
| 6767 |
\edef\rot{0} |
| 6768 |
\fi |
| 6769 |
% and unrotate the scope |
| 6770 |
\pgfscope |
| 6771 |
\pgftransformrotate{\rot} |
| 6772 |
% grid |
| 6773 |
\pgfscope |
| 6774 |
\pgfsetlinewidth{0.5\pgfstartlinewidth} |
| 6775 |
\pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.25\pgf@circ@res@down}} |
| 6776 |
% the "almost one" make the grid complete most of the time --- beware of antialiasing |
| 6777 |
\pgfpathgrid[stepx=0.995\pgf@circ@res@step, stepy=0.995\pgf@circ@res@step]% |
| 6778 |
{\pgfpoint{0.75\pgf@circ@res@left}{0.5\pgf@circ@res@down}} |
| 6779 |
{\pgfpoint{0.75\pgf@circ@res@right}{0.5\pgf@circ@res@up}} |
| 6780 |
\pgfsetstrokeopacity{0.5} |
| 6781 |
\pgfusepath{draw} |
| 6782 |
\endpgfscope |
| 6783 |
% function displayed |
| 6784 |
\pgfscope |
| 6785 |
\pgfmathsetmacro{\@@scalex}{\pgf@circ@res@right/1cm} |
| 6786 |
\pgfmathsetmacro{\@@scaley}{\pgf@circ@res@up/1cm} |
| 6787 |
\pgftransformxscale{\@@scalex} |
| 6788 |
\pgftransformyscale{\@@scaley} |
| 6789 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 6790 |
\pgfkeys{\circuitikzbasekey/bipoles/oscope/waveform/\ctikzvalof{bipoles/oscope/waveform}} |
| 6791 |
\endpgfscope |
| 6792 |
\endpgfscope |
| 6793 |
} |
| 6794 |
% generic round meter with always horizontal text, no arrow |
| 6795 |
\pgfcircdeclarebipolescaled{instruments} |
| 6796 |
{} |
| 6797 |
{\ctikzvalof{bipoles/esource/height}} |
| 6798 |
{rmeter} |
| 6799 |
{\ctikzvalof{bipoles/esource/height}} |
| 6800 |
{\ctikzvalof{bipoles/esource/width}} |
| 6801 |
{ |
| 6802 |
\pgfscope |
| 6803 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 6804 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 6805 |
\pgf@circ@draworfill |
| 6806 |
\endpgfscope |
| 6807 |
% draw the text label |
| 6808 |
% get the rotation |
| 6809 |
\ifpgf@circuit@straightinstruments |
| 6810 |
\pgfgettransformentries\a\b\temp\temp\temp\temp |
| 6811 |
\pgfmathsetmacro{\rot}{-atan2(\b,\a)} |
| 6812 |
\else |
| 6813 |
\edef\rot{0} |
| 6814 |
\fi |
| 6815 |
% and unrotate the scope |
| 6816 |
\pgfscope |
| 6817 |
\pgf@circ@text@strokecolor |
| 6818 |
\pgftransformrotate{\rot} |
| 6819 |
\pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}} |
| 6820 |
\endpgfscope |
| 6821 |
} |
| 6822 |
|
| 6823 |
% generic round meter with always horizontal text, with arrow |
| 6824 |
\pgfcircdeclarebipolescaled{instruments} |
| 6825 |
{} |
| 6826 |
{\ctikzvalof{bipoles/esource/height}} |
| 6827 |
{rmeterwa} |
| 6828 |
{\ctikzvalof{bipoles/esource/height}} |
| 6829 |
{\ctikzvalof{bipoles/esource/width}} |
| 6830 |
{ |
| 6831 |
\pgfscope |
| 6832 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 6833 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 6834 |
\pgf@circ@draworfill |
| 6835 |
\endpgfscope |
| 6836 |
% draw the text label |
| 6837 |
% get the rotation |
| 6838 |
\ifpgf@circuit@straightinstruments |
| 6839 |
\pgfgettransformentries\a\b\temp\temp\temp\temp |
| 6840 |
\pgfmathsetmacro{\rot}{-atan2(\b,\a)} |
| 6841 |
\else |
| 6842 |
\edef\rot{0} |
| 6843 |
\fi |
| 6844 |
% and unrotate the scope |
| 6845 |
\pgfscope |
| 6846 |
\pgftransformrotate{\rot} |
| 6847 |
\pgf@circ@setcolor |
| 6848 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 6849 |
% arrow: create a center hole to have better visual |
| 6850 |
\pgfscope |
| 6851 |
% clipping path: first a rectangle bigger then the shape |
| 6852 |
% to avoid problems with the line thickness |
| 6853 |
\pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}} |
| 6854 |
{\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}} |
| 6855 |
% next open a circle into it |
| 6856 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf@circ@res@up}}{\pgfpoint{.6\pgf@circ@res@left}{0}} |
| 6857 |
% do the difference and clip before drawing |
| 6858 |
\pgfseteorule |
| 6859 |
\pgfusepath{clip} |
| 6860 |
\pgfsetarrowsend{latexslim} |
| 6861 |
% the arrow is better if it has a bit of breath and it's not 45º |
| 6862 |
\pgfpathmoveto{\pgfpoint{.8\pgf@circ@res@left}{1.2\pgf@circ@res@down}} |
| 6863 |
\pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}} |
| 6864 |
\pgfusepath{draw} |
| 6865 |
\endpgfscope |
| 6866 |
\pgf@circ@text@strokecolor |
| 6867 |
\pgftext[center]{\ctikzvalof{bipoles/twoport/text}} |
| 6868 |
\endpgfscope |
| 6869 |
} |
| 6870 |
|
| 6871 |
% generic square meter with always horizontal text |
| 6872 |
\pgfcircdeclarebipolescaled{instruments} |
| 6873 |
{ |
| 6874 |
\anchor{in 1}{\southwest\pgf@y=0.75\pgf@y\pgf@x=0.4\pgf@x} |
| 6875 |
\anchor{in 2}{\southwest\pgf@y=0.75\pgf@y\pgf@x=-0.4\pgf@x} |
| 6876 |
\pgf@circ@instruments@text@anchors |
| 6877 |
} |
| 6878 |
{\ctikzvalof{bipoles/smeter/height}} |
| 6879 |
{smeter} |
| 6880 |
{\ctikzvalof{bipoles/smeter/height}} |
| 6881 |
{\ctikzvalof{bipoles/smeter/width}} |
| 6882 |
{ |
| 6883 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 6884 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 6885 |
\pgfextractx{\pgf@circ@res@right}{\northeast} |
| 6886 |
\pgfextractx{\pgf@circ@res@left}{\southwest} |
| 6887 |
\pgfextracty{\pgf@circ@res@down}{\southwest} |
| 6888 |
\pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up} |
| 6889 |
\pgfscope |
| 6890 |
\pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}} |
| 6891 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 6892 |
\pgf@circ@draworfill |
| 6893 |
\endpgfscope |
| 6894 |
% get the rotation |
| 6895 |
\ifpgf@circuit@straightinstruments |
| 6896 |
\pgfgettransformentries\a\b\temp\temp\temp\temp |
| 6897 |
\pgfmathsetmacro{\rot}{-atan2(\b,\a)} |
| 6898 |
\else |
| 6899 |
\edef\rot{0} |
| 6900 |
\fi |
| 6901 |
% and unrotate the scope |
| 6902 |
\pgfscope |
| 6903 |
\pgftransformrotate{\rot} |
| 6904 |
% the metering window |
| 6905 |
\pgfscope |
| 6906 |
\def\@starta{105}\def\@stopa{75} |
| 6907 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 6908 |
\pgftransformshift{\pgfpoint{0pt}{-1.8\pgf@circ@res@up}} |
| 6909 |
\pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf@circ@res@up}} |
| 6910 |
\pgfpatharc{\@starta}{\@stopa}{2\pgf@circ@res@up} |
| 6911 |
\pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}} |
| 6912 |
\pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up} |
| 6913 |
\pgfpathclose |
| 6914 |
\pgfmathsetmacro{\@indexa}{\@starta - \ctikzvalof{bipoles/smeter/index position}*(\@starta - \@stopa)/100} |
| 6915 |
\pgfpathmoveto{\pgfpointpolar{\@indexa}{2\pgf@circ@res@up}} |
| 6916 |
\pgfpathlineto{\pgfpointpolar{\@indexa}{2.4\pgf@circ@res@up}} |
| 6917 |
\pgfusepath{draw} |
| 6918 |
\endpgfscope |
| 6919 |
\pgf@circ@text@strokecolor |
| 6920 |
\pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}} |
| 6921 |
\endpgfscope |
| 6922 |
} |
| 6923 |
|
| 6924 |
% probes qucs style: |
| 6925 |
% #1 : name |
| 6926 |
% #2 : extra code |
| 6927 |
\long\def\pgfcirc@qucsprobe#1#2{ |
| 6928 |
\pgfcircdeclarebipolescaled{instruments} |
| 6929 |
{ |
| 6930 |
\anchor{v+}{\southwest\pgf@x=0.6\pgf@x} |
| 6931 |
\anchor{v-}{\southwest\pgf@x=-0.6\pgf@x} |
| 6932 |
% put the node text above and centered |
| 6933 |
\pgf@circ@instruments@text@anchors |
| 6934 |
} |
| 6935 |
{\ctikzvalof{bipoles/qmeter/depth}} |
| 6936 |
{#1} |
| 6937 |
{\ctikzvalof{bipoles/qmeter/height}} |
| 6938 |
{\ctikzvalof{bipoles/qmeter/width}} |
| 6939 |
{ |
| 6940 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 6941 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 6942 |
\pgfextractx{\pgf@circ@res@right}{\northeast} |
| 6943 |
\pgfextractx{\pgf@circ@res@left}{\southwest} |
| 6944 |
\pgfextracty{\pgf@circ@res@down}{\southwest} |
| 6945 |
\pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up} |
| 6946 |
\pgfscope |
| 6947 |
\pgfscope |
| 6948 |
\pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}} |
| 6949 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 6950 |
\pgf@circ@draworfill |
| 6951 |
\endpgfscope |
| 6952 |
\def\@starta{103}\def\@stopa{77} |
| 6953 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 6954 |
\pgfscope |
| 6955 |
\pgftransformshift{\pgfpoint{0pt}{-1.7\pgf@circ@res@up}} |
| 6956 |
\pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf@circ@res@up}} |
| 6957 |
\pgfpatharc{\@starta}{\@stopa}{2.1\pgf@circ@res@up} |
| 6958 |
\pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf@circ@res@up}} |
| 6959 |
\pgfpatharc{\@stopa}{\@starta}{2.5\pgf@circ@res@up} |
| 6960 |
\pgfpathclose |
| 6961 |
\pgfmathsetmacro{\@indexa}{\@starta - \ctikzvalof{bipoles/qmeter/index position}*(\@starta - \@stopa)/100} |
| 6962 |
\pgfpathmoveto{\pgfpointpolar{\@indexa}{2.1\pgf@circ@res@up}} |
| 6963 |
\pgfpathlineto{\pgfpointpolar{\@indexa}{2.4\pgf@circ@res@up}} |
| 6964 |
\pgfusepath{draw} |
| 6965 |
\pgf@circ@draworfill |
| 6966 |
\endpgfscope |
| 6967 |
#2% |
| 6968 |
\endpgfscope |
| 6969 |
} |
| 6970 |
} |
| 6971 |
|
| 6972 |
\pgfcirc@qucsprobe{qiprobe}{ |
| 6973 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 6974 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 6975 |
\pgfusepath{draw} |
| 6976 |
\pgfnode{currarrow}{center}{}{}{} |
| 6977 |
} |
| 6978 |
|
| 6979 |
\pgfcirc@qucsprobe{qvprobe}{ |
| 6980 |
\pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen} |
| 6981 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 6982 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{0pt}} |
| 6983 |
\pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other} |
| 6984 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{0pt}} |
| 6985 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 6986 |
\pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}{\pgf@circ@res@other} |
| 6987 |
\pgfusepath{draw} |
| 6988 |
\pgfscope |
| 6989 |
% "+" and "-", drawn so that they scale correctly |
| 6990 |
\pgfsetlinewidth{2\pgfstartlinewidth} |
| 6991 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-1.5\pgf@circ@res@other}} |
| 6992 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+\pgf@circ@res@other}{-3.5\pgf@circ@res@other}} |
| 6993 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}} |
| 6994 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}} |
| 6995 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right+0\pgf@circ@res@other}{-2.5\pgf@circ@res@other}} |
| 6996 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-2.5\pgf@circ@res@other}} |
| 6997 |
\pgfusepath{draw} |
| 6998 |
\endpgfscope |
| 6999 |
} |
| 7000 |
|
| 7001 |
\pgfcirc@qucsprobe{qpprobe}{ |
| 7002 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7003 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 7004 |
\pgfusepath{draw} |
| 7005 |
\pgfnode{currarrow}{center}{}{}{} |
| 7006 |
\pgfmathsetlength{\pgf@circ@res@other}{\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen} |
| 7007 |
\pgfpathcircle{\pgfpoint{.6\pgf@circ@res@left}{-3\pgf@circ@res@other}}{\pgf@circ@res@other} |
| 7008 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left}{-4\pgf@circ@res@other}} |
| 7009 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 7010 |
\pgfpathcircle{\pgfpoint{.6\pgf@circ@res@right}{-3\pgf@circ@res@other}}{\pgf@circ@res@other} |
| 7011 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right}{-4\pgf@circ@res@other}} |
| 7012 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7013 |
\pgfusepath{draw} |
| 7014 |
\pgfscope |
| 7015 |
% "+" and "-", drawn so that they scale correctly |
| 7016 |
\pgfsetlinewidth{2\pgfstartlinewidth} |
| 7017 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-2\pgf@circ@res@other}} |
| 7018 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+3\pgf@circ@res@other}{-4\pgf@circ@res@other}} |
| 7019 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@left+2\pgf@circ@res@other}{-3\pgf@circ@res@other}} |
| 7020 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@left+4\pgf@circ@res@other}{-3\pgf@circ@res@other}} |
| 7021 |
\pgfpathmoveto{\pgfpoint{.6\pgf@circ@res@right-4\pgf@circ@res@other}{-3\pgf@circ@res@other}} |
| 7022 |
\pgfpathlineto{\pgfpoint{.6\pgf@circ@res@right-2\pgf@circ@res@other}{-3\pgf@circ@res@other}} |
| 7023 |
\pgfusepath{draw} |
| 7024 |
\endpgfscope |
| 7025 |
} |
| 7026 |
|
| 7027 |
% current loop for oscope and similar: stylized |
| 7028 |
\pgfcircdeclarebipolescaled{instruments} |
| 7029 |
{ |
| 7030 |
\anchor{i}{\northeast\pgf@x=0pt\relax} |
| 7031 |
\savedanchor{\textoffset}{% |
| 7032 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 7033 |
\pgf@y=\dimexpr .5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox\relax % (sum) |
| 7034 |
} |
| 7035 |
\anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset} |
| 7036 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 7037 |
\pgfextractx{\pgf@circ@res@left}{\northeast} |
| 7038 |
\pgfpoint{\pgf@xa+\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@ya} |
| 7039 |
} |
| 7040 |
} |
| 7041 |
{\ctikzvalof{bipoles/iloop/height}} |
| 7042 |
{iloop} |
| 7043 |
{\ctikzvalof{bipoles/iloop/height}} |
| 7044 |
{\ctikzvalof{bipoles/iloop/width}} |
| 7045 |
{ |
| 7046 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 7047 |
\pgfextractx{\pgf@circ@res@right}{\northeast} |
| 7048 |
\pgf@circ@res@down=-\pgf@circ@res@up |
| 7049 |
\pgf@circ@res@left=-\pgf@circ@res@right |
| 7050 |
\pgfscope |
| 7051 |
\pgfstartlinewidth=\pgflinewidth |
| 7052 |
\pgf@circ@setcolor |
| 7053 |
% external ellipse |
| 7054 |
\pgfscope |
| 7055 |
\pgf@circ@setlinewidth{bipoles}{\pgflinewidth} |
| 7056 |
% clipping path: first a rectangle bigger then the shape |
| 7057 |
% to avoid problems with the line thickness |
| 7058 |
\pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}} |
| 7059 |
{\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}} |
| 7060 |
% next the opening to the left |
| 7061 |
\pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}} |
| 7062 |
{\pgfpoint{0pt}{.1\pgf@circ@res@up}} |
| 7063 |
% do the difference and clip before drawing |
| 7064 |
\pgfseteorule |
| 7065 |
\pgfusepath{clip} |
| 7066 |
\pgfpathellipse{\pgfpointorigin}{ |
| 7067 |
\pgfpoint{0pt}{0.8\pgf@circ@res@up}}{ |
| 7068 |
\pgfpoint{0.4\pgf@circ@res@right}{0pt}} |
| 7069 |
\pgfusepath{draw} |
| 7070 |
\endpgfscope |
| 7071 |
% internal wire |
| 7072 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 7073 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7074 |
\pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}} |
| 7075 |
\pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}} |
| 7076 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 7077 |
% and the contact line up |
| 7078 |
\pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}} |
| 7079 |
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} |
| 7080 |
\pgfusepath{draw} |
| 7081 |
\endpgfscope |
| 7082 |
} |
| 7083 |
|
| 7084 |
% current loop for oscope and similar: real (double connection) |
| 7085 |
\pgfcircdeclarebipolescaled{instruments} |
| 7086 |
{ |
| 7087 |
\anchor{i+}{ |
| 7088 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 7089 |
\pgfextractx{\pgf@circ@res@right}{\northeast} |
| 7090 |
\pgf@circ@res@step=0.4\pgf@circ@res@right |
| 7091 |
\pgf@circ@res@other=0.8\pgf@circ@res@up |
| 7092 |
\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other} |
| 7093 |
\pgf@y=\pgf@circ@res@up |
| 7094 |
} |
| 7095 |
\anchor{i-}{ |
| 7096 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 7097 |
\pgfextractx{\pgf@circ@res@right}{\northeast} |
| 7098 |
\pgf@circ@res@step=0.4\pgf@circ@res@right |
| 7099 |
\pgf@circ@res@other=0.8\pgf@circ@res@up |
| 7100 |
\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other} |
| 7101 |
\pgf@y=\pgf@circ@res@up |
| 7102 |
} |
| 7103 |
\savedanchor{\textoffset}{% |
| 7104 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 7105 |
\pgf@y=\dimexpr .5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox\relax % (sum) |
| 7106 |
} |
| 7107 |
\anchor{text}{\pgfextractx{\pgf@xa}{\textoffset}\pgfextracty{\pgf@ya}{\textoffset} |
| 7108 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 7109 |
\pgfextractx{\pgf@circ@res@left}{\northeast} |
| 7110 |
\pgfpoint{\pgf@xa+\pgf@circ@res@left}{\pgf@circ@res@up+\pgf@ya} |
| 7111 |
} |
| 7112 |
} |
| 7113 |
{\ctikzvalof{bipoles/iloop/height}} |
| 7114 |
{iloop2} |
| 7115 |
{\ctikzvalof{bipoles/iloop/height}} |
| 7116 |
{\ctikzvalof{bipoles/iloop/width}} |
| 7117 |
{ |
| 7118 |
\pgfextracty{\pgf@circ@res@up}{\northeast} |
| 7119 |
\pgfextractx{\pgf@circ@res@right}{\northeast} |
| 7120 |
\pgf@circ@res@down=-\pgf@circ@res@up |
| 7121 |
\pgf@circ@res@left=-\pgf@circ@res@right |
| 7122 |
% must be the same than internal i+ and i- anchors definition |
| 7123 |
\pgf@circ@res@step=0.4\pgf@circ@res@right |
| 7124 |
\pgf@circ@res@other=0.8\pgf@circ@res@up |
| 7125 |
\def\@plus{\pgfpointpolar{105}{\pgf@circ@res@step and \pgf@circ@res@other}} |
| 7126 |
\def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}} |
| 7127 |
\pgfscope |
| 7128 |
\pgfstartlinewidth=\pgflinewidth |
| 7129 |
\pgf@circ@setcolor |
| 7130 |
% external ellipse |
| 7131 |
\pgfscope |
| 7132 |
\pgf@circ@setlinewidth{bipoles}{\pgflinewidth} |
| 7133 |
% clipping path: first a rectangle bigger then the shape |
| 7134 |
% to avoid problems with the line thickness |
| 7135 |
\pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{2\pgf@circ@res@down}} |
| 7136 |
{\pgfpoint{2\pgf@circ@res@right}{2\pgf@circ@res@up}} |
| 7137 |
% next the opening to the left |
| 7138 |
\pgfpathrectanglecorners{\pgfpoint{2\pgf@circ@res@left}{.1\pgf@circ@res@down}} |
| 7139 |
{\pgfpoint{0pt}{.1\pgf@circ@res@up}} |
| 7140 |
% do the difference and clip before drawing |
| 7141 |
\pgfseteorule |
| 7142 |
\pgfusepath{clip} |
| 7143 |
\pgfpathmoveto{\@plus} |
| 7144 |
\pgfpatharc{105}{435}{\pgf@circ@res@step and \pgf@circ@res@other} |
| 7145 |
\pgfusepath{draw} |
| 7146 |
\endpgfscope |
| 7147 |
% internal wire |
| 7148 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 7149 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7150 |
\pgfpathlineto{\pgfpoint{0.3\pgf@circ@res@right}{0pt}} |
| 7151 |
\pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@right}{0pt}} |
| 7152 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 7153 |
% and the contact line up |
| 7154 |
% I use ...left and ---right as temporal lengths here to avoid defining more |
| 7155 |
\pgfextractx{\pgf@circ@res@left}{\@plus} |
| 7156 |
\pgfextractx{\pgf@circ@res@right}{\@minus} |
| 7157 |
\pgfpathmoveto{\@plus} |
| 7158 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 7159 |
\pgfpathmoveto{\@minus} |
| 7160 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 7161 |
\pgfusepath{draw} |
| 7162 |
\endpgfscope |
| 7163 |
} |
| 7164 |
%% currtap |
| 7165 |
\pgfcircdeclarebipolescaled{instruments} |
| 7166 |
{ |
| 7167 |
\savedmacro{\@@dotsize}{\def\@@dotsize{\ctikzvalof{bipoles/currtap/dot size}}} |
| 7168 |
\anchor{tap}{\northeast\pgf@x=0pt\pgf@y=\@@dotsize\pgf@y\pgf@y=-\pgf@y} |
| 7169 |
} |
| 7170 |
{\ctikzvalof{bipoles/currtap/height}} |
| 7171 |
{currtap} |
| 7172 |
{\ctikzvalof{bipoles/currtap/height}} |
| 7173 |
{\ctikzvalof{bipoles/currtap/height}} |
| 7174 |
{ |
| 7175 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7176 |
\pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@left}{0pt}} |
| 7177 |
\pgfpatharc{180}{0}{0.95\pgf@circ@res@right} |
| 7178 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 7179 |
\pgfusepath{draw} |
| 7180 |
\pgf@circ@subset@color@dash{bipoles/currtap} |
| 7181 |
\pgf@circ@subset@thickness{bipoles/currtap} |
| 7182 |
\pgfusepath{draw} |
| 7183 |
\pgfpathcircle{\pgfpoint{0pt}{0pt}}{\@@dotsize*\pgf@circ@res@up} |
| 7184 |
\pgf@circ@subset@fill@or@draw{bipoles/currtap} |
| 7185 |
} |
| 7186 |
% %>>> |
| 7187 |
|
| 7188 |
% Path definitions for Instruments%<<< |
| 7189 |
|
| 7190 |
\pgfcirc@activate@bipole@simple{l}{ammeter} |
| 7191 |
\pgfcirc@activate@bipole@simple{l}{ohmmeter} |
| 7192 |
\pgfcirc@activate@bipole@simple{l}{voltmeter} |
| 7193 |
\pgfcirc@activate@bipole@simple{l}{oscope} |
| 7194 |
\pgfcirc@activate@bipole@simple{l}{rmeter} |
| 7195 |
\pgfcirc@activate@bipole@simple{l}{rmeterwa} |
| 7196 |
\pgfcirc@activate@bipole@simple{l}{smeter} |
| 7197 |
\pgfcirc@activate@bipole@simple{l}{iloop} |
| 7198 |
\pgfcirc@activate@bipole{l}{ilooptwo}{iloop2}{iloop2} |
| 7199 |
\pgfcirc@activate@bipole@simple{l}{currtap} |
| 7200 |
\pgfcirc@activate@bipole@simple{l}{qvprobe} |
| 7201 |
\pgfcirc@activate@bipole@simple{l}{qiprobe} |
| 7202 |
\pgfcirc@activate@bipole@simple{l}{qpprobe} |
| 7203 |
% %>>> |
| 7204 |
|
| 7205 |
%%%%%%%%%%%%%%%%%%%%%%% |
| 7206 |
%% MECHANICAL SYMBOLS |
| 7207 |
%%%%%%%%%%%%%%%%%%%%%%% |
| 7208 |
|
| 7209 |
%% Settings for Mechanical section%<<<1 |
| 7210 |
\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8} |
| 7211 |
\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6} |
| 7212 |
\ctikzset{bipoles/spring/height/.initial=.5} |
| 7213 |
\ctikzset{bipoles/spring/width/.initial=.5} |
| 7214 |
\ctikzset{bipoles/inerter/height/.initial=.7} |
| 7215 |
\ctikzset{bipoles/inerter/width/.initial=.175} |
| 7216 |
\ctikzset{bipoles/mass/height/.initial=.55} |
| 7217 |
\ctikzset{bipoles/mass/box height/.initial=.4} |
| 7218 |
\ctikzset{bipoles/mass/width/.initial=.5} |
| 7219 |
|
| 7220 |
\ctikzset{bipoles/damper/height/.initial=.35} |
| 7221 |
\ctikzset{bipoles/damper/length/.initial=.3} |
| 7222 |
\ctikzset{bipoles/damper/width/.initial=.4} |
| 7223 |
%%>>> |
| 7224 |
|
| 7225 |
%% Node shapes Mechanical analog system%<<< |
| 7226 |
%% mechanical capacitance - stiffness/spring |
| 7227 |
|
| 7228 |
\pgfcircdeclarebipolescaled{mechanicals} |
| 7229 |
{} |
| 7230 |
{\ctikzvalof{bipoles/spring/height}} |
| 7231 |
{spring} |
| 7232 |
{\ctikzvalof{bipoles/spring/height}} |
| 7233 |
{\ctikzvalof{bipoles/spring/width}}{ |
| 7234 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7235 |
\pgftransformationadjustments |
| 7236 |
|
| 7237 |
\pgfmathsetlength{\pgf@circ@res@step} |
| 7238 |
{(\ctikzvalof{bipoles/spring/width}*\pgf@circ@scaled@Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16} |
| 7239 |
|
| 7240 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} |
| 7241 |
\pgfsetcornersarced{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}} |
| 7242 |
\pgf@circ@res@other = \pgf@circ@res@left |
| 7243 |
\advance\pgf@circ@res@other by \pgf@circ@res@step |
| 7244 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 7245 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 7246 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 7247 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 7248 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 7249 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 7250 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 7251 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 7252 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 7253 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 7254 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 7255 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 7256 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} |
| 7257 |
\advance\pgf@circ@res@other by 2\pgf@circ@res@step |
| 7258 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}} |
| 7259 |
\advance\pgf@circ@res@other by \pgf@circ@res@step |
| 7260 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} |
| 7261 |
\pgfsetbuttcap |
| 7262 |
\pgfsetbeveljoin |
| 7263 |
\pgfusepath{stroke} |
| 7264 |
} |
| 7265 |
|
| 7266 |
%% mechanical capacitance - inerter |
| 7267 |
\pgfcircdeclarebipolescaled{mechanicals} |
| 7268 |
{} |
| 7269 |
{\ctikzvalof{bipoles/inerter/height}} |
| 7270 |
{inerter} |
| 7271 |
{\ctikzvalof{bipoles/inerter/height}} |
| 7272 |
{\ctikzvalof{bipoles/inerter/width}} |
| 7273 |
{ |
| 7274 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7275 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7276 |
\pgf@circ@draworfill |
| 7277 |
} |
| 7278 |
|
| 7279 |
|
| 7280 |
%% mechanical inductance - mass |
| 7281 |
\pgfcircdeclarebipolescaled{mechanicals} |
| 7282 |
{} |
| 7283 |
{\ctikzvalof{bipoles/mass/box height}} |
| 7284 |
{mass} |
| 7285 |
{\ctikzvalof{bipoles/mass/height}} |
| 7286 |
{\ctikzvalof{bipoles/mass/width}} |
| 7287 |
{ |
| 7288 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7289 |
\pgftransformationadjustments |
| 7290 |
\pgfpathrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 7291 |
{\pgfpoint{-2\pgf@circ@res@down}{-2\pgf@circ@res@down}} |
| 7292 |
\pgf@circ@draworfill |
| 7293 |
|
| 7294 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7295 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 7296 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 7297 |
\pgfsetrectcap |
| 7298 |
\pgfsetmiterjoin |
| 7299 |
\pgfusepath{stroke} |
| 7300 |
} |
| 7301 |
|
| 7302 |
%% mechanical resistor - damper |
| 7303 |
\pgfcircdeclarebipolescaled{mechanicals} |
| 7304 |
{} |
| 7305 |
{\ctikzvalof{bipoles/damper/height}} |
| 7306 |
{damper} |
| 7307 |
{\ctikzvalof{bipoles/damper/height}} |
| 7308 |
{\ctikzvalof{bipoles/damper/width}} |
| 7309 |
{ |
| 7310 |
\pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 7311 |
\pgf@circ@maybefill |
| 7312 |
|
| 7313 |
% line into the damper |
| 7314 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7315 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right} |
| 7316 |
{\pgf@circ@res@zero}} |
| 7317 |
\pgfusepath{stroke} |
| 7318 |
|
| 7319 |
% damper box |
| 7320 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7321 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 7322 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7323 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 7324 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 7325 |
|
| 7326 |
\pgfsetrectcap |
| 7327 |
\pgfsetmiterjoin |
| 7328 |
\pgfusepath{stroke} |
| 7329 |
|
| 7330 |
% damper vertical element |
| 7331 |
\pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right} |
| 7332 |
{.8\pgf@circ@res@down}} |
| 7333 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right} |
| 7334 |
{.8\pgf@circ@res@up}} |
| 7335 |
\pgfsetbuttcap |
| 7336 |
\pgfusepath{stroke} |
| 7337 |
|
| 7338 |
} |
| 7339 |
%% mechanical viscoelastic element, suggested by @alex |
| 7340 |
%% in https://tex.stackexchange.com/questions/484268/combined-spring-damper-in-circuitikz |
| 7341 |
\pgfcircdeclarebipolescaled{mechanicals} |
| 7342 |
{} % extra anchors |
| 7343 |
{\ctikzvalof{bipoles/damper/height}} % depth (under the path line) |
| 7344 |
{viscoe} % name |
| 7345 |
{\ctikzvalof{bipoles/damper/height}} % height (above the path line) |
| 7346 |
{\ctikzvalof{bipoles/damper/width}} % width |
| 7347 |
{ % draw the bipole |
| 7348 |
\pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 7349 |
\pgf@circ@maybefill |
| 7350 |
|
| 7351 |
% spring into the damper |
| 7352 |
\pgfscope |
| 7353 |
\pgfscope |
| 7354 |
\pgftransformationadjustments |
| 7355 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7356 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} |
| 7357 |
\pgfpathlineto{\pgfpoint{.95\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7358 |
\pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}} |
| 7359 |
\pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}} |
| 7360 |
\pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}} |
| 7361 |
\pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}} |
| 7362 |
\pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}} |
| 7363 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}} |
| 7364 |
\pgfsetbuttcap |
| 7365 |
\pgfsetbeveljoin |
| 7366 |
\pgfusepath{stroke} |
| 7367 |
\endpgfscope |
| 7368 |
\endpgfscope |
| 7369 |
% damper box |
| 7370 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7371 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} |
| 7372 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7373 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 7374 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 7375 |
|
| 7376 |
\pgfsetrectcap |
| 7377 |
\pgfsetmiterjoin |
| 7378 |
\pgfusepath{stroke} |
| 7379 |
|
| 7380 |
% damper vertical element |
| 7381 |
\pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right} |
| 7382 |
{.8\pgf@circ@res@down}} |
| 7383 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right} |
| 7384 |
{.8\pgf@circ@res@up}} |
| 7385 |
\pgfsetbuttcap |
| 7386 |
\pgfusepath{stroke} |
| 7387 |
|
| 7388 |
} |
| 7389 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7390 |
%% electromechanical device (motor/generator) |
| 7391 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7392 |
|
| 7393 |
\pgfdeclareshape{elmech} |
| 7394 |
{ |
| 7395 |
\savedmacro{\ctikzclass}{\edef\ctikzclass{electromechanicals}} |
| 7396 |
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} |
| 7397 |
\savedanchor\northwest{ |
| 7398 |
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} |
| 7399 |
\pgf@y=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen |
| 7400 |
\pgf@y=.5\pgf@y |
| 7401 |
\pgf@x=-\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen |
| 7402 |
\pgf@x=.5\pgf@x |
| 7403 |
} |
| 7404 |
\anchor{center}{ |
| 7405 |
\pgfpointorigin |
| 7406 |
} |
| 7407 |
\savedanchor{\textanchor}{% |
| 7408 |
\pgf@x=-.5\wd\pgfnodeparttextbox % (set) |
| 7409 |
\pgf@y=-.5\ht\pgfnodeparttextbox % (set) |
| 7410 |
} |
| 7411 |
\anchor{text}{\textanchor} |
| 7412 |
\anchor{left}{% |
| 7413 |
\northwest |
| 7414 |
\pgf@y=0pt |
| 7415 |
} |
| 7416 |
\anchor{right}{% |
| 7417 |
\northwest |
| 7418 |
\pgf@y=0pt |
| 7419 |
\pgf@x=-\pgf@x |
| 7420 |
} |
| 7421 |
\anchor{top}{ |
| 7422 |
\northwest |
| 7423 |
\pgf@x=0pt |
| 7424 |
} |
| 7425 |
\anchor{pathstart}{ |
| 7426 |
\northwest |
| 7427 |
\pgf@x=0pt |
| 7428 |
} |
| 7429 |
\anchor{pathend}{ |
| 7430 |
\northwest |
| 7431 |
\pgf@x=0pt |
| 7432 |
\pgf@y=-\pgf@y |
| 7433 |
} |
| 7434 |
\anchor{bottom}{ |
| 7435 |
\northwest |
| 7436 |
\pgf@x=0pt |
| 7437 |
\pgf@y=-\pgf@y |
| 7438 |
} |
| 7439 |
\anchor{center}{ |
| 7440 |
\pgf@y=0pt |
| 7441 |
\pgf@x=0pt |
| 7442 |
} |
| 7443 |
\anchor{east}{ |
| 7444 |
\northwest |
| 7445 |
\pgf@y=0pt |
| 7446 |
\pgf@x=-\pgf@x |
| 7447 |
} |
| 7448 |
\anchor{west}{ |
| 7449 |
\northwest |
| 7450 |
\pgf@y=0pt |
| 7451 |
} |
| 7452 |
\anchor{south}{ |
| 7453 |
\northwest |
| 7454 |
\pgf@x=0pt |
| 7455 |
\pgf@y=-\pgf@y |
| 7456 |
} |
| 7457 |
\anchor{north}{ |
| 7458 |
\northwest |
| 7459 |
\pgf@x=0pt |
| 7460 |
} |
| 7461 |
\anchor{south west}{ \northwest \pgf@y=-\pgf@y } |
| 7462 |
\anchor{north east}{ \northwest \pgf@x=-\pgf@x } |
| 7463 |
\anchor{north west}{ \northwest } |
| 7464 |
\anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } |
| 7465 |
\anchorborder{% |
| 7466 |
\@tempdima=\pgf@x\@tempdimb=\pgf@y |
| 7467 |
\northwest\pgf@circ@res@other=-\pgf@x |
| 7468 |
\pgfpointborderellipse{\pgfqpoint{\@tempdima}{\@tempdimb}}{\pgfqpoint{\pgf@circ@res@other}{\pgf@circ@res@other}} |
| 7469 |
} |
| 7470 |
\anchor{block north west}{\northwest\pgf@x=0.5\pgf@x} |
| 7471 |
\anchor{block south west}{\northwest\pgf@x=0.5\pgf@x\pgf@y=-\pgf@y} |
| 7472 |
\anchor{block north east}{\northwest\pgf@x=-0.5\pgf@x} |
| 7473 |
\anchor{block south east}{\northwest\pgf@x=-0.5\pgf@x\pgf@y=-\pgf@y} |
| 7474 |
\anchor{block up right}{ |
| 7475 |
\northwest |
| 7476 |
% remember that pgf@x is negative |
| 7477 |
% center of the block is at 0.5*H+W*cos(30)/2 |
| 7478 |
\pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax |
| 7479 |
\pgf@x=-0.5\pgf@x |
| 7480 |
} |
| 7481 |
\anchor{block up left}{ |
| 7482 |
\northwest |
| 7483 |
% remember that pgf@x is negative |
| 7484 |
% center of the block is at 0.5*H+W*cos(30)/2 |
| 7485 |
\pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax |
| 7486 |
\pgf@x=0.5\pgf@x |
| 7487 |
} |
| 7488 |
\anchor{block down right}{ |
| 7489 |
\northwest |
| 7490 |
% remember that pgf@x is negative |
| 7491 |
% center of the block is at 0.5*H+W*cos(30)/2 |
| 7492 |
\pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax |
| 7493 |
\pgf@y=-\pgf@y |
| 7494 |
\pgf@x=-0.5\pgf@x |
| 7495 |
} |
| 7496 |
\anchor{block down left}{ |
| 7497 |
\northwest |
| 7498 |
% remember that pgf@x is negative |
| 7499 |
% center of the block is at 0.5*H+W*cos(30)/2 |
| 7500 |
\pgf@y=\dimexpr0.5\pgf@y - 0.433\pgf@x\relax |
| 7501 |
\pgf@y=-\pgf@y |
| 7502 |
\pgf@x=0.5\pgf@x |
| 7503 |
} |
| 7504 |
\pgf@circ@draw@component{ |
| 7505 |
\pgf@circ@setcolor |
| 7506 |
\pgf@circ@scaled@Rlen=\scaledRlen |
| 7507 |
\pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen |
| 7508 |
\pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen |
| 7509 |
\pgfscope |
| 7510 |
\pgfstartlinewidth=\pgflinewidth |
| 7511 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7512 |
\pgfscope % clip the bar: whole size minus the circle |
| 7513 |
\pgfpathrectanglecorners{\pgfpoint{-.5\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{.5\pgf@circ@res@up}} |
| 7514 |
\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} |
| 7515 |
\pgfseteorule |
| 7516 |
\pgfusepath{clip} |
| 7517 |
\pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}} |
| 7518 |
\pgf@circ@fill@strokecolor |
| 7519 |
\pgfusepath{fill, draw} |
| 7520 |
\endpgfscope |
| 7521 |
\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} |
| 7522 |
\ifx\tikz@fillcolor\pgfutil@empty |
| 7523 |
% set the default fill color to white |
| 7524 |
\pgfsetfillcolor{white} |
| 7525 |
% ...but override it if the class is defined! |
| 7526 |
\pgf@circ@setifdefinedfill{draw, fill}{draw, fill} |
| 7527 |
\else |
| 7528 |
\pgfsetfillcolor{\tikz@fillcolor} |
| 7529 |
\pgfusepath{draw, fill} |
| 7530 |
\fi |
| 7531 |
\endpgfscope |
| 7532 |
} |
| 7533 |
} |
| 7534 |
|
| 7535 |
% %>>> |
| 7536 |
|
| 7537 |
%% Path definitions for Mechanical%<<< |
| 7538 |
|
| 7539 |
\pgf@circ@definetranspath{elmech} |
| 7540 |
\pgfcirc@activate@bipole@simple{l}{spring} |
| 7541 |
\pgfcirc@activate@bipole@simple{l}{inerter} |
| 7542 |
\pgfcirc@activate@bipole@simple{l}{mass} |
| 7543 |
\pgfcirc@activate@bipole@simple{l}{damper} |
| 7544 |
\pgfcirc@activate@bipole@simple{l}{viscoe} |
| 7545 |
% %>>> |
| 7546 |
|
| 7547 |
%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7548 |
%% Miscellaneous bipoles |
| 7549 |
%%%%%%%%%%%%%%%%%%%%%%%%% |
| 7550 |
|
| 7551 |
% settings for microphone, loudspeaker, fuses and misc%<<<1 |
| 7552 |
|
| 7553 |
\ctikzset{bipoles/loudspeaker/height/.initial=.8} |
| 7554 |
\ctikzset{bipoles/loudspeaker/depth/.initial=.3} |
| 7555 |
\ctikzset{bipoles/loudspeaker/width/.initial=.8} |
| 7556 |
\ctikzset{bipoles/mic/height/.initial=1.2} |
| 7557 |
\ctikzset{bipoles/mic/depth/.initial=.1} |
| 7558 |
\ctikzset{bipoles/mic/width/.initial=.8}% |
| 7559 |
\ctikzset{bipoles/tlmic/width/.initial=.5}% it MUST be mic width *5/8 |
| 7560 |
\ctikzset{bipoles/mic/bar thickness/.initial=1} |
| 7561 |
|
| 7562 |
% arresters, fuses, relais, lamps, etc |
| 7563 |
|
| 7564 |
\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30} |
| 7565 |
\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80} |
| 7566 |
\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30} |
| 7567 |
\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60} |
| 7568 |
\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60} |
| 7569 |
\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15} |
| 7570 |
\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25} |
| 7571 |
\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45} |
| 7572 |
% fuses: normal, asymmetric, wiggle |
| 7573 |
\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1} |
| 7574 |
\ctikzset{bipoles/fuse/height/.initial=.20} |
| 7575 |
\ctikzset{bipoles/fuse/width/.initial=.50} |
| 7576 |
\ctikzset{bipoles/afuse/height/.initial=.20} |
| 7577 |
\ctikzset{bipoles/afuse/width/.initial=.50} |
| 7578 |
\ctikzset{bipoles/lamp/height/.initial=.60} |
| 7579 |
\ctikzset{bipoles/lamp/width/.initial=.60} |
| 7580 |
\ctikzset{bipoles/wfuse/height/.initial=.20} |
| 7581 |
\ctikzset{bipoles/wfuse/width/.initial=.50} |
| 7582 |
\ctikzset{bipoles/wfuse/shape/.initial=ocirc} |
| 7583 |
\newif\ifpgf@circ@wfuse@dots\pgf@circ@wfuse@dotstrue |
| 7584 |
\ctikzset{bipoles/wfuse/dots/.is choice} |
| 7585 |
\ctikzset{bipoles/wfuse/dots/.is if=pgf@circ@wfuse@dots} |
| 7586 |
% |
| 7587 |
\ctikzset{bipoles/relais/height/.initial=.8} |
| 7588 |
\ctikzset{bipoles/relais/width/.initial=.3} |
| 7589 |
% |
| 7590 |
\ctikzset{bipoles/bulb/height/.initial=.8} |
| 7591 |
\ctikzset{bipoles/bulb/width/.initial=.8} |
| 7592 |
\ctikzset{bipoles/wbulb/height/.initial=.8} |
| 7593 |
\ctikzset{bipoles/wbulb/width/.initial=.8} |
| 7594 |
% suggested by @bogger33, see https://github.com/circuitikz/circuitikz/issues/793 |
| 7595 |
\ctikzset{bipoles/neonlampcc/height/.initial=.60} |
| 7596 |
\ctikzset{bipoles/neonlampac/height/.initial=.60} |
| 7597 |
\pgf@circ@declare@family@arrows{sparkgap} |
| 7598 |
\newif\ifpgf@sparkgap@dot |
| 7599 |
\newif\ifpgf@sparkgap@circle |
| 7600 |
\ctikzset{sparkgap/circle/.is if=pgf@sparkgap@circle} |
| 7601 |
\ctikzset{sparkgap/dot/.is if=pgf@sparkgap@dot} |
| 7602 |
\ctikzset{sparkgap/gap/.initial=.05} |
| 7603 |
\ctikzset{bipoles/sparkgap/height/.initial=.60} |
| 7604 |
% |
| 7605 |
\ctikzset{bipoles/squid/height/.initial=.60} |
| 7606 |
\ctikzset{bipoles/squid/width/.initial=.60} |
| 7607 |
\ctikzset{bipoles/barrier/height/.initial=.21} |
| 7608 |
\ctikzset{bipoles/barrier/width/.initial=.0} |
| 7609 |
\ctikzset{bipoles/openbarrier/width/.initial=.3} |
| 7610 |
\ctikzset{bipoles/openbarrier/gap/.initial=1} |
| 7611 |
\ctikzset{bipoles/thermocouple/height/.initial=.250} |
| 7612 |
\ctikzset{bipoles/thermocouple/height 2/.initial=.60} |
| 7613 |
\ctikzset{bipoles/thermocouple/width/.initial=.140} |
| 7614 |
\newif\ifpgf@circuit@europeangfsurgearrester |
| 7615 |
\ctikzset{gas filled surge arrester choice/.is choice} |
| 7616 |
\ctikzset{gas filled surge arrester choice/european/.code= {\pgf@circuit@europeangfsurgearrestertrue}} |
| 7617 |
\ctikzset{gas filled surge arrester choice/american/.code= {\pgf@circuit@europeangfsurgearresterfalse}} |
| 7618 |
|
| 7619 |
\tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}} |
| 7620 |
\tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}} |
| 7621 |
%%>>> |
| 7622 |
|
| 7623 |
%% Node shapes for miscellaneous symbols %<<< |
| 7624 |
%% loudspeaker and microphone |
| 7625 |
|
| 7626 |
\pgfcircdeclarebipolescaled{misc} |
| 7627 |
{} |
| 7628 |
{\ctikzvalof{bipoles/loudspeaker/depth}} |
| 7629 |
{loudspeaker} |
| 7630 |
{\ctikzvalof{bipoles/loudspeaker/height}} |
| 7631 |
{\ctikzvalof{bipoles/loudspeaker/width}}{ |
| 7632 |
|
| 7633 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}} |
| 7634 |
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7635 |
\pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.4\pgf@circ@res@up}} |
| 7636 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 7637 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 7638 |
\pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.4\pgf@circ@res@up}} |
| 7639 |
\pgfpathclose |
| 7640 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7641 |
\pgf@circ@draworfill |
| 7642 |
} |
| 7643 |
|
| 7644 |
\def\pgf@circ@draw@mic@bar#1{%relative length of the bar |
| 7645 |
\pgfsetroundcap |
| 7646 |
\pgfsetlinewidth{\ctikzvalof{bipoles/mic/bar thickness}\pgflinewidth}% |
| 7647 |
% adjust the vertical position; the symbol looks better if the circle touch the bar |
| 7648 |
\pgfpathmoveto{\pgfpoint{#1\pgf@circ@res@left}{\pgf@circ@res@up+0.4\pgflinewidth}} |
| 7649 |
\pgfpathlineto{\pgfpoint{#1\pgf@circ@res@right}{\pgf@circ@res@up+0.4\pgflinewidth}} |
| 7650 |
\pgfusepath{draw} |
| 7651 |
} |
| 7652 |
|
| 7653 |
\pgfcircdeclarebipolescaled{misc} |
| 7654 |
{} |
| 7655 |
{\ctikzvalof{bipoles/mic/depth}} |
| 7656 |
{mic} |
| 7657 |
{\ctikzvalof{bipoles/mic/height}} |
| 7658 |
{\ctikzvalof{bipoles/mic/width}}{ |
| 7659 |
|
| 7660 |
\pgfscope |
| 7661 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7662 |
\pgfpathcircle{\pgfpoint{0pt}{.6\pgf@circ@res@up}}{.4\pgf@circ@res@up} |
| 7663 |
\pgf@circ@draworfill |
| 7664 |
\pgf@circ@draw@mic@bar{.6} |
| 7665 |
\endpgfscope |
| 7666 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7667 |
\pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{0pt}} |
| 7668 |
% 0.25358 is 0.6-0.4*cos(30) |
| 7669 |
\pgfpathlineto{\pgfpoint{-.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}} |
| 7670 |
\pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@up}{.25358\pgf@circ@res@up}} |
| 7671 |
\pgfpathlineto{\pgfpoint{.2\pgf@circ@res@up}{0pt}} |
| 7672 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 7673 |
\pgfusepath{draw} |
| 7674 |
} |
| 7675 |
\pgfcircdeclarebipolescaled{misc} |
| 7676 |
{} |
| 7677 |
{\ctikzvalof{bipoles/tlmic/width}} |
| 7678 |
{tlmic} |
| 7679 |
{\ctikzvalof{bipoles/tlmic/width}} |
| 7680 |
{\ctikzvalof{bipoles/tlmic/width}}{ |
| 7681 |
|
| 7682 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7683 |
\pgfpathcircle{\pgfpoint{0pt}{0pt}}{\pgf@circ@res@up} |
| 7684 |
\pgf@circ@draworfill |
| 7685 |
\pgf@circ@draw@mic@bar{1} |
| 7686 |
} |
| 7687 |
|
| 7688 |
%% european gas filled surge arrester |
| 7689 |
\pgfcircdeclarebipolescaled{misc} |
| 7690 |
{} |
| 7691 |
{\ctikzvalof{bipoles/european gas filled surge arrester/height}} |
| 7692 |
{european gas filled surge arrester} |
| 7693 |
{\ctikzvalof{bipoles/european gas filled surge arrester/height}} |
| 7694 |
{\ctikzvalof{bipoles/european gas filled surge arrester/width}} |
| 7695 |
{ |
| 7696 |
|
| 7697 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7698 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7699 |
|
| 7700 |
\pgf@circ@draworfill |
| 7701 |
|
| 7702 |
\pgfscope |
| 7703 |
\pgfsetarrowsend{latexslim} |
| 7704 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7705 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/european gas filled surge arrester/inside}\pgf@circ@res@left}{0pt}} |
| 7706 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7707 |
\pgfusepath{draw} |
| 7708 |
|
| 7709 |
\endpgfscope |
| 7710 |
} |
| 7711 |
|
| 7712 |
%% american gas filled surge arrester |
| 7713 |
\pgfcircdeclarebipolescaled{misc} |
| 7714 |
{} |
| 7715 |
{\ctikzvalof{bipoles/american gas filled surge arrester/height}} |
| 7716 |
{american gas filled surge arrester} |
| 7717 |
{\ctikzvalof{bipoles/american gas filled surge arrester/height}} |
| 7718 |
{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{ |
| 7719 |
|
| 7720 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7721 |
\pgf@circ@res@other=-\pgf@circ@res@up |
| 7722 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} |
| 7723 |
\pgfusepath{draw} |
| 7724 |
|
| 7725 |
\pgfscope |
| 7726 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7727 |
\pgfpathcircle{\pgfpointorigin}{.9\pgf@circ@res@up} |
| 7728 |
\pgf@circ@draworfill |
| 7729 |
\endpgfscope |
| 7730 |
|
| 7731 |
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@zero}} |
| 7732 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7733 |
\pgfusepath{draw} |
| 7734 |
|
| 7735 |
\pgfscope |
| 7736 |
\pgfsetarrowsend{latex} |
| 7737 |
|
| 7738 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7739 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7740 |
\pgfusepath{draw} |
| 7741 |
|
| 7742 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7743 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7744 |
\pgfusepath{draw} |
| 7745 |
\endpgfscope{} |
| 7746 |
|
| 7747 |
\pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/dot x}\pgf@circ@res@left}{\ctikzvalof{bipoles/american gas filled surge arrester/dot y}\pgf@circ@res@down}}{\ctikzvalof{bipoles/american gas filled surge arrester/size}\pgf@circ@res@down} |
| 7748 |
\pgfusepath{fill} |
| 7749 |
} |
| 7750 |
|
| 7751 |
%% thermocouple |
| 7752 |
\pgfcircdeclarebipolescaled{misc} |
| 7753 |
{} |
| 7754 |
{\ctikzvalof{bipoles/thermocouple/height 2}} |
| 7755 |
{thermocouple} |
| 7756 |
{\ctikzvalof{bipoles/thermocouple/height}} |
| 7757 |
{\ctikzvalof{bipoles/thermocouple/width}} |
| 7758 |
{ |
| 7759 |
\pgfsetrectcap |
| 7760 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} |
| 7761 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} |
| 7762 |
\pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}} |
| 7763 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}} |
| 7764 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} |
| 7765 |
\pgfusepath{draw} |
| 7766 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7767 |
\pgfsetroundcap |
| 7768 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} |
| 7769 |
\pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}} |
| 7770 |
\pgfusepath{draw} |
| 7771 |
} |
| 7772 |
%% fuse |
| 7773 |
\pgfcircdeclarebipolescaled{misc} |
| 7774 |
{} |
| 7775 |
{\ctikzvalof{bipoles/fuse/height}} |
| 7776 |
{fuse} |
| 7777 |
{\ctikzvalof{bipoles/fuse/height}} |
| 7778 |
{\ctikzvalof{bipoles/fuse/width}} |
| 7779 |
{ |
| 7780 |
\pgfscope |
| 7781 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7782 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7783 |
\pgf@circ@draworfill |
| 7784 |
\endpgfscope |
| 7785 |
|
| 7786 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} |
| 7787 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} |
| 7788 |
\pgfusepath{draw} |
| 7789 |
|
| 7790 |
} |
| 7791 |
%% asymmetric fuse |
| 7792 |
\pgfcircdeclarebipolescaled{misc} |
| 7793 |
{} |
| 7794 |
{\ctikzvalof{bipoles/afuse/height}} |
| 7795 |
{afuse} |
| 7796 |
{\ctikzvalof{bipoles/afuse/height}} |
| 7797 |
{\ctikzvalof{bipoles/afuse/width}} |
| 7798 |
{ |
| 7799 |
\pgfscope |
| 7800 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7801 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7802 |
\pgf@circ@draworfill |
| 7803 |
\endpgfscope |
| 7804 |
|
| 7805 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} |
| 7806 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} |
| 7807 |
\pgfusepath{draw} |
| 7808 |
|
| 7809 |
\pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7810 |
\pgf@circ@fill@strokecolor |
| 7811 |
\pgfusepath{stroke,fill} |
| 7812 |
} |
| 7813 |
%% wiggly fuse |
| 7814 |
\pgfcircdeclarebipolescaled{misc} |
| 7815 |
{ |
| 7816 |
\savedmacro{\thisshape}{\def\thisshape{\tikz@fig@name}} |
| 7817 |
\savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/wfuse/shape}}} |
| 7818 |
} |
| 7819 |
{\ctikzvalof{bipoles/wfuse/height}} |
| 7820 |
{wfuse} |
| 7821 |
{\ctikzvalof{bipoles/wfuse/height}} |
| 7822 |
{\ctikzvalof{bipoles/wfuse/width}} |
| 7823 |
{ |
| 7824 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7825 |
\pgfpatharc{0}{180}{.5\pgf@circ@res@left} |
| 7826 |
\pgfpatharc{0}{-180}{.5\pgf@circ@res@left} |
| 7827 |
\pgfusepath{draw} |
| 7828 |
\ifpgf@circ@wfuse@dots |
| 7829 |
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7830 |
\pgfnode{\cshape}{center}{}{\thisshape-left}{\pgfusepath{draw}} |
| 7831 |
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}} |
| 7832 |
\pgfnode{\cshape}{center}{}{\thisshape-right}{\pgfusepath{draw}} |
| 7833 |
\fi |
| 7834 |
} |
| 7835 |
|
| 7836 |
%% Relais |
| 7837 |
\pgfcircdeclarebipolescaled{misc} |
| 7838 |
{} |
| 7839 |
{\ctikzvalof{bipoles/relais/height}} |
| 7840 |
{relais} |
| 7841 |
{\ctikzvalof{bipoles/relais/height}} |
| 7842 |
{\ctikzvalof{bipoles/relais/width}} |
| 7843 |
{ |
| 7844 |
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7845 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7846 |
\pgf@circ@draworfill |
| 7847 |
\pgfscope |
| 7848 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 7849 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} |
| 7850 |
\pgfusepath{draw} |
| 7851 |
\endpgfscope |
| 7852 |
} |
| 7853 |
|
| 7854 |
%% SQUID added by Cor Molenaar 5 March 2010 |
| 7855 |
\pgfcircdeclarebipolescaled{misc} |
| 7856 |
{} |
| 7857 |
{\ctikzvalof{bipoles/squid/height}} |
| 7858 |
{squid} |
| 7859 |
{\ctikzvalof{bipoles/squid/height}} |
| 7860 |
{\ctikzvalof{bipoles/squid/width}} |
| 7861 |
{ |
| 7862 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7863 |
|
| 7864 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 7865 |
\pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@up}} |
| 7866 |
\pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@up}} |
| 7867 |
\pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@up}} |
| 7868 |
\pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@up}} |
| 7869 |
\pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{1.35*\pgf@circ@res@down}} |
| 7870 |
\pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{0.65*\pgf@circ@res@down}} |
| 7871 |
\pgfpathmoveto{\pgfpoint{0.35*\pgf@circ@res@left}{0.65*\pgf@circ@res@down}} |
| 7872 |
\pgfpathlineto{\pgfpoint{0.35*\pgf@circ@res@right}{1.35*\pgf@circ@res@down}} |
| 7873 |
|
| 7874 |
\pgfusepath{draw} |
| 7875 |
} |
| 7876 |
|
| 7877 |
% Generic barrier added by Cor Molenaar 5 March 2010 |
| 7878 |
\pgfcircdeclarebipolescaled{misc} |
| 7879 |
{} |
| 7880 |
{\ctikzvalof{bipoles/barrier/height}} |
| 7881 |
{barrier} |
| 7882 |
{\ctikzvalof{bipoles/barrier/height}} |
| 7883 |
{\ctikzvalof{bipoles/barrier/width}} |
| 7884 |
{ |
| 7885 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@step}} |
| 7886 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@step}} |
| 7887 |
\pgfusepath{draw} |
| 7888 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7889 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@down}{\pgf@circ@res@up}} |
| 7890 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{\pgf@circ@res@down}} |
| 7891 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@down}{\pgf@circ@res@down}} |
| 7892 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{\pgf@circ@res@up}} |
| 7893 |
\pgfusepath{draw} |
| 7894 |
} |
| 7895 |
|
| 7896 |
% open version of the barrier symbol |
| 7897 |
% suggested by Radványi Patrik Tamás <[email protected]> |
| 7898 |
\pgfcircdeclarebipolescaled{misc} |
| 7899 |
{} |
| 7900 |
{\ctikzvalof{bipoles/barrier/height}} |
| 7901 |
{openbarrier} |
| 7902 |
{\ctikzvalof{bipoles/barrier/height}} |
| 7903 |
{\ctikzvalof{bipoles/openbarrier/width}} |
| 7904 |
{ |
| 7905 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 7906 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/openbarrier/gap}*\pgf@circ@res@left}{0pt}} |
| 7907 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 7908 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/openbarrier/gap}*\pgf@circ@res@right}{0pt}} |
| 7909 |
\pgfusepath{draw} |
| 7910 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7911 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@down}{\pgf@circ@res@up}} |
| 7912 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{\pgf@circ@res@down}} |
| 7913 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@down}{\pgf@circ@res@down}} |
| 7914 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@up}{\pgf@circ@res@up}} |
| 7915 |
\pgfusepath{draw} |
| 7916 |
} |
| 7917 |
|
| 7918 |
%% Lamp |
| 7919 |
\pgfcircdeclarebipolescaled{misc} |
| 7920 |
{} |
| 7921 |
{\ctikzvalof{bipoles/lamp/height}} |
| 7922 |
{lamp} |
| 7923 |
{\ctikzvalof{bipoles/lamp/height}} |
| 7924 |
{\ctikzvalof{bipoles/lamp/width}} |
| 7925 |
{ |
| 7926 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7927 |
|
| 7928 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 7929 |
\pgf@circ@draworfill |
| 7930 |
\pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@up}} |
| 7931 |
\pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@down}} |
| 7932 |
\pgfpathmoveto{\pgfpoint{.7071*\pgf@circ@res@left}{.7071*\pgf@circ@res@down}} |
| 7933 |
\pgfpathlineto{\pgfpoint{.7071*\pgf@circ@res@right}{.7071*\pgf@circ@res@up}} |
| 7934 |
\pgfusepath{draw} |
| 7935 |
} |
| 7936 |
|
| 7937 |
%% bulb |
| 7938 |
\pgfcircdeclarebipolescaled{misc} |
| 7939 |
{} |
| 7940 |
{\ctikzvalof{bipoles/bulb/height}} |
| 7941 |
{bulb} |
| 7942 |
{\ctikzvalof{bipoles/bulb/height}} |
| 7943 |
{\ctikzvalof{bipoles/bulb/width}} |
| 7944 |
{% |
| 7945 |
% circles are smaller than the size of the component, for historical reasons. |
| 7946 |
% Join the circle to the wires |
| 7947 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7948 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7949 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7950 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7951 |
\pgfusepath{draw} |
| 7952 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7953 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}} |
| 7954 |
\pgf@circ@draworfill |
| 7955 |
\pgfpathmoveto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7956 |
\pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7957 |
\pgfpatharc{0}{-180}{0.4*\pgf@circ@res@left} |
| 7958 |
\pgfsetbeveljoin |
| 7959 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7960 |
\pgfusepath{draw} |
| 7961 |
}% |
| 7962 |
% Wiggly bulbm see https://github.com/circuitikz/circuitikz/issues/845 |
| 7963 |
\pgfcircdeclarebipolescaled{misc} |
| 7964 |
{} |
| 7965 |
{\ctikzvalof{bipoles/wbulb/height}} |
| 7966 |
{wbulb} |
| 7967 |
{\ctikzvalof{bipoles/wbulb/height}} |
| 7968 |
{\ctikzvalof{bipoles/wbulb/width}} |
| 7969 |
{% |
| 7970 |
% circles are smaller than the size of the component, for historical reasons. |
| 7971 |
% Join the circle to the wires |
| 7972 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7973 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7974 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7975 |
\pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@zero}} |
| 7976 |
\pgfusepath{draw} |
| 7977 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 7978 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf@circ@res@up}}{\pgfpoint{0.8\pgf@circ@res@left}{0}} |
| 7979 |
\pgf@circ@draworfill |
| 7980 |
\pgfpathmoveto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@zero}} |
| 7981 |
% CP: Control Point; FP: Final Point |
| 7982 |
\pgfpathcurveto |
| 7983 |
{\pgfpoint{0.5\pgf@circ@res@left}{+0pt}} % CP1 |
| 7984 |
{\pgfpoint{0.4\pgf@circ@res@left}{0.6\pgf@circ@res@left}} % CP2 |
| 7985 |
{\pgfpoint{+0pt}{+0pt}} % FPA |
| 7986 |
\pgfpathcurveto |
| 7987 |
{\pgfpoint{.2\pgf@circ@res@right}{.2\pgf@circ@res@right}} % CP3 |
| 7988 |
{\pgfpoint{.2\pgf@circ@res@right}{0.6\pgf@circ@res@right}} % CP4 |
| 7989 |
{\pgfpoint{+0pt}{0.6\pgf@circ@res@right}} % FPB |
| 7990 |
\pgfpathcurveto |
| 7991 |
{\pgfpoint{.2\pgf@circ@res@left}{0.6\pgf@circ@res@right}} % symmetric to CP4 |
| 7992 |
{\pgfpoint{.2\pgf@circ@res@left}{.2\pgf@circ@res@right}} % symmetric to CP3 |
| 7993 |
{\pgfpoint{+0pt}{+0pt}} % same as FPA |
| 7994 |
\pgfpathcurveto |
| 7995 |
{\pgfpoint{0.4\pgf@circ@res@right}{0.6\pgf@circ@res@left}} % symmetric to CP2 |
| 7996 |
{\pgfpoint{0.5\pgf@circ@res@right}{+0pt}} % symmetric to CP1 |
| 7997 |
{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@zero}} % symmetric to FPB |
| 7998 |
\pgfusepath{draw} |
| 7999 |
}% |
| 8000 |
% neon lamps, suggested by @bogger33 https://github.com/circuitikz/circuitikz/issues/793 |
| 8001 |
% implemented by Romano |
| 8002 |
% double-cathode (capacitor) style |
| 8003 |
\pgfcircdeclarebipolescaled{misc} |
| 8004 |
{} |
| 8005 |
{\ctikzvalof{bipoles/neonlampcc/height}} |
| 8006 |
{neonlampcc} |
| 8007 |
{\ctikzvalof{bipoles/neonlampcc/height}} |
| 8008 |
{\ctikzvalof{bipoles/neonlampcc/height}} |
| 8009 |
{ |
| 8010 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 8011 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 8012 |
\pgf@circ@draworfill |
| 8013 |
%% leads in |
| 8014 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 8015 |
\def\@@w{0.2}\def\@@h{0.6} |
| 8016 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 8017 |
\pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{0pt}} |
| 8018 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 8019 |
\pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@right}{0pt}} |
| 8020 |
%% "capacitor style" symbol |
| 8021 |
\pgfusepath{draw} |
| 8022 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 8023 |
\pgfpathmoveto{\pgfpoint{\@@w\pgf@circ@res@right}{\@@h\pgf@circ@res@down}} |
| 8024 |
\pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@right}{\@@h\pgf@circ@res@up}} |
| 8025 |
\pgfpathmoveto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@down}} |
| 8026 |
\pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@up}} |
| 8027 |
\pgfusepath{draw} |
| 8028 |
%% dot |
| 8029 |
\pgftransformshift{\pgfpoint{\@@w\pgf@circ@res@left-3*\ctikzvalof{nodes width}\pgf@circ@Rlen} |
| 8030 |
{\@@h\pgf@circ@res@down + 2*\ctikzvalof{nodes width}\pgf@circ@Rlen}} |
| 8031 |
\pgfnode{circ}{center}{}{}{\pgfusepath{draw,fill}} |
| 8032 |
} |
| 8033 |
% anode-cathode style |
| 8034 |
\pgfcircdeclarebipolescaled{misc} |
| 8035 |
{} |
| 8036 |
{\ctikzvalof{bipoles/neonlampac/height}} |
| 8037 |
{neonlampac} |
| 8038 |
{\ctikzvalof{bipoles/neonlampac/height}} |
| 8039 |
{\ctikzvalof{bipoles/neonlampac/height}} |
| 8040 |
{ |
| 8041 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 8042 |
\pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} |
| 8043 |
\pgf@circ@draworfill |
| 8044 |
%% leads in |
| 8045 |
\pgfsetlinewidth{\pgfstartlinewidth} |
| 8046 |
\def\@@w{0.5}\def\@@h{0.5} |
| 8047 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 8048 |
\pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{0pt}} |
| 8049 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 8050 |
\pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@right}{0pt}} |
| 8051 |
\pgfusepath{draw} |
| 8052 |
%% one terminal is a straight plate |
| 8053 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 8054 |
\pgfpathmoveto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@down}} |
| 8055 |
\pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@up}} |
| 8056 |
\pgfusepath{draw} |
| 8057 |
%% the other is an "ocirc" shape |
| 8058 |
\pgftransformshift{\pgfpoint{\@@w\pgf@circ@res@right}{0pt}} |
| 8059 |
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw,fill}} |
| 8060 |
%% dot |
| 8061 |
\pgftransformshift{\pgfpoint{-\@@w\pgf@circ@res@right}{\@@h\pgf@circ@res@down}} |
| 8062 |
\pgfnode{circ}{center}{}{}{\pgfusepath{draw,fill}} |
| 8063 |
} |
| 8064 |
% spark gap, suggested by @bogger33 https://github.com/circuitikz/circuitikz/issues/800 |
| 8065 |
\pgfcircdeclarebipolescaled{misc} |
| 8066 |
{ |
| 8067 |
\savedmacro{\changeh}{\edef\changeh{\ifpgf@sparkgap@circle 1 \else 0.5 \fi}} |
| 8068 |
\pgfcirc@border@extend@updown{\changeh}{\changeh} |
| 8069 |
} |
| 8070 |
{\ctikzvalof{bipoles/sparkgap/height}} |
| 8071 |
{sparkgap} |
| 8072 |
{\ctikzvalof{bipoles/sparkgap/height}} |
| 8073 |
{\ctikzvalof{bipoles/sparkgap/height}}{ |
| 8074 |
% circle (if requested) |
| 8075 |
\pgfscope |
| 8076 |
\ifpgf@sparkgap@circle |
| 8077 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 8078 |
\pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@up} |
| 8079 |
\pgf@circ@draworfill |
| 8080 |
\fi |
| 8081 |
\endpgfscope |
| 8082 |
% arrows |
| 8083 |
\pgfscope |
| 8084 |
\pgfcirc@set@arrows{sparkgap}{}{Triangle[scale=2]} |
| 8085 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 8086 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{sparkgap/gap}\pgf@circ@res@right}{0pt}} |
| 8087 |
\pgfusepath{draw} |
| 8088 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 8089 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{sparkgap/gap}\pgf@circ@res@left}{0pt}} |
| 8090 |
\pgfusepath{draw} |
| 8091 |
\endpgfscope{} |
| 8092 |
% dot (if requested) |
| 8093 |
\ifpgf@sparkgap@dot |
| 8094 |
\pgftransformshift{\pgfpoint |
| 8095 |
{\ctikzvalof{sparkgap/gap}\pgf@circ@res@left-1*\ctikzvalof{nodes width}\pgf@circ@Rlen} |
| 8096 |
{-4*\ctikzvalof{nodes width}\pgf@circ@Rlen}} |
| 8097 |
\pgfnode{circ}{center}{}{}{\pgfusepath{draw,fill}} |
| 8098 |
\fi |
| 8099 |
} |
| 8100 |
|
| 8101 |
%>>> |
| 8102 |
|
| 8103 |
%% Path definitions for Miscellaneous%<<< |
| 8104 |
|
| 8105 |
\pgfcirc@activate@bipole@simple{l}{lamp} |
| 8106 |
\pgfcirc@activate@bipole@simple{l}{neonlampcc} |
| 8107 |
\pgfcirc@activate@bipole@simple{l}{neonlampac} |
| 8108 |
\pgfcirc@activate@bipole@simple{l}{sparkgap} |
| 8109 |
\pgfcirc@activate@bipole@simple{l}{bulb} |
| 8110 |
\pgfcirc@activate@bipole@simple{l}{wbulb} |
| 8111 |
\pgfcirc@activate@bipole@simple{l}{squid} |
| 8112 |
\pgfcirc@activate@bipole@simple{l}{barrier} |
| 8113 |
\pgfcirc@activate@bipole@simple{l}{openbarrier} |
| 8114 |
\pgfcirc@activate@bipole@simple{l}{thermocouple} |
| 8115 |
\pgfcirc@activate@bipole@simple{l}{fuse} |
| 8116 |
\pgfcirc@activate@bipole{l}{afuse}{afuse}{asymmetric fuse} |
| 8117 |
\pgfcirc@style@to@style{asymmetric fuse}{afuse} |
| 8118 |
\pgfcirc@activate@bipole@simple{l}{wfuse} |
| 8119 |
\pgfcirc@activate@bipole{l}{wfuse}{wfuse}{wiggly fuse} |
| 8120 |
\pgfcirc@activate@bipole@simple{l}{relais} |
| 8121 |
\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi} |
| 8122 |
\pgfcirc@activate@bipole{l}{europeangfsurgearrester}{european gas filled surge arrester}{european gas filled surge arrester} |
| 8123 |
\pgfcirc@activate@bipole{l}{americangfsurgearrester}{american gas filled surge arrester}{american gas filled surge arrester} |
| 8124 |
\pgfcirc@path@to@style{l}{gfsurgearrester}{gas filled surge arrester}{} |
| 8125 |
\pgfcirc@path@to@style{l}{gfsurgearrester}{gf surge arrester}{} |
| 8126 |
\pgfcirc@activate@bipole@simple{l}{mic} |
| 8127 |
\pgfcirc@activate@bipole@simple{l}{tlmic} |
| 8128 |
\pgfcirc@activate@bipole@simple{l}{loudspeaker} |
| 8129 |
% %>>> |
| 8130 |
|
| 8131 |
%% Buzzer and reverse buzzer %<<< |
| 8132 |
\ctikzset{bipoles/buzzer/height/.initial=0.6} |
| 8133 |
\ctikzset{bipoles/buzzer/width/.initial=.4}% |
| 8134 |
\ctikzset{bipoles/buzzer/span/.initial=.6}% |
| 8135 |
|
| 8136 |
\pgfcircdeclarebipolescaled{misc} |
| 8137 |
{} |
| 8138 |
{0} |
| 8139 |
{buzzer} |
| 8140 |
{\ctikzvalof{bipoles/buzzer/height}} |
| 8141 |
{\ctikzvalof{bipoles/buzzer/width}}{ |
| 8142 |
% this is the height of the semicircle |
| 8143 |
\pgf@circ@res@other=\dimexpr\pgf@circ@res@up-\pgf@circ@res@right\relax |
| 8144 |
\pgfscope |
| 8145 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 8146 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@other}} |
| 8147 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@other}} |
| 8148 |
\pgfpatharc{0}{180}{\pgf@circ@res@right} |
| 8149 |
\pgfpathclose |
| 8150 |
\pgf@circ@draworfill |
| 8151 |
\endpgfscope |
| 8152 |
\pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{\pgf@circ@res@other}} |
| 8153 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{0pt}} |
| 8154 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 8155 |
\pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{\pgf@circ@res@other}} |
| 8156 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{0pt}} |
| 8157 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 8158 |
\pgfusepath{draw} |
| 8159 |
} |
| 8160 |
\pgfcirc@activate@bipole@simple{l}{buzzer} |
| 8161 |
% |
| 8162 |
\pgfcircdeclarebipolescaled{misc} |
| 8163 |
{} |
| 8164 |
{0} |
| 8165 |
{rbuzzer} |
| 8166 |
{\ctikzvalof{bipoles/buzzer/height}} |
| 8167 |
{\ctikzvalof{bipoles/buzzer/width}}{ |
| 8168 |
% this is the height of the semicircle |
| 8169 |
\pgf@circ@res@other=\dimexpr\pgf@circ@res@up-\pgf@circ@res@right\relax |
| 8170 |
% this is the height where the pins touch the semicircle |
| 8171 |
\pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@res@up- |
| 8172 |
\pgf@circ@res@right*sqrt(1-\ctikzvalof{bipoles/buzzer/span}*\ctikzvalof{bipoles/buzzer/span})} |
| 8173 |
\pgfscope |
| 8174 |
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} |
| 8175 |
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} |
| 8176 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} |
| 8177 |
\pgfpatharc{0}{-180}{\pgf@circ@res@right} |
| 8178 |
\pgfpathclose |
| 8179 |
\pgf@circ@draworfill |
| 8180 |
\endpgfscope |
| 8181 |
\pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{\pgf@circ@res@temp}} |
| 8182 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{0pt}} |
| 8183 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} |
| 8184 |
\pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{\pgf@circ@res@temp}} |
| 8185 |
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{0pt}} |
| 8186 |
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} |
| 8187 |
\pgfusepath{draw} |
| 8188 |
} |
| 8189 |
\pgfcirc@activate@bipole@simple{l}{rbuzzer} |
| 8190 |
% %>>> |
| 8191 |
|
| 8192 |
% end of pgfcircbipoles.tex |
| 8193 |
% vim: set fdm=marker fmr=%<<<,%>>>: |