summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/tikzlibrarycircuits.ee.IEC.code.tex
blob: 9d1cfcfcea5f896b49c169eb17ee6349a1bb05d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
% Copyright 2019 by Till Tantau and others Wibrow
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\usetikzlibrary{arrows}%
\usetikzlibrary{circuits.ee}%

\usepgflibrary{shapes.gates.ee.IEC}%


%
% When this lib is loaded, all symbols default to IEC
%

\tikzset{
  circuit ee IEC/.style=
  {
    circuit ee,
    set resistor graphic              = resistor IEC graphic,
    set inductor graphic              = inductor IEC graphic,
    set capacitor graphic             = capacitor IEC graphic,
    set contact graphic               = contact IEC graphic,
    set ground graphic                = ground IEC graphic,
    set battery graphic               = battery IEC graphic,
    set diode graphic                 = diode IEC graphic,
    set Zener diode graphic           = Zener diode IEC graphic,
    set tunnel diode graphic          = tunnel diode IEC graphic,
    set backward diode graphic        = backward diode IEC graphic,
    set Schottky diode graphic        = Schottky diode IEC graphic,
    set breakdown diode graphic       = breakdown diode IEC graphic,
    set bulb graphic                  = bulb IEC graphic,
    set voltage source graphic        = voltage source IEC graphic,
    set current source graphic        = current source IEC graphic,
    set make contact graphic          = make contact IEC graphic,
    set break contact graphic         = break contact IEC graphic,
    set amperemeter graphic           = amperemeter graphic,
    set voltmeter graphic             = voltmeter graphic,
    set ohmmeter graphic              = ohmmeter graphic,
    set ac source graphic             = ac source graphic,
    set dc source graphic             = dc source graphic,
  },
}%


%
% Resistors
%

\tikzset{
  resistor IEC graphic/.style={
    circuit symbol open,
    circuit symbol size=width 4 height 1,
    shape=rectangle ee,
    transform shape,
  },
  var resistor IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width 4.8 height 0.8,
    shape=var resistor IEC,
    transform shape,
    outer sep=0pt,
    cap=round,
  },
}%



%
% Inductors
%

\tikzset{
  inductor IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width 4 height .5,
    transform shape,
    shape=inductor IEC,
    outer sep=0pt,
    cap=round,
  },
  var inductor IEC graphic/.style={
    circuit symbol filled,
    circuit symbol size=width 4 height 1,
    transform shape,
    shape=rectangle ee,
  },
}%



%
% Capacitors
%

\tikzset{
  capacitor IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width .5 height 2,
    transform shape,
    shape=capacitor IEC,
  },
}%



%
% Ground
%

\tikzset{
  ground IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width .75 height 2,
    transform shape,
    shape=ground IEC,
  },
}%




%
% Battery
%

\tikzset{
  battery IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width .5 height 2.5,
    transform shape,
    shape=battery IEC,
    transform shape,
  },
}%



%
% Diodes
%

\tikzset{
  %
  % normal diode
  %
  diode IEC graphic/.style={
    circuit symbol open,
    circuit symbol size=width 1.25 height 1.25,
    transform shape,
    shape=generic diode IEC,
    /pgf/generic diode IEC/before background={
      \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
      \pgfusepathqstroke
    },
  },
  var diode IEC graphic/.style={
    diode IEC graphic,
    circuit symbol filled,
  },
}%

\tikzset{
  %
  % Zener diode
  %
  Zener diode IEC graphic/.style={
    diode IEC graphic,
    /pgf/generic diode IEC/before background={
      \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
      \pgfusepathqstroke
    },
  },
  var Zener diode IEC graphic/.style={
    Zener diode IEC graphic,
    circuit symbol filled,
  },
}%

\tikzset{
  %
  % Schottky diode
  %
  Schottky diode IEC graphic/.style={
    diode IEC graphic,
    /pgf/generic diode IEC/before background={
      \pgfpathmoveto{\pgfqpoint{-.4pt}{-.6pt}}
      \pgfpathlineto{\pgfqpoint{-.4pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
      \pgfpathlineto{\pgfqpoint{.4pt}{1pt}}
      \pgfpathlineto{\pgfqpoint{.4pt}{.6pt}}
      \pgfusepathqstroke
    },
  },
  var Schottky diode IEC graphic/.style={
    Schottky diode IEC graphic,
    circuit symbol filled,
  },
}%

\tikzset{
  %
  % tunnel diode
  %
  tunnel diode IEC graphic/.style={
    diode IEC graphic,
    /pgf/generic diode IEC/before background={
      \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
      \pgfpathlineto{\pgfqpoint{-.5pt}{1pt}}
      \pgfusepathqstroke
    },
  },
  var tunnel diode IEC graphic/.style={
    tunnel diode IEC graphic,
    circuit symbol filled,
  },
}%

\tikzset{
  %
  % backward diode
  %
  backward diode IEC graphic/.style={
    diode IEC graphic,
    /pgf/generic diode IEC/before background={
      \pgfpathmoveto{\pgfqpoint{-.5pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{.5pt}{-1pt}}
      \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
      \pgfpathmoveto{\pgfqpoint{-.5pt}{1pt}}
      \pgfpathlineto{\pgfqpoint{.5pt}{1pt}}
      \pgfusepathqstroke
    },
  },
  var backward diode IEC graphic/.style={
    backward diode IEC graphic,
    circuit symbol filled,
  },
}%


\tikzset{
  %
  % breakdown diode
  %
  breakdown diode IEC graphic/.style={
    circuit symbol open,
    circuit symbol size=width 2.5 height 1.25,
    transform shape,
    shape=breakdown diode IEC,
  },
  var breakdown diode IEC graphic/.style={
    breakdown diode IEC graphic,
    circuit symbol filled,
  },
}%



%
% Contacts
%

\tikzset{
  contact IEC graphic/.style={
    circuit symbol filled,
    circuit symbol size=width .5 height .5,
    shape=circle ee,
    outer sep=.25\pgflinewidth,
  },
%  connection IEC graphic/.style={
%    circuit symbol open,
%    circuit symbol size=width 1 height 1,
%    shape=circle ee,
%    outer sep=.25\pgflinewidth,
%  },
}%


%
% Bulbs
%

\tikzset{
  bulb IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width 1.5 height 1.5,
    shape=generic circle IEC,
    /pgf/generic circle IEC/before background={
      \pgfpathmoveto{\pgfpointpolar{-135}{1pt}}
      \pgfpathlineto{\pgfpointpolar{45}{1pt}}
      \pgfpathmoveto{\pgfpointpolar{-45}{1pt}}
      \pgfpathlineto{\pgfpointpolar{135}{1pt}}
      \pgfusepathqstroke
    },
    transform shape,
  },
}%


%
% Current and voltage sources
%

\tikzset{
  current source IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width 2 height 2,
    shape=generic circle IEC,
    /pgf/generic circle IEC/before background={
      \pgfpathmoveto{\pgfqpoint{0pt}{-1pt}}
      \pgfpathlineto{\pgfqpoint{0pt}{1pt}}
      \pgfusepathqstroke
    },
    transform shape,
  },
  voltage source IEC graphic/.style={
    circuit symbol lines,
    circuit symbol size=width 2 height 2,
    shape=generic circle IEC,
    /pgf/generic circle IEC/before background={
      \pgfpathmoveto{\pgfqpoint{-1pt}{0pt}}
      \pgfpathlineto{\pgfqpoint{1pt}{0pt}}
      \pgfusepathqstroke
    },
    transform shape,
  },
}%



%
% Contacts
%

\tikzset{
  make contact IEC graphic/.style={
    circuit symbol wires,
    circuit symbol size=width 2 height 1,
    transform shape,
    shape=make contact IEC,
    outer sep=0pt,
    cap=round,
  },
  var make contact IEC graphic/.style={
    circuit symbol wires,
    circuit symbol size=width 2.4 height 1,
    transform shape,
    shape=var make contact IEC,
    outer sep=0pt,
    cap=round,
  },
}%


\tikzset{
  break contact IEC graphic/.style={
    circuit symbol wires,
    circuit symbol size=width 2 height 1,
    transform shape,
    shape=break contact IEC,
    outer sep=0pt,
    cap=round,
  },
}%



%
% Measurement devices
%

\tikzset{
  amperemeter graphic/.style={
    circuit symbol open,
    circuit symbol size=width 2 height 2,
    transform shape,
    shape=generic circle IEC,
    info=center:A,
  },
  voltmeter graphic/.style={
    circuit symbol open,
    circuit symbol size=width 2 height 2,
    transform shape,
    shape=generic circle IEC,
    info=center:V,
  },
  ohmmeter graphic/.style={
    circuit symbol open,
    circuit symbol size=width 2 height 2,
    transform shape,
    shape=generic circle IEC,
    info=center:$\Omega$,
  },
}%



%
% AC/DC
%

\tikzset{
  ac source graphic/.style={
    circuit symbol lines,
    circuit symbol size=width 2 height 2,
    shape=generic circle IEC,
    /pgf/generic circle IEC/before background={
      \pgfpathmoveto{\pgfqpoint{0.7pt}{0pt}}
      \pgfpathquadraticcurveto{\pgfqpoint{ 0.35pt}{-0.5pt}}{\pgfqpoint{0pt}{0pt}}
      \pgfpathquadraticcurveto{\pgfqpoint{-0.35pt}{ 0.5pt}}{\pgfqpoint{-0.7pt}{0pt}}
      \pgfusepathqstroke
    },
    transform shape,
  },
  dc source graphic/.style={
    circuit symbol lines,
    circuit symbol size=width 2 height 2,
    shape=generic circle IEC,
    /pgf/generic circle IEC/before background={
      \pgfpathmoveto{\pgfqpoint{ 0.7pt}{ 0.2pt}}
      \pgfpathlineto{\pgfqpoint{-0.7pt}{ 0.2pt}}
      \pgfusepathqstroke
      \pgfpathmoveto{\pgfqpoint{ 0.7pt}{-0.2pt}}
      \pgfpathlineto{\pgfqpoint{-0.7pt}{-0.2pt}}
      \pgfusepathqstroke
    },
    transform shape,
  },
}%

\endinput