| 1 |
\NeedsTeXFormat{LaTeX2e}[1999/01/01] |
| 2 |
\ProvidesPackage{grafcet}[2007/03/05] |
| 3 |
|
| 4 |
\RequirePackage{tikz} |
| 5 |
\usetikzlibrary{shapes,arrows} |
| 6 |
\RequirePackage{ifthen} |
| 7 |
\RequirePackage{ifsym} |
| 8 |
%macros commande diverses |
| 9 |
|
| 10 |
|
| 11 |
\newcommand{\Etape}[2][NoeudGraf]{ |
| 12 |
\node (NoeudGraf) at (#1) [draw, rectangle, |
| 13 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 14 |
\node (AX#2) at (X#2){}; |
| 15 |
\DecaleNoeudy[2.5]{X#2}{NoeudGraf} |
| 16 |
\node (VX#2) at (NoeudGraf) {}; |
| 17 |
} |
| 18 |
|
| 19 |
\newcommand{\EtapeSeule}[2][NoeudGraf]{ |
| 20 |
\node (NoeudGraf) at (#1) [draw, rectangle, |
| 21 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 22 |
\node (AX#2) at (X#2){}; |
| 23 |
} |
| 24 |
\newcommand{\EtapeInit}[2][NoeudGraf]{ |
| 25 |
\node (NoeudGraf) at (#1) [draw, rectangle, |
| 26 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 27 |
\path (X#2.north west) --++(0.3em,0) coordinate(NOh) -- (X#2.north east)--++(-0.3em,0)coordinate(NEh); |
| 28 |
\path (X#2.south west) --++(0.3em,0) coordinate(SOh) -- (X#2.south east)--++(-0.3em,0)coordinate(SEh); |
| 29 |
\path (X#2.north west) --++(0,-0.3em) coordinate(NOv) -- (X#2.south west)--++(0,0.3em)coordinate(SOv); |
| 30 |
\path (X#2.north east) --++(0,-0.3em) coordinate(NEv) -- (X#2.south east)--++(0,0.3em)coordinate(SEv); |
| 31 |
|
| 32 |
\draw (NOh|-NOv)coordinate(NO) -- (SOh|-SOv) coordinate (SO) -- (SEh|-SEv)coordinate(SE) -- (NEh|-NEv) -- cycle; |
| 33 |
%\node (coin1) at (X#2.north west)[minimum size=0.1em]{}{}; |
| 34 |
%\node (coin2) at (X#2.south east)[minimum size=0.1em]{}{}; |
| 35 |
%\draw (coin1.south east) rectangle (coin2.north west); |
| 36 |
\node (AX#2) at (X#2){}; |
| 37 |
\DecaleNoeudy[2.5]{X#2}{NoeudGraf} |
| 38 |
\node (VX#2) at (NoeudGraf) {}; |
| 39 |
} |
| 40 |
|
| 41 |
\newcommand{\MacroEtape}[2][NoeudGraf]{ |
| 42 |
\node (NoeudGraf) at (#1) [draw, rectangle, |
| 43 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 44 |
\node (coin1) at (X#2.north west)[minimum size=0.1em]{}{}; |
| 45 |
\node (coin2) at (X#2.south east)[minimum size=0.1em]{}{}; |
| 46 |
\node (coin3) at (X#2.north east)[minimum size=0.1em]{}{}; |
| 47 |
\node (coin4) at (X#2.south west)[minimum size=0.1em]{}{}; |
| 48 |
\draw (coin1.south) -- (coin3.south); |
| 49 |
\draw (coin2.north) -- (coin4.north); |
| 50 |
\node (AX#2) at (X#2){}; |
| 51 |
\DecaleNoeudy[2.5]{X#2}{NoeudGraf} |
| 52 |
\node (VX#2) at (NoeudGraf) {}; |
| 53 |
} |
| 54 |
\newcommand{\MacroEtapeE}[2][NoeudGraf]{ |
| 55 |
\node (NoeudGraf) at (#1) [draw, rectangle, |
| 56 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 57 |
\node (coin1) at (X#2.north west)[minimum size=0.1em]{}{}; |
| 58 |
\node (coin2) at (X#2.south east)[minimum size=0.1em]{}{}; |
| 59 |
\node (coin3) at (X#2.north east)[minimum size=0.1em]{}{}; |
| 60 |
\node (coin4) at (X#2.south west)[minimum size=0.1em]{}{}; |
| 61 |
\draw (coin1.south) -- (coin3.south); |
| 62 |
\node (AX#2) at (X#2){}; |
| 63 |
\DecaleNoeudy[2.5]{X#2}{NoeudGraf} |
| 64 |
\node (VX#2) at (NoeudGraf) {}; |
| 65 |
} |
| 66 |
|
| 67 |
\newcommand{\MacroEtapeS}[2][NoeudGraf]{ |
| 68 |
\node (NoeudGraf) at (#1) [draw, rectangle, |
| 69 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 70 |
\node (coin1) at (X#2.north west)[minimum size=0.1em]{}{}; |
| 71 |
\node (coin2) at (X#2.south east)[minimum size=0.1em]{}{}; |
| 72 |
\node (coin3) at (X#2.north east)[minimum size=0.1em]{}{}; |
| 73 |
\node (coin4) at (X#2.south west)[minimum size=0.1em]{}{}; |
| 74 |
\draw (coin2.north) -- (coin4.north); |
| 75 |
\node (AX#2) at (X#2){}; |
| 76 |
\DecaleNoeudy[2.5]{X#2}{NoeudGraf} |
| 77 |
\node (VX#2) at (NoeudGraf) {}; |
| 78 |
} |
| 79 |
|
| 80 |
\newcommand{\EtapeEncapsulante}[2][NoeudGraf]{ |
| 81 |
\node[inner sep=0,outer sep=0] (NoeudGraf) at (#1) [draw, rectangle, |
| 82 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 83 |
|
| 84 |
\path (X#2.north west) --++(0.8em,0) coordinate(NOh) -- (X#2.north east)--++(-0.8em,0)coordinate(NEh); |
| 85 |
\path (X#2.south west) --++(0.8em,0) coordinate(SOh) -- (X#2.south east)--++(-0.8em,0)coordinate(SEh); |
| 86 |
\path (X#2.north west) --++(0,-0.8em) coordinate(NOv) -- (X#2.south west)--++(0,0.8em)coordinate(SOv); |
| 87 |
\path (X#2.north east) --++(0,-0.8em) coordinate(NEv) -- (X#2.south east)--++(0,0.8em)coordinate(SEv); |
| 88 |
|
| 89 |
\draw (X#2.north west) -- (NOh) -- (NOv) -- cycle; |
| 90 |
\draw (X#2.south west) -- (SOh) -- (SOv) -- cycle; |
| 91 |
\draw (X#2.north east) -- (NEh) -- (NEv) -- cycle; |
| 92 |
\draw (X#2.south east) -- (SEh) -- (SEv) -- cycle; |
| 93 |
|
| 94 |
\node (AX#2) at (X#2){}; |
| 95 |
\DecaleNoeudy[2.5]{X#2}{NoeudGraf} |
| 96 |
\node (VX#2) at (NoeudGraf) {}; |
| 97 |
} |
| 98 |
|
| 99 |
\newcommand{\EtapeEncapsulanteInit}[2][NoeudGraf]{ |
| 100 |
\node (NoeudGraf) at (#1) [draw, rectangle, |
| 101 |
minimum height=2.5em,minimum width=2.5em] (X#2) {#2}; |
| 102 |
\path (X#2.north west) --++(0.3em,0) coordinate(NOh) -- (X#2.north east)--++(-0.3em,0)coordinate(NEh); |
| 103 |
\path (X#2.south west) --++(0.3em,0) coordinate(SOh) -- (X#2.south east)--++(-0.3em,0)coordinate(SEh); |
| 104 |
\path (X#2.north west) --++(0,-0.3em) coordinate(NOv) -- (X#2.south west)--++(0,0.3em)coordinate(SOv); |
| 105 |
\path (X#2.north east) --++(0,-0.3em) coordinate(NEv) -- (X#2.south east)--++(0,0.3em)coordinate(SEv); |
| 106 |
|
| 107 |
\draw (NOh|-NOv)coordinate(NO) -- (SOh|-SOv) coordinate (SO) -- (SEh|-SEv)coordinate(SE) -- (NEh|-NEv)coordinate(NE) -- cycle; |
| 108 |
|
| 109 |
\path (NO) --++(0.5em,0) coordinate(NOh) -- (NE)--++(-0.5em,0)coordinate(NEh); |
| 110 |
\path (SO) --++(0.5em,0) coordinate(SOh) -- (SE)--++(-0.5em,0)coordinate(SEh); |
| 111 |
\path (NO) --++(0,-0.5em) coordinate(NOv) -- (SO)--++(0,0.5em)coordinate(SOv); |
| 112 |
\path (NE) --++(0,-0.5em) coordinate(NEv) -- (SE)--++(0,0.5em)coordinate(SEv); |
| 113 |
|
| 114 |
\draw (NO) -- (NOh) -- (NOv) -- cycle; |
| 115 |
\draw (SO) -- (SOh) -- (SOv) -- cycle; |
| 116 |
\draw (NE) -- (NEh) -- (NEv) -- cycle; |
| 117 |
\draw (SE) -- (SEh) -- (SEv) -- cycle; |
| 118 |
|
| 119 |
\node (AX#2) at (X#2){}; |
| 120 |
\DecaleNoeudy[2.5]{X#2}{NoeudGraf} |
| 121 |
\node (VX#2) at (NoeudGraf) {}; |
| 122 |
} |
| 123 |
|
| 124 |
\newcommand{\LienActivation}[1]{ |
| 125 |
\DecaleNoeudx[-2]{#1}{LA} |
| 126 |
\node (LA#1) at (LA) {\textbf *}; |
| 127 |
} |
| 128 |
|
| 129 |
\newcommand{\EtapeActive}[1]{ |
| 130 |
\DecaleNoeudy[1]{#1}{EA} |
| 131 |
\node (EA#1) at (EA) {\textbullet}; |
| 132 |
} |
| 133 |
|
| 134 |
\newcommand{\CadreEncap}[4]{ |
| 135 |
\draw (#1) rectangle (#2); |
| 136 |
\DecaleNoeudx[3]{#1}{NumEtape} |
| 137 |
\node (NumEtape) at (NumEtape)[right,fill=white]{#3}{}; |
| 138 |
\DecaleNoeudx[-3]{#2}{NumEncap} |
| 139 |
\node (NumEncap) at (NumEncap)[left,fill=white]{#4}{}; |
| 140 |
} |
| 141 |
|
| 142 |
\newenvironment{Encap}[4][encapsulation] |
| 143 |
{\def\encap1{#1} |
| 144 |
\def\nometape{#3} |
| 145 |
\def\nomgraphe{#4} |
| 146 |
|
| 147 |
\matrix[matrix anchor=north west] (#1) at (#2) |
| 148 |
\bgroup |
| 149 |
\node(espace){};\\ |
| 150 |
\begin{scope} |
| 151 |
} |
| 152 |
{ |
| 153 |
\end{scope}\\ |
| 154 |
\egroup; |
| 155 |
\path (\encap1.north west) -- node[pos=0.3](nometape){\nometape} (\encap1.north east); |
| 156 |
\path (\encap1.south west) -- node[pos=0.3](nomgraphe){\nomgraphe} (\encap1.south east); |
| 157 |
\draw (nometape) -- (\encap1.east|-nometape) --++(0.5em,0)|- (nomgraphe); |
| 158 |
\draw (nometape) -- (\encap1.west|-nometape) --++(-0.5em,0)|- (nomgraphe); |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
\newcommand{\Comment}[3][0]{ |
| 165 |
\DecaleNoeudx[#1]{#2}{comm#2} |
| 166 |
\draw (comm#2) node[text width=15em,text justified,right]{\og\textit{ #3 }\fg}; |
| 167 |
} |
| 168 |
|
| 169 |
|
| 170 |
\newcommand{\Transition}[2][NoeudGraf]{ |
| 171 |
\node (NoeudGraf) at (#1) [minimum height=2.5em,minimum width=1em] (T#2) {}; |
| 172 |
\draw (T#2.west) -- (T#2.east); |
| 173 |
\draw (T#2.north) -- (T#2.south); |
| 174 |
\node (RT#2) at (T#2.east){}; |
| 175 |
\DecaleNoeudy[2.5]{T#2}{NoeudGraf} |
| 176 |
\node (VT#2) at (NoeudGraf) {}; |
| 177 |
} |
| 178 |
|
| 179 |
\newcommand{\TransitionSource}[2][NoeudGraf]{ |
| 180 |
\node (NoeudGraf) at (#1) [minimum height=2.5em,minimum width=1em] (T#2) {}; |
| 181 |
\draw (T#2.west) -- (T#2.east); |
| 182 |
\draw (T#2.base) -- (T#2.south); |
| 183 |
\node (RT#2) at (T#2.east){}; |
| 184 |
\DecaleNoeudy[2.5]{T#2}{NoeudGraf} |
| 185 |
\node (VT#2) at (NoeudGraf) {}; |
| 186 |
} |
| 187 |
|
| 188 |
\newcommand{\TransitionPuits}[2][NoeudGraf]{ |
| 189 |
\node (NoeudGraf) at (#1) [minimum height=2.5em,minimum width=1em] (T#2) {}; |
| 190 |
\draw (T#2.west) -- (T#2.east); |
| 191 |
\draw (T#2.north) -- (T#2.base); |
| 192 |
\node (RT#2) at (T#2.east){}; |
| 193 |
\DecaleNoeudy[2.5]{T#2}{NoeudGraf} |
| 194 |
\node (VT#2) at (NoeudGraf) {}; |
| 195 |
} |
| 196 |
|
| 197 |
\newcommand{\Action}[3][0]{ |
| 198 |
\foreach \x in {#3} |
| 199 |
{\node (NoeudGraf) at (A#2.east) [draw, rectangle, right,minimum height=2.5em, |
| 200 |
minimum width=2.5em] (A#2) {\x}; |
| 201 |
} |
| 202 |
} |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
\newcommand{\ActionFranchissement}[2]{ |
| 208 |
\draw (#1.center) -- ++ (1.5em,-2em) node[name=A#1]{} ; |
| 209 |
\node[draw, rectangle, right,minimum height=2.5em, minimum width=2.5em] (A#1) at (A#1) {#2}; |
| 210 |
} |
| 211 |
|
| 212 |
\newcommand{\ActionActiv}[1]{ |
| 213 |
\node (coin1) at (A#1.north west)[minimum size=1.5em]{}{}; |
| 214 |
%\draw [-triangle 90] (coin1.base) -- (coin1.north); |
| 215 |
\draw[fill] (coin1.base)--++(0,0.3em)--++(0.3em,0)--++(-0.3em,0.4em) --++(-0.3em,-0.4em)--++(0.3em,0); |
| 216 |
} |
| 217 |
\newcommand{\ActionDesactiv}[1]{ |
| 218 |
\node (coin1) at (A#1.south west)[minimum size=1.2em]{}{}; |
| 219 |
%\draw [-triangle 90] (coin1.base) -- (coin1.south); |
| 220 |
%\draw [-triangle 90] (coin1.base) -- (coin1.north); |
| 221 |
\draw[fill] (coin1.base)--++(0,-0.3em)--++(0.3em,0)--++(-0.3em,-0.4em) --++(-0.3em,+0.4em)--++(0.3em,0); |
| 222 |
} |
| 223 |
|
| 224 |
\newcommand{\ActionCond}[2]{ |
| 225 |
\node (coin1) at (A#1.north west)[minimum size=1.5em]{}; |
| 226 |
\draw (coin1.east) -- (coin1.north east)[name=vcond]; |
| 227 |
\node (cond) at (coin1.east) [above right]{\small{#2}}; |
| 228 |
} |
| 229 |
\newcommand{\ActionEvenement}[2]{ |
| 230 |
\node (coin1) at (A#1.north west)[minimum size=1.5em]{}; |
| 231 |
\node (coin2) at (coin1.north east) [minimum size=0.5em]{}; |
| 232 |
\node (coin2) at (coin2.south) [minimum size=0.5em]{}; |
| 233 |
\draw [fill] (coin1.east) -- (coin2.north)--(coin2.west)--(coin2.south); |
| 234 |
\node (cond) at (coin1.east) [above right]{#2}; |
| 235 |
|
| 236 |
} |
| 237 |
\newcommand{\ActionX}[3][2.5]{ |
| 238 |
\DecaleNoeudx[#1]{#2}{A#2}; |
| 239 |
\draw (#2) -- (A#2.east); |
| 240 |
\foreach \x in {#3} |
| 241 |
{\node (NoeudGraf) at (A#2.east) [draw, rectangle, right,minimum height=2.5em, |
| 242 |
minimum width=2.5em] (A#2) {\x}; |
| 243 |
} |
| 244 |
} |
| 245 |
\newcommand{\ActionXV}[3][2.5]{ |
| 246 |
\DecaleNoeudx[#1]{#2}{A#2}; |
| 247 |
\draw (#2) --coordinate[midway](LA#2)coordinate[midway](LA#2b) (A#2.east); |
| 248 |
\foreach \x in {#3} |
| 249 |
{\DecaleNoeudy[2.5]{A#2}{NA#2}; |
| 250 |
\draw(LA#2) |- (A#2.east); |
| 251 |
\node (NoeudGraf) at (A#2.east) [draw, rectangle,right,minimum height=2.5em, |
| 252 |
minimum width=2.5em] (A#2) {\x}; |
| 253 |
\DecaleNoeudy[0]{NA#2}{A#2} |
| 254 |
} |
| 255 |
} |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
\newcommand{\ActionEfface}[2][2.5]{ |
| 260 |
\DecaleNoeudx[#1]{#2}{A#2}; |
| 261 |
\draw [white] (#2) -- (A#2.east); |
| 262 |
{\node (NoeudGraf) at (A#2.east) [draw,fill, color=white ,rectangle, right,minimum height=2.5em, |
| 263 |
minimum width=2.5em] (A#2) { }; |
| 264 |
} |
| 265 |
} |
| 266 |
|
| 267 |
|
| 268 |
\newcommand{\Forcage}[3][0]{ |
| 269 |
\foreach \x in {#3} |
| 270 |
{\node (NoeudGraf) at (A#2.east) [draw, rectangle, right,minimum height=2.5em, |
| 271 |
minimum width=2.5em] (A#2) {\x}; |
| 272 |
\node (coin1) at (A#2.north west)[minimum size=0.1em]{}{}; |
| 273 |
\node (coin2) at (A#2.south east)[minimum size=0.1em]{}{}; |
| 274 |
\draw (coin1.south east) rectangle (coin2.north west); |
| 275 |
} |
| 276 |
} |
| 277 |
|
| 278 |
\newcommand{\ForcageX}[3][2.5]{ |
| 279 |
\DecaleNoeudx[#1]{#2}{A#2}; |
| 280 |
\draw (#2) -- (A#2.east); |
| 281 |
\foreach \x in {#3} |
| 282 |
{\node (noeudaction) at (A#2.east) [draw, rectangle, right,minimum height=2.5em, |
| 283 |
minimum width=2.5em] (A#2) {\x}; |
| 284 |
\node (coin1) at (A#2.north west)[minimum size=0.1em]{}{}; |
| 285 |
\node (coin2) at (A#2.south east)[minimum size=0.1em]{}{}; |
| 286 |
\draw (coin1.south east) rectangle (coin2.north west); |
| 287 |
} |
| 288 |
} |
| 289 |
|
| 290 |
|
| 291 |
\newcommand{\ForcageXV}[3][2.5]{ |
| 292 |
\DecaleNoeudx[#1]{#2}{A#2}; |
| 293 |
\draw (#2) --coordinate[midway](LA#2)coordinate[midway](LA#2b) (A#2.east); |
| 294 |
\foreach \x in {#3} |
| 295 |
{\DecaleNoeudy[2.5]{A#2}{NA#2}; |
| 296 |
\draw(LA#2) |- (A#2.east); |
| 297 |
\node (noeudaction) at (A#2.east) [draw, rectangle, right,minimum height=2.5em, |
| 298 |
minimum width=2.5em] (A#2) {\x}; |
| 299 |
\node (coin1) at (A#2.north west)[minimum size=0.1em]{}{}; |
| 300 |
\node (coin2) at (A#2.south east)[minimum size=0.1em]{}{}; |
| 301 |
\draw (coin1.south east) rectangle (coin2.north west); |
| 302 |
\DecaleNoeudy[0]{NA#2}{A#2}; |
| 303 |
} |
| 304 |
} |
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
\newcommand{\Recept}[2]{ |
| 310 |
\node (NoeudGraf) at (R#1.east) [right,minimum height=0em, |
| 311 |
minimum width=0em] (Rcp#1) {#2}; |
| 312 |
} |
| 313 |
|
| 314 |
\newcommand{\Recepts}[1]{ |
| 315 |
\foreach \trans / \receptivite in {#1}{ |
| 316 |
\Recept{T\trans}{\receptivite}; |
| 317 |
} |
| 318 |
} |
| 319 |
|
| 320 |
\newcommand{\TransitionRecept}[3][NoeudGraf]{ |
| 321 |
\Transition[#1]{#2} |
| 322 |
\Recept{T#2}{#3} |
| 323 |
} |
| 324 |
|
| 325 |
\newcommand{\Actions}[1]{ |
| 326 |
\foreach \etape / \action in {#1}{ |
| 327 |
\ActionX{X\etape}{\action}; |
| 328 |
} |
| 329 |
} |
| 330 |
|
| 331 |
\newcommand{\ActionRecept}[1]{ |
| 332 |
\foreach \etape / \action / \receptivite in {#1}{ |
| 333 |
\ifthenelse{\equal{\action}{}}{} |
| 334 |
{\ActionX{X\etape}{\action};} |
| 335 |
\Recept{T\etape}{\receptivite}; |
| 336 |
} |
| 337 |
} |
| 338 |
|
| 339 |
|
| 340 |
\newcommand{\EtapeAction}[3][NoeudGraf]{ |
| 341 |
\Etape[#1]{#2} |
| 342 |
\ifthenelse{\equal{#3}{}}{} |
| 343 |
{\ActionX{X#2}{#3}} |
| 344 |
} |
| 345 |
|
| 346 |
\newcommand{\EtapeInitAction}[3][NoeudGraf]{ |
| 347 |
\EtapeInit[#1]{#2} |
| 348 |
\ifthenelse{\equal{#3}{}}{} |
| 349 |
{\ActionX{X#2}{#3}} |
| 350 |
} |
| 351 |
|
| 352 |
\newcommand{\EtapeTransition}[4][NoeudGraf]{ |
| 353 |
\Etape[#1]{#2} |
| 354 |
\ifthenelse{\equal{#3}{}}{} |
| 355 |
{\ActionX{X#2}{#3}} |
| 356 |
\Transition{#2} |
| 357 |
\Recept{T#2}{#4} |
| 358 |
} |
| 359 |
|
| 360 |
\newcommand{\EtapeInitTransition}[4][NoeudGraf]{ |
| 361 |
\EtapeInit[#1]{#2} |
| 362 |
\ifthenelse{\equal{#3}{}}{} |
| 363 |
{\ActionX{X#2}{#3}} |
| 364 |
\Transition{#2} |
| 365 |
\Recept{T#2}{#4} |
| 366 |
} |
| 367 |
|
| 368 |
|
| 369 |
\newcommand{\SequenceET}[2][NoeudGraf]{ |
| 370 |
\node (NoeudGraf) at (#1) {}; |
| 371 |
\foreach \x in {#2} |
| 372 |
{\Etape[NoeudGraf]{\x} |
| 373 |
\DecaleNoeudy[2.5]{X\x}{NoeudGraf} |
| 374 |
\Transition[NoeudGraf]{\x} |
| 375 |
\DecaleNoeudy[2.5]{T\x}{NoeudGraf} |
| 376 |
\node (VT\x) at (NoeudGraf) {}; |
| 377 |
} |
| 378 |
} |
| 379 |
|
| 380 |
\newcommand{\SequenceTT}[3][NoeudGraf]{ |
| 381 |
\node (NoeudGraf) at (#1) {}; |
| 382 |
\Transition[NoeudGraf]{#2} |
| 383 |
\DecaleNoeudy[2.5]{T#2}{NoeudGraf} |
| 384 |
\foreach \x in {#3} |
| 385 |
{\Etape[NoeudGraf]{\x} |
| 386 |
\DecaleNoeudy[2.5]{X\x}{NoeudGraf} |
| 387 |
\Transition[NoeudGraf]{\x} |
| 388 |
\node (Ts) at (T\x) [minimum height=2.5em,minimum width=1em]{}; |
| 389 |
\DecaleNoeudy[2.5]{T\x}{NoeudGraf} |
| 390 |
\node (VT\x) at (NoeudGraf) {}; |
| 391 |
\node (VTs) at (VT\x) [minimum height=2.5em,minimum width=1em]{}; |
| 392 |
} |
| 393 |
} |
| 394 |
|
| 395 |
\newcommand{\SequenceTE}[4][NoeudGraf]{ |
| 396 |
\node (NoeudGraf) at (#1) {}; |
| 397 |
\Transition[NoeudGraf]{#2} |
| 398 |
\SequenceEE{#3}{#4} |
| 399 |
} |
| 400 |
|
| 401 |
|
| 402 |
\newcommand{\SequenceEE}[3][NoeudGraf]{ |
| 403 |
\node (NoeudGraf) at (#1) {}; |
| 404 |
\foreach \x in {#2} |
| 405 |
{\Etape[NoeudGraf]{\x} |
| 406 |
\DecaleNoeudy[2.5]{X\x}{NoeudGraf} |
| 407 |
\Transition[NoeudGraf]{\x} |
| 408 |
\DecaleNoeudy[2.5]{T\x}{NoeudGraf} |
| 409 |
\node (VT\x) at (NoeudGraf) {}; |
| 410 |
} |
| 411 |
\Etape[NoeudGraf]{#3} |
| 412 |
\DecaleNoeudy[2.5]{X#3}{NoeudGraf} |
| 413 |
\node (VX#3) at (NoeudGraf) {}; |
| 414 |
} |
| 415 |
|
| 416 |
|
| 417 |
\newcommand{\Graphe}[2][NoeudGraf]{ |
| 418 |
\node (NoeudGraf) at (#1) {}; |
| 419 |
\node (debut) at (#1)[minimum size=2.5em] {}; |
| 420 |
\foreach \x / \y / \z in {#2}{ |
| 421 |
\Etape[NoeudGraf]{\x} |
| 422 |
\DecaleNoeudy[2.5]{X\x}{NoeudGraf} |
| 423 |
\Transition[NoeudGraf]{\x} |
| 424 |
\DecaleNoeudy[2.5]{T\x}{NoeudGraf} |
| 425 |
} |
| 426 |
\ActionRecept{#2} |
| 427 |
} |
| 428 |
\newcommand{\GrapheBoucle}[2][NoeudGraf]{ |
| 429 |
\node (NoeudGraf) at (#1) {}; |
| 430 |
\node (debutgraphe) at (#1)[minimum size=2.5em] {}; |
| 431 |
\foreach \x / \y / \z in {#2}{ |
| 432 |
\Etape[NoeudGraf]{\x} |
| 433 |
\DecaleNoeudy[2.5]{X\x}{NoeudGraf} |
| 434 |
\Transition[NoeudGraf]{\x} |
| 435 |
\node (fingraphe) at (T\x)[minimum size=2.5em] {}; |
| 436 |
\DecaleNoeudy[2.5]{T\x}{NoeudGraf} |
| 437 |
} |
| 438 |
\ActionRecept{#2} |
| 439 |
\LienRetour{fingraphe}{debutgraphe} |
| 440 |
} |
| 441 |
|
| 442 |
\newcommand{\SautEtapes}[4][-5]{ |
| 443 |
\DivOU{#2}{#1/L#2s,2/L#2} |
| 444 |
\Transition[L#2s]{#2s} |
| 445 |
\SequenceTT[L#2]{#2}{#3} |
| 446 |
\DecaleNoeudy[-2.5]{NoeudGraf}{VNoeudGraf} |
| 447 |
\ConvOU[-2]{Ts}{T#2s}{#4} |
| 448 |
} |
| 449 |
|
| 450 |
\newcommand{\RepriseEtapes}[4][-5]{ |
| 451 |
\DecaleNoeudx[#1]{#2}{#2r} |
| 452 |
\DecaleNoeudx[-1]{#2r}{#2r} |
| 453 |
\DecaleNoeudx[#1]{V#2}{V#2r} |
| 454 |
\DecaleNoeudx[-1]{V#2r}{V#2r} |
| 455 |
\node(V#2r) at (V#2r) [minimum height=2.5em,minimum width=1em,rectangle]{}; |
| 456 |
\ConvOU[-1]{#2}{#2r}{noeudreprise} |
| 457 |
\SequenceEE[noeudreprise]{#3}{#4} |
| 458 |
\DivOU{X#4}{#1/L#4r,1/L#4} |
| 459 |
\Transition[L#4]{#4} |
| 460 |
\Transition[L#4r]{#4r} |
| 461 |
\LienRetour[2]{T#4r}{V#2r} |
| 462 |
} |
| 463 |
|
| 464 |
\newcommand{\DivET}[2]{ |
| 465 |
\node (div1) at (#1)[minimum height=2.5em,minimum width=1em]{}; |
| 466 |
\draw (div1.base) -- (div1.south){}; |
| 467 |
\DecaleNoeudy[2.5]{#1}{div1} |
| 468 |
\foreach \x / \y in {#2} { |
| 469 |
\DecaleNoeudx[\x]{div1}{div2} |
| 470 |
\node (V\y) at (div2)[minimum height=2.5em,minimum width=1em]{}; |
| 471 |
\draw (V\y.base) -- (V\y.north); |
| 472 |
\draw [double distance=0.15em,thick] (div1.north) -- (V\y.north east) --(V\y.north west) {}{}; |
| 473 |
\node (\y) at (V\y){}[minimum size=0]; |
| 474 |
\node (V\y) at (V\y.south){}; |
| 475 |
} |
| 476 |
} |
| 477 |
|
| 478 |
\newcommand{\BrancheOU}[2][0]{ |
| 479 |
\node[below of=V#2,node distance=1 em,minimum height=2.5em,minimum width=1em](NoeudGraf){}; |
| 480 |
\node [right of=NoeudGraf, node distance=#1 em,minimum height=2.5em,minimum width=1em] (NoeudGraf){}; |
| 481 |
\draw (#2.south) -- ++(0,-0.5em) -| (NoeudGraf); |
| 482 |
} |
| 483 |
|
| 484 |
\newcommand{\FinBrancheOU}[3][0]{ |
| 485 |
\ifthenelse{\equal{CountB}{}}{ |
| 486 |
\node[below of=V#3,node distance=2 em,minimum height=2.5em,minimum width=1em](NoeudGraf){}; |
| 487 |
\node [right of=NoeudGraf, node distance=#1 em,minimum height=2.5em,minimum width=1em] (NoeudGraf){}; |
| 488 |
\draw (#3.south) -- ++(0,-0.5em) -| (NoeudGraf);} |
| 489 |
{ aaa} |
| 490 |
} |
| 491 |
|
| 492 |
\newcommand{\FinBrancheOUa}[3][0]{ |
| 493 |
\newboolean{TestBoucle} |
| 494 |
\ifthenelse{\boolean{TestBoucle}{true}}{\draw(T53) -- (#3);}{ |
| 495 |
\node[below of=V#2,node distance=2 em,minimum height=2.5em,minimum width=1em](NoeudGraf){}; |
| 496 |
\node [right of=NoeudGraf, node distance=#1 em,minimum height=2.5em,minimum width=1em] (NoeudGraf){}; |
| 497 |
\node[minimum height=2.5em,minimum width=1em] (#3) at (NoeudGraf){}; |
| 498 |
\draw (#2.south) -- ++(0,-0.5em) -| (NoeudGraf); |
| 499 |
with: |
| 500 |
\setboolean{TestBoucle}{true} |
| 501 |
} |
| 502 |
|
| 503 |
} |
| 504 |
|
| 505 |
|
| 506 |
\newcommand{\DivOU}[2]{ |
| 507 |
\node (div1) at (V#1)[minimum height=2.5em,minimum width=1em]{}; |
| 508 |
\draw (div1.base) -- (div1.north) {}{}; |
| 509 |
\foreach \x / \y in {#2} { |
| 510 |
\DecaleNoeudx[\x]{div1}{div2} |
| 511 |
\node (div2) at (div2)[minimum height=2.5em,minimum width=1em]{}; |
| 512 |
\node (\y) at (div2)[minimum height=2.5em,minimum width=1em]{}; |
| 513 |
\draw (div1.base) -- (\y.east) --(\y.west) {}{}; |
| 514 |
\node (\y) at (div2.south)[minimum height=2.5em,minimum width=1em]{}; |
| 515 |
\draw(\y.base)--(\y.north){}{}; |
| 516 |
} |
| 517 |
} |
| 518 |
|
| 519 |
|
| 520 |
\newcommand{\ConvET}[4][0]{ |
| 521 |
\node (div) at (#2) [minimum height=2.5em,minimum width=1em]{}; |
| 522 |
\DecaleNoeudy[2.5]{div}{div} |
| 523 |
\foreach \x in {#3}{ |
| 524 |
\draw (#2) -- (div.base) -| (\x);\node (int\x) at (div.base -|\x) {}; |
| 525 |
} |
| 526 |
\DecaleNoeudx[#1]{div}{#4} |
| 527 |
\DecaleNoeudy[1.5]{#4}{#4} |
| 528 |
\draw (#4.base) |- (div.base); |
| 529 |
\foreach \x in {#3}{ |
| 530 |
\draw [double distance=0.15em,thick](int\x.east) -- (int\x.west); |
| 531 |
\draw [double distance=0.15em,thick](int\x.east) -- (div.east); |
| 532 |
} |
| 533 |
\draw [double distance=0.15em,thick](div.west) -- (div.east); |
| 534 |
} |
| 535 |
|
| 536 |
|
| 537 |
\newcommand{\ConvOU}[4][0]{ |
| 538 |
\node (div#2) at (#2.base)[minimum height=2.5em,minimum width=1em]{}; |
| 539 |
\DecaleNoeudx[0]{div#2}{div#2} |
| 540 |
\DecaleNoeudy[1.3]{div#2}{div} |
| 541 |
\DecaleNoeudx[#1]{V#2}{#4} |
| 542 |
\foreach \x in {#3} { |
| 543 |
\draw (div.base)--(div.east)--(div.west) -| (\x.base); |
| 544 |
\node (divi) at (div.west -| \x.base) [minimum width=1em,minimum height=2.5em]{}; |
| 545 |
\draw (divi.west) -- (divi.east); |
| 546 |
} |
| 547 |
\DecaleNoeudy[1.5]{#4}{#4} |
| 548 |
\draw (div#2.base)--(div.base)-|(#4.north); |
| 549 |
} |
| 550 |
|
| 551 |
\newcommand{\DecaleNoeudx}[3][0]{ |
| 552 |
\node [right of=#2, node distance=#1em](#3) {}; |
| 553 |
\node (#3) at (#3) [rectangle,minimum height=2.5em,minimum width=1em]{}; |
| 554 |
} |
| 555 |
\newcommand{\DecaleNoeudy}[3][0]{ |
| 556 |
\node [below of=#2, node distance=#1em](#3) {}; |
| 557 |
\node (#3) at (#3) [rectangle,minimum height=2.5em,minimum width=1em]{}; |
| 558 |
} |
| 559 |
|
| 560 |
|
| 561 |
\newcommand{\LienRetour}{\@ifstar\LienRetourUp\LienRetourN} |
| 562 |
|
| 563 |
\newcommand{\LienRetourN}[3][4]{ |
| 564 |
\node [left of=#2, node distance=#1em, minimum size=0cm](retourb#2) {}; |
| 565 |
\node [above of=#3, node distance=2.5em, minimum size=0cm](retourh#2) {}; |
| 566 |
%\DecaleNoeudx[-#1]{retourh#2}{retourh#2} |
| 567 |
\draw[->,>=latex'](#2.base)--(#2.south)-|(retourb#2.north)--(retourb#2|-#3)|-(retourh#2.base)-| (#3.north); |
| 568 |
} |
| 569 |
|
| 570 |
\newcommand{\LienRetourUp}[4][4]{ |
| 571 |
\node [left of=#2, node distance=#1em, minimum size=0cm](retourb#2) {}; |
| 572 |
\node [above of=#3, node distance=#4em, minimum size=0cm](retourh#2) {}; |
| 573 |
%\DecaleNoeudx[-#1]{retourh#2}{retourh#2} |
| 574 |
\draw[->,>=latex'](#2.base)--(#2.south)-|(retourb#2.north)--(retourb#2|-#3)|-(retourh#2.base)-| (#3.north); |
| 575 |
} |
| 576 |
|
| 577 |
\newcommand{\LienRetoura}[3][4]{ |
| 578 |
\node [left of=#3, node distance=#1em, minimum size=0cm](retourb#2) {}; |
| 579 |
\node [above of=retourb#2, node distance=2.5em, minimum size=0cm](retourh#2) {}; |
| 580 |
%\DecaleNoeudx[-#1]{retourh#2}{retourh#2} |
| 581 |
\draw [->,>=latex'] (#2.base)--(#2.south)-| (retourh#2.base) -| node[name=#2-#3,near end,right] {} (#3.north) ; |
| 582 |
} |
| 583 |
|
| 584 |
\newcommand{\Lien}[4][0]{ |
| 585 |
\node [above of=#4, node distance=2.5em, minimum size=0cm](retourh#3) {}; |
| 586 |
\DecaleNoeudy[#1]{retourh#3}{retourh#3} |
| 587 |
\draw [->,>=latex'] (#2.base) -- (#2.south) -| (#3.base) |- (retourh#3.base) -- (#4.north); |
| 588 |
} |
| 589 |
|
| 590 |
\newcommand{\Lieny[2]}[2.5]{ |
| 591 |
\DecaleNoeudy[#1]{#2}{V#2} |
| 592 |
\draw (#2.base) -- (V#2.base) {}; |
| 593 |
\DecaleNoeudy[#1]{#2}{#2} |
| 594 |
} |
| 595 |
\newcommand{\LienET[2]}[2.5]{ |
| 596 |
\DecaleNoeudy[#1]{#2}{V#2} |
| 597 |
\draw (#2) -- (V#2.base) {}; |
| 598 |
} |
| 599 |
\newcommand{\LienTE[2]}[2.5]{ |
| 600 |
\DecaleNoeudy[#1]{#2}{V#2} |
| 601 |
\draw (#2.base) -- (V#2) {}; |
| 602 |
} |
| 603 |
|
| 604 |
|
| 605 |
\newcommand{\LienRetourOU}[3][4]{ |
| 606 |
\coordinate [left of=#2, node distance=#1em, minimum size=0cm](retourb#2) {}; |
| 607 |
\coordinate [above of=#3, node distance=3.5em, minimum size=0cm](retourh#2) {}; |
| 608 |
\coordinate [above of=#3, node distance=2.5em, minimum size=0cm](retourh#3) {}; |
| 609 |
%\DecaleNoeudx[-#1]{retourh#2}{retourh#2} |
| 610 |
\draw (#2.base) -- (#2.south) -| (retourb#2) -- (retourb#2 |- #3)coordinate[pos=0.5,name=df]coordinate[pos=0.55,name=ff] |- |
| 611 |
(retourh#2-|#2) -- (retourh#3 -|#2) --++(-0.5em,0) -++ (1em,0) -|(#3.north) ; |
| 612 |
\draw[-latex] (df) -- (ff) ; |
| 613 |
} |
| 614 |
|
| 615 |
|
| 616 |
\newcommand{\EspaceV}[2][2.5]{ |
| 617 |
\node[below of=V#2,node distance=#1 em,minimum height=2.5em,minimum width=1em](NoeudGraf){}; |
| 618 |
\draw (#2.south) -- (NoeudGraf); |
| 619 |
\node[minimum height=2.5em,minimum width=1em] (V#2) at (NoeudGraf){}; |
| 620 |
} |