chap2-gates.tex
1.59 KB
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
\documentclass[multi={tikzpicture},crop=true,border=5pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{verbatim}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,arrows.meta,petri}
\tikzset{
>=latex,
every place/.style={minimum size=6mm},
every transition/.style={minimum size=6mm},
token distance=6pt,
}
\tikzstyle{trans}=[transition]
\tikzstyle{arc}=[->,rounded corners]
\tikzstyle{state}=[draw=blue!50!gray!50!white,
fill=blue!70!gray!10!white,
line width=2pt,
cloud,cloud puffs=8,
inner sep=-1pt]
\tikzstyle{fire}=[arrows={-Straight Barb[scale=.6]},
shorten >=-2pt, shorten <=-1pt,
draw=blue!50!gray!50!white,
line width=2pt,
line cap=round,
rounded corners]
\tikzstyle{active}=[draw=green!50!gray!50!white,
fill=green!70!gray!10!white]
\begin{document}
%%FRAME
\begin{tikzpicture}[scale=1.2]
\node[place,tokens={{ state["low"] }}] (low) at (0,0) {};
\node[below] at (low.south) {\tiny\textsf{bas}};
\node[place,tokens={{ state["high"] }}] (high) at (0,2) {};
\node[above] at (high.north) {\tiny\textsf{haut}};
\node[trans,{{ active["down"] }}] (down) at (-1,1) {};
\node[rotate=45] at (down) {\tiny\textsf{baisse}};
\node[trans,{{ active["up"] }}] (up) at (1,1) {};
\node[rotate=45] at (up) {\tiny\textsf{lève}};
\draw[arc] (high) -| (down);
\draw[arc] (down) |- (low);
\draw[arc] (low) -| (up);
\draw[arc] (up) |- (high);
{% if state["low"] == 1 %}
\node at (2.5,1) {\includegraphics[width=2cm]{../chap2/low}};
{% else %}
\node at (2.5,1) {\includegraphics[width=2cm]{../chap2/high}};
{% endif %}
\end{tikzpicture}
%%/FRAME
\end{document}