Téléverser les fichiers vers "arduino_proto_threads/tp_dragon"

Ajout tp du Dragon
This commit is contained in:
2026-10-24 04:37:27 +11:00
parent 804527145a
commit f2dbe1fedc
4 changed files with 468 additions and 0 deletions
@@ -0,0 +1,71 @@
digraph finite_state_machine {
overlap=false
fontname="Arial"
fontsize=50;
label="\nÉtats pour l'animation du dragon."
rankdir=LR; // bgcolor="#C6CFD532"; // transparent
edge[style="filled,setlinewidth(4)",fontsize=30];
node[style="setlinewidth(4)",color="#000000",fontsize=30];
pad=0.2 // margins / clusters
nodesep=1.2
ranksep=2.2
//center=true
subgraph clusterInternal {
fontsize=40;
label="\nVue interne du sous ensemble { Attente - Animations }\n\n"
style=filled color = "#FFC0A0"
// margin=10 # in points
TMD [label="\nMode Dégradé\n?",fillcolor="#DDDDDD",shape=diamond,style=filled]
ABP [label="Attente\nde l'appui\nbouton\n",fillcolor="#A0FFFF",shape=circle,style=filled]
node [shape=circle,style=filled];
R1 [label="Attente\nfin\nanimation",fillcolor="red:#FD4030",style=radial] // lightred
J1 [label="Attente\nfin\nanimation",fillcolor="#FFF030"] ; // lightyellow
B1 [label="Attente\nfin\nanimation",fillcolor="#70A0FF"] ; // lightblue
VMN [label="Affiche\nluminosité\ncourante",fillcolor="#80ff80:green"];
VMD [label="Clignote\nà\n1 Hertz",fillcolor="#80ff80:black",style=radial];
FB [style=invis]
{ rank = min ABP VMD }
{ rank = max J1 }
{ rank = same B1 VMN }
{ rank = same R1 FB TMD }
// n e s w for top right bottom left
ABP -> TMD:n [label="Vérification du mode"]; // n for nord (top),
ABP -> R1 [label="Animation Led Rouge"];
TMD:w -> VMD [label="Active clignotement Led Verte",taillabel="Oui"];
TMD:ne -> B1 [label="Animation Led Bleue",taillabel="Non"];
TMD:e -> J1 [label="Animation Led Jaune",taillabel="Non"];
TMD:se -> VMN [label="Baisse luminosité Led Verte",taillabel="Non"];
// TMD:nw -> ABP [label="Mode dégradé",decorate=true,taillabel="Oui"];
R1 -> ABP [label = "Fin animation"];
J1 -> ABP [label = "Fin animation"];
B1 -> ABP [label = "Fin animation"];
// R1 -> J1 [style=invis] //,constraint=false]
B1 -> J1 [style=invis] //,constraint=false]
// TMD:s -> FB // [style=invis] //,constraint=false]
} // clusterD
subgraph clusterGlobal {
fontsize=40; label="\nVue synthétique\n\n" style=filled color = "#A0FFFF"
node [shape = doublecircle, style = filled, fillcolor="#000000"]; On Off ;
# node [shape = doublecircle, style = filled, fillcolor="#E890F0"]; On Off ;
node [shape = circle, style = filled, fillcolor="#FFC0A0"]; Wait Show ;
Off [label="\nOff\n\n",fontname="Arial",fontsize="30",fillcolor="#E890F0"]
// On [label="\nOn\n\n",fontname="Arial",fontsize="30"]
{ rank = min On }
{ rank = max Off }
Wait [ label = "Attente\nd'un appui\nbouton\nCycle=Faux" ];
Show [ label = "Attente\nfin des\nanimations\nCycle=vrai" ];
On -> Wait [ label = "Mise\nsous\ntension"];
Wait -> Show [ label = "Animation"];
Show -> Wait [ label = "Fin animation"];
Show -> Off [ label = "Mise\nhors\ntension"];
Show -> Wait [ label = "Ré-initialisation"];
Wait -> Wait [ label = "Ré-initialisation"];
Wait -> Off [ label = "Mise\nhors\ntension"];
} // clusterGlobal
} //finite_state_machine
+253
View File
@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: finite_state_machine Pages: 1 -->
<svg width="2829pt" height="2048pt"
viewBox="0.00 0.00 2828.80 2047.80" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(14.4 2033.4)">
<title>finite_state_machine</title>
<polygon fill="white" stroke="transparent" points="-14.4,14.4 -14.4,-2033.4 2814.4,-2033.4 2814.4,14.4 -14.4,14.4"/>
<text text-anchor="middle" x="1400" y="-19" font-family="Arial" font-size="50.00">États pour l&#39;animation du dragon.</text>
<g id="clust1" class="cluster">
<title>clusterInternal</title>
<polygon fill="#ffc0a0" stroke="#ffc0a0" points="8,-131 8,-1304 2792,-1304 2792,-131 8,-131"/>
<text text-anchor="middle" x="1400" y="-1220" font-family="Arial" font-size="40.00">Vue interne du sous ensemble { Attente &#45; Animations }</text>
</g>
<g id="clust6" class="cluster">
<title>clusterGlobal</title>
<polygon fill="#a0ffff" stroke="#a0ffff" points="79.66,-1312 79.66,-2011 2755.7,-2011 2755.7,-1312 79.66,-1312"/>
<text text-anchor="middle" x="1417.68" y="-1927" font-family="Arial" font-size="40.00">Vue synthétique</text>
</g>
<!-- TMD -->
<g id="node1" class="node">
<title>TMD</title>
<polygon fill="#dddddd" stroke="#000000" points="1120.59,-529 876.59,-419 1120.59,-309 1364.59,-419 1120.59,-529"/>
<text text-anchor="middle" x="1120.59" y="-410" font-family="Times,serif" font-size="30.00">Mode Dégradé</text>
<text text-anchor="middle" x="1120.59" y="-377" font-family="Times,serif" font-size="30.00">?</text>
</g>
<!-- J1 -->
<g id="node4" class="node">
<title>J1</title>
<ellipse fill="#fff030" stroke="#000000" cx="2663.8" cy="-800" rx="120.42" ry="120.42"/>
<text text-anchor="middle" x="2663.8" y="-825.5" font-family="Times,serif" font-size="30.00">Attente</text>
<text text-anchor="middle" x="2663.8" y="-792.5" font-family="Times,serif" font-size="30.00">fin</text>
<text text-anchor="middle" x="2663.8" y="-759.5" font-family="Times,serif" font-size="30.00">animation</text>
</g>
<!-- TMD&#45;&gt;J1 -->
<g id="edge5" class="edge">
<title>TMD:e&#45;&gt;J1</title>
<path fill="none" stroke="black" stroke-width="4" d="M1364.59,-419C1776.43,-419 1883.4,-469.28 2272.59,-604 2370.34,-637.84 2474.75,-691.29 2550.94,-733.83"/>
<polygon fill="black" stroke="black" stroke-width="4" points="2549.66,-737.12 2560.09,-738.96 2553.08,-731.02 2549.66,-737.12"/>
<text text-anchor="middle" x="2111.59" y="-613" font-family="Times,serif" font-size="30.00">Animation Led Jaune</text>
<text text-anchor="middle" x="1396.59" y="-395" font-family="Times,serif" font-size="30.00">Non</text>
</g>
<!-- B1 -->
<g id="node5" class="node">
<title>B1</title>
<ellipse fill="#70a0ff" stroke="#000000" cx="2111.59" cy="-800" rx="120.42" ry="120.42"/>
<text text-anchor="middle" x="2111.59" y="-825.5" font-family="Times,serif" font-size="30.00">Attente</text>
<text text-anchor="middle" x="2111.59" y="-792.5" font-family="Times,serif" font-size="30.00">fin</text>
<text text-anchor="middle" x="2111.59" y="-759.5" font-family="Times,serif" font-size="30.00">animation</text>
</g>
<!-- TMD&#45;&gt;B1 -->
<g id="edge4" class="edge">
<title>TMD:ne&#45;&gt;B1</title>
<path fill="none" stroke="black" stroke-width="4" d="M1195.59,-495C1198.26,-497.67 1194.11,-526.14 1196.59,-529 1246.45,-586.51 1800.68,-618.33 1871.59,-646 1919.23,-664.59 1967.46,-693.36 2008,-721.02"/>
<polygon fill="black" stroke="black" stroke-width="4" points="2006.04,-723.93 2016.26,-726.72 2010.02,-718.16 2006.04,-723.93"/>
<text text-anchor="middle" x="1657.59" y="-655" font-family="Times,serif" font-size="30.00">Animation Led Bleue</text>
<text text-anchor="middle" x="1163.59" y="-471" font-family="Times,serif" font-size="30.00">Non</text>
</g>
<!-- VMN -->
<g id="node6" class="node">
<title>VMN</title>
<defs>
<linearGradient id="l_0" gradientUnits="userSpaceOnUse" x1="1986.27" y1="-264" x2="2236.9" y2="-264" >
<stop offset="0" style="stop-color:#80ff80;stop-opacity:1.;"/>
<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
</linearGradient>
</defs>
<ellipse fill="url(#l_0)" stroke="#000000" cx="2111.59" cy="-264" rx="125.32" ry="125.32"/>
<text text-anchor="middle" x="2111.59" y="-289.5" font-family="Times,serif" font-size="30.00">Affiche</text>
<text text-anchor="middle" x="2111.59" y="-256.5" font-family="Times,serif" font-size="30.00">luminosité</text>
<text text-anchor="middle" x="2111.59" y="-223.5" font-family="Times,serif" font-size="30.00">courante</text>
</g>
<!-- TMD&#45;&gt;VMN -->
<g id="edge6" class="edge">
<title>TMD:se&#45;&gt;VMN</title>
<path fill="none" stroke="black" stroke-width="4" d="M1197.59,-343C1303.68,-236.91 1748.99,-244.26 1976.12,-255.48"/>
<polygon fill="black" stroke="black" stroke-width="4" points="1976.27,-259 1986.43,-256 1976.62,-252 1976.27,-259"/>
<text text-anchor="middle" x="1657.59" y="-271" font-family="Times,serif" font-size="30.00">Baisse luminosité Led Verte</text>
<text text-anchor="middle" x="1165.59" y="-319" font-family="Times,serif" font-size="30.00">Non</text>
</g>
<!-- VMD -->
<g id="node7" class="node">
<title>VMD</title>
<defs>
<radialGradient id="r_0" cx="50%" cy="50%" r="75%" fx="50%" fy="50%">
<stop offset="0" style="stop-color:#80ff80;stop-opacity:1.;"/>
<stop offset="1" style="stop-color:black;stop-opacity:1.;"/>
</radialGradient>
</defs>
<ellipse fill="url(#r_0)" stroke="#000000" cx="134.79" cy="-419" rx="103.48" ry="103.48"/>
<text text-anchor="middle" x="134.79" y="-444.5" font-family="Times,serif" font-size="30.00">Clignote</text>
<text text-anchor="middle" x="134.79" y="-411.5" font-family="Times,serif" font-size="30.00">à</text>
<text text-anchor="middle" x="134.79" y="-378.5" font-family="Times,serif" font-size="30.00">1 Hertz</text>
</g>
<!-- TMD&#45;&gt;VMD -->
<g id="edge3" class="edge">
<title>TMD:w&#45;&gt;VMD</title>
<path fill="none" stroke="black" stroke-width="4" d="M876.59,-419C653.97,-419 393.72,-419 248.51,-419"/>
<polygon fill="black" stroke="black" stroke-width="4" points="248.25,-415.5 238.25,-419 248.25,-422.5 248.25,-415.5"/>
<text text-anchor="middle" x="565.09" y="-428" font-family="Times,serif" font-size="30.00">Active clignotement Led Verte</text>
<text text-anchor="middle" x="849.09" y="-395" font-family="Times,serif" font-size="30.00">Oui</text>
</g>
<!-- ABP -->
<g id="node2" class="node">
<title>ABP</title>
<ellipse fill="#a0ffff" stroke="#000000" cx="134.79" cy="-816" rx="118.59" ry="118.59"/>
<text text-anchor="middle" x="134.79" y="-841.5" font-family="Times,serif" font-size="30.00">Attente</text>
<text text-anchor="middle" x="134.79" y="-808.5" font-family="Times,serif" font-size="30.00">de l&#39;appui</text>
<text text-anchor="middle" x="134.79" y="-775.5" font-family="Times,serif" font-size="30.00">bouton</text>
</g>
<!-- ABP&#45;&gt;TMD -->
<g id="edge1" class="edge">
<title>ABP&#45;&gt;TMD:n</title>
<path fill="none" stroke="black" stroke-width="4" d="M215.91,-728.49C249.02,-697.57 289.69,-665.64 332.59,-646 370.54,-628.62 1038.15,-580.18 1113.66,-537.6"/>
<polygon fill="black" stroke="black" stroke-width="4" points="1116.43,-539.75 1120.59,-530 1111.26,-535.03 1116.43,-539.75"/>
<text text-anchor="middle" x="565.09" y="-655" font-family="Times,serif" font-size="30.00">Vérification du mode</text>
</g>
<!-- R1 -->
<g id="node3" class="node">
<title>R1</title>
<defs>
<radialGradient id="r_1" cx="50%" cy="50%" r="75%" fx="50%" fy="50%">
<stop offset="0" style="stop-color:red;stop-opacity:1.;"/>
<stop offset="1" style="stop-color:#fd4030;stop-opacity:1.;"/>
</radialGradient>
</defs>
<ellipse fill="url(#r_1)" stroke="#000000" cx="1120.59" cy="-940" rx="120.42" ry="120.42"/>
<text text-anchor="middle" x="1120.59" y="-965.5" font-family="Times,serif" font-size="30.00">Attente</text>
<text text-anchor="middle" x="1120.59" y="-932.5" font-family="Times,serif" font-size="30.00">fin</text>
<text text-anchor="middle" x="1120.59" y="-899.5" font-family="Times,serif" font-size="30.00">animation</text>
</g>
<!-- ABP&#45;&gt;R1 -->
<g id="edge2" class="edge">
<title>ABP&#45;&gt;R1</title>
<path fill="none" stroke="black" stroke-width="4" d="M252.31,-797.33C385.64,-779.61 609.82,-760.95 797.59,-800 869.97,-815.05 946.03,-847.26 1006.05,-877"/>
<polygon fill="black" stroke="black" stroke-width="4" points="1004.65,-880.21 1015.16,-881.55 1007.78,-873.95 1004.65,-880.21"/>
<text text-anchor="middle" x="565.09" y="-809" font-family="Times,serif" font-size="30.00">Animation Led Rouge</text>
</g>
<!-- R1&#45;&gt;ABP -->
<g id="edge7" class="edge">
<title>R1&#45;&gt;ABP</title>
<path fill="none" stroke="black" stroke-width="4" d="M1000.65,-928.54C846.3,-913.18 568.77,-883.88 332.59,-850 309.69,-846.72 285.36,-842.83 261.9,-838.89"/>
<polygon fill="black" stroke="black" stroke-width="4" points="262.35,-835.42 251.91,-837.2 261.18,-842.32 262.35,-835.42"/>
<text text-anchor="middle" x="565.09" y="-914" font-family="Times,serif" font-size="30.00">Fin animation</text>
</g>
<!-- J1&#45;&gt;ABP -->
<g id="edge8" class="edge">
<title>J1&#45;&gt;ABP</title>
<path fill="none" stroke="black" stroke-width="4" d="M2555.58,-853.11C2478.57,-889.18 2371.35,-935.2 2272.59,-963 1672.35,-1131.93 1494.93,-1183.45 876.59,-1103 628.57,-1070.73 558.49,-1066.34 332.59,-959 298.59,-942.85 264.42,-920.61 234.3,-898.48"/>
<polygon fill="black" stroke="black" stroke-width="4" points="236.04,-895.41 225.92,-892.25 231.86,-901.02 236.04,-895.41"/>
<text text-anchor="middle" x="1657.59" y="-1146" font-family="Times,serif" font-size="30.00">Fin animation</text>
</g>
<!-- B1&#45;&gt;ABP -->
<g id="edge9" class="edge">
<title>B1&#45;&gt;ABP</title>
<path fill="none" stroke="black" stroke-width="4" d="M1992.55,-782.07C1705.88,-741.74 950.98,-654.95 332.59,-755 307.57,-759.05 281.33,-765.53 256.46,-772.78"/>
<polygon fill="black" stroke="black" stroke-width="4" points="255.22,-769.5 246.63,-775.71 257.21,-776.21 255.22,-769.5"/>
<text text-anchor="middle" x="1120.59" y="-727" font-family="Times,serif" font-size="30.00">Fin animation</text>
</g>
<!-- B1&#45;&gt;J1 -->
<!-- FB -->
<!-- On -->
<g id="node9" class="node">
<title>On</title>
<ellipse fill="#000000" stroke="#000000" cx="134.79" cy="-1598" rx="43.26" ry="43.26"/>
<ellipse fill="none" stroke="#000000" cx="134.79" cy="-1598" rx="47.27" ry="47.27"/>
<text text-anchor="middle" x="134.79" y="-1590.5" font-family="Times,serif" font-size="30.00">On</text>
</g>
<!-- Wait -->
<g id="node11" class="node">
<title>Wait</title>
<ellipse fill="#ffc0a0" stroke="#000000" cx="1120.59" cy="-1598" rx="141.34" ry="141.34"/>
<text text-anchor="middle" x="1120.59" y="-1640" font-family="Times,serif" font-size="30.00">Attente</text>
<text text-anchor="middle" x="1120.59" y="-1607" font-family="Times,serif" font-size="30.00">d&#39;un appui</text>
<text text-anchor="middle" x="1120.59" y="-1574" font-family="Times,serif" font-size="30.00">bouton</text>
<text text-anchor="middle" x="1120.59" y="-1541" font-family="Times,serif" font-size="30.00">Cycle=Faux</text>
</g>
<!-- On&#45;&gt;Wait -->
<g id="edge11" class="edge">
<title>On&#45;&gt;Wait</title>
<path fill="none" stroke="black" stroke-width="4" d="M182.25,-1598C321.77,-1598 741.43,-1598 968.97,-1598"/>
<polygon fill="black" stroke="black" stroke-width="4" points="968.99,-1601.5 978.99,-1598 968.99,-1594.5 968.99,-1601.5"/>
<text text-anchor="middle" x="565.09" y="-1673" font-family="Times,serif" font-size="30.00">Mise</text>
<text text-anchor="middle" x="565.09" y="-1640" font-family="Times,serif" font-size="30.00">sous</text>
<text text-anchor="middle" x="565.09" y="-1607" font-family="Times,serif" font-size="30.00">tension</text>
</g>
<!-- Off -->
<g id="node10" class="node">
<title>Off</title>
<ellipse fill="#e890f0" stroke="#000000" cx="2663.8" cy="-1452" rx="79.81" ry="79.81"/>
<ellipse fill="none" stroke="#000000" cx="2663.8" cy="-1452" rx="83.81" ry="83.81"/>
<text text-anchor="middle" x="2663.8" y="-1444.5" font-family="Arial" font-size="30.00">Off</text>
</g>
<!-- Wait&#45;&gt;Off -->
<g id="edge17" class="edge">
<title>Wait&#45;&gt;Off</title>
<path fill="none" stroke="black" stroke-width="4" d="M1246.1,-1532.54C1304.4,-1505.29 1375.82,-1476.63 1443.59,-1462 1855.87,-1372.99 2365,-1416.48 2570.43,-1440.14"/>
<polygon fill="black" stroke="black" stroke-width="4" points="2570.23,-1443.64 2580.57,-1441.32 2571.04,-1436.69 2570.23,-1443.64"/>
<text text-anchor="middle" x="2111.59" y="-1489" font-family="Times,serif" font-size="30.00">Mise</text>
<text text-anchor="middle" x="2111.59" y="-1456" font-family="Times,serif" font-size="30.00">hors</text>
<text text-anchor="middle" x="2111.59" y="-1423" font-family="Times,serif" font-size="30.00">tension</text>
</g>
<!-- Wait&#45;&gt;Wait -->
<g id="edge16" class="edge">
<title>Wait&#45;&gt;Wait</title>
<path fill="none" stroke="black" stroke-width="4" d="M1026.27,-1703.57C1005.53,-1766.38 1036.97,-1825.42 1120.59,-1825.42 1199.8,-1825.42 1232.18,-1772.44 1217.75,-1713.46"/>
<polygon fill="black" stroke="black" stroke-width="4" points="1221.03,-1712.21 1214.9,-1703.57 1214.3,-1714.14 1221.03,-1712.21"/>
<text text-anchor="middle" x="1120.59" y="-1834.42" font-family="Times,serif" font-size="30.00">Ré&#45;initialisation</text>
</g>
<!-- Show -->
<g id="node12" class="node">
<title>Show</title>
<ellipse fill="#ffc0a0" stroke="#000000" cx="2111.59" cy="-1723" rx="131.54" ry="131.54"/>
<text text-anchor="middle" x="2111.59" y="-1765" font-family="Times,serif" font-size="30.00">Attente</text>
<text text-anchor="middle" x="2111.59" y="-1732" font-family="Times,serif" font-size="30.00">fin des</text>
<text text-anchor="middle" x="2111.59" y="-1699" font-family="Times,serif" font-size="30.00">animations</text>
<text text-anchor="middle" x="2111.59" y="-1666" font-family="Times,serif" font-size="30.00">Cycle=vrai</text>
</g>
<!-- Wait&#45;&gt;Show -->
<g id="edge12" class="edge">
<title>Wait&#45;&gt;Show</title>
<path fill="none" stroke="black" stroke-width="4" d="M1253.69,-1549.69C1407.05,-1501.37 1665.3,-1444.22 1871.59,-1520 1926.19,-1540.06 1976.85,-1578.74 2017.34,-1617"/>
<polygon fill="black" stroke="black" stroke-width="4" points="2015.14,-1619.74 2024.78,-1624.13 2019.99,-1614.69 2015.14,-1619.74"/>
<text text-anchor="middle" x="1657.59" y="-1529" font-family="Times,serif" font-size="30.00">Animation</text>
</g>
<!-- Show&#45;&gt;Off -->
<g id="edge14" class="edge">
<title>Show&#45;&gt;Off</title>
<path fill="none" stroke="black" stroke-width="4" d="M2229.95,-1665.2C2334.86,-1613.52 2486.01,-1539.07 2579.13,-1493.21"/>
<polygon fill="black" stroke="black" stroke-width="4" points="2580.81,-1496.28 2588.24,-1488.72 2577.72,-1490 2580.81,-1496.28"/>
<text text-anchor="middle" x="2408.09" y="-1678" font-family="Times,serif" font-size="30.00">Mise</text>
<text text-anchor="middle" x="2408.09" y="-1645" font-family="Times,serif" font-size="30.00">hors</text>
<text text-anchor="middle" x="2408.09" y="-1612" font-family="Times,serif" font-size="30.00">tension</text>
</g>
<!-- Show&#45;&gt;Wait -->
<g id="edge13" class="edge">
<title>Show&#45;&gt;Wait</title>
<path fill="none" stroke="black" stroke-width="4" d="M1988.46,-1675.91C1951.44,-1663.48 1910.32,-1651.46 1871.59,-1644 1666.69,-1604.54 1425.05,-1596.43 1272.57,-1595.9"/>
<polygon fill="black" stroke="black" stroke-width="4" points="1272.21,-1592.4 1262.2,-1595.88 1272.19,-1599.4 1272.21,-1592.4"/>
<text text-anchor="middle" x="1657.59" y="-1653" font-family="Times,serif" font-size="30.00">Fin animation</text>
</g>
<!-- Show&#45;&gt;Wait -->
<g id="edge15" class="edge">
<title>Show&#45;&gt;Wait</title>
<path fill="none" stroke="black" stroke-width="4" d="M1979.86,-1726.76C1844.66,-1728.45 1627.9,-1724.99 1443.59,-1694 1383.76,-1683.94 1319.39,-1666.21 1264.06,-1648.7"/>
<polygon fill="black" stroke="black" stroke-width="4" points="1264.78,-1645.26 1254.19,-1645.55 1262.65,-1651.92 1264.78,-1645.26"/>
<text text-anchor="middle" x="1657.59" y="-1735" font-family="Times,serif" font-size="30.00">Ré&#45;initialisation</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

@@ -0,0 +1,68 @@
digraph finite_state_machine {
overlap=false
fontname="Arial"
fontsize=50;
label="\nÉtats pour l'animation du dragon."
rankdir=LR; // bgcolor="#C6CFD532"; // transparent
edge[style="filled,setlinewidth(4)",fontsize=30];
node[style="setlinewidth(4)",color="#000000",fontsize=30];
pad=0.2 // margins / clusters //center=true
nodesep=1.2
ranksep=2.2
subgraph clusterInternal {
fontsize=40;
label="\nVue interne du sous ensemble { Attente - Animations }\n\n"
style=filled color = "#FFC0A0"
// margin=10 # in points
TMD [label="\nMode Dégradé\n?",fillcolor="#DDDDDD",shape=diamond,style=filled]
ABP [label="Attente\nde l'appui\nbouton\n",fillcolor="#A0FFFF",shape=circle,style=filled]
node [shape=circle,style=filled];
R1 [label="Attente\nfin\nanimation",fillcolor="red:#FD4030",style=radial] // lightred
J1 [label="Attente\nfin\nanimation",fillcolor="#FFF030"] ; // lightyellow
B1 [label="Attente\nfin\nanimation",fillcolor="#70A0FF"] ; // lightblue
VMN [label="Affiche\nluminosité\ncourante",fillcolor="#80ff80:green"];
VMD [label="Clignote\nà\n1 Hertz",fillcolor="#80ff80:black",style=radial];
FB [style=invis]
{ rank = min ABP VMD }
{ rank = max J1 }
{ rank = same B1 VMN }
{ rank = same R1 FB TMD }
// n e s w for top right bottom left
ABP -> TMD:n [label="Vérification du mode"]; // n for nord (top),
ABP -> R1 [label="Animation Led Rouge"];
TMD:w -> VMD [label="Active clignotement Led Verte",taillabel="Oui"];
TMD:ne -> B1 [label="Animation Led Bleue",taillabel="Non"];
TMD:e -> J1 [label="Animation Led Jaune",taillabel="Non"];
TMD:se -> VMN [label="Baisse luminosité Led Verte",taillabel="Non"];
// TMD:nw -> ABP [label="Mode dégradé",decorate=true,taillabel="Oui"];
R1 -> ABP [label = "Fin animation"];
J1 -> ABP [label = "Fin animation"];
B1 -> ABP [label = "Fin animation"];
// R1 -> J1 [style=invis] //,constraint=false]
B1 -> J1 [style=invis] //,constraint=false]
// TMD:s -> FB // [style=invis] //,constraint=false]
} // clusterD
subgraph clusterGlobal {
fontsize=40; label="\nVue synthétique\n\n" style=filled color = "#A0FFFF"
Off [shape = doublecircle, style = filled, fillcolor="#000000"]
// On [shape = circle, style = filled, fillcolor="#000000"]
node [shape = circle, style = filled, fillcolor="#FFC0A0"]; Wait Show ;
{ rank = min On }
{ rank = max Off }
Wait [ label = "Attente\nd'un appui\nbouton\nCycle=Faux" ];
Show [ label = "Attente\nfin des\nanimations\nCycle=vrai" ];
// On -> Wait [ label = "Mise\nsous\ntension"];
Wait -> Show [ label = "Animation"];
Show -> Wait [ label = "Fin animation"];
Show -> Off [ label = "Mise\nhors\ntension"];
Show -> Wait [ label = "Ré-initialisation"];
Wait -> Wait [ label = "Ré-initialisation"];
Wait -> Off [ label = "Mise\nhors\ntension"];
} // clusterGlobal
} //finite_state_machine
+76
View File
@@ -0,0 +1,76 @@
#ifndef __PT_H__
#define __PT_H__
typedef unsigned short lc_t;
#define LC_INIT(s) s = 0; // LC_INIT
#define LC_RESUME(s) switch(s) { case 0: // LC_RESUME
#define LC_SET(s) s = __LINE__; case __LINE__: // LC_SET line
#define LC_END(s) } // LC_END
struct pt { lc_t lc; };
#define PT_WAITING 0
#define PT_YIELDED 1
#define PT_EXITED 2
#define PT_ENDED 3
#define PT_INIT(pt) LC_INIT((pt)->lc) // INIT
#define PT_THREAD(name_args) char name_args // THREAD
#define PT_BEGIN(pt) { char PT_YIELD_FLAG = 1; LC_RESUME((pt)->lc) // BEGIN
#define PT_END(pt) LC_END((pt)->lc); \
PT_YIELD_FLAG = 0; \
PT_INIT(pt); return PT_ENDED; } // END
#define PT_WAIT_UNTIL(pt, condition) \
do { \
LC_SET((pt)->lc); \
if(!(condition)) { \
return PT_WAITING; \
} \
} while(0) // WAIT_UNTIL
#define PT_WAIT_WHILE(pt, cond) \
PT_WAIT_UNTIL((pt), !(cond)) // WAIT_WHILE
#define PT_WAIT_THREAD(pt, thread) \
PT_WAIT_WHILE((pt), PT_SCHEDULE(thread)) // WAIT_THREAD
#define PT_SPAWN(pt, child, thread) \
do { \
PT_INIT((child)); \
PT_WAIT_THREAD((pt), (thread)); \
} while(0) // SPAWN
#define PT_RESTART(pt) \
do { \
PT_INIT(pt); \
return PT_WAITING; \
} while(0) // RESTART
#define PT_EXIT(pt) \
do { \
PT_INIT(pt); \
return PT_EXITED; \
} while(0) // EXIT
#define PT_SCHEDULE(f) ((f) < PT_EXITED) // SCHEDULE
#define PT_YIELD(pt) \
do { \
PT_YIELD_FLAG = 0; \
LC_SET((pt)->lc); \
if(PT_YIELD_FLAG == 0) { \
return PT_YIELDED; \
} \
} while(0) // YIELD
#define PT_YIELD_UNTIL(pt, cond) \
do { \
PT_YIELD_FLAG = 0; \
LC_SET((pt)->lc); \
if((PT_YIELD_FLAG == 0) || !(cond)) { \
return PT_YIELDED; \
} \
} while(0) // YIELD_UNTIL
// checked for n calls in a thread : seems OK
#define PT_DELAY(pt, ms) \
do { \
static unsigned long _PTTTL_ ; \
_PTTTL_ = millis() + (unsigned int)(ms); \
PT_WAIT_UNTIL((pt), (millis() > _PTTTL_)); \
} while(0) // DELAY
#define PT_SYNC(pt, mark, ms) \
do { \
PT_WAIT_UNTIL((pt), (millis() - (mark) > (ms) )); \
} while(0) // SYNC
#endif /* __PT_H__ */