Commit e17ac8feefcfb470f65bf8d13479d1e4e5c268e8
1 parent
085a32e3
Exists in
dev
ajout agentM path et plantuml diag
Showing
2 changed files
with
84 additions
and
0 deletions
Show diff stats
src/monitoring/AgentM.py
... | ... | @@ -0,0 +1,83 @@ |
1 | + | |
2 | +@startuml | |
3 | + | |
4 | +' --- Agent ACTIVIY DIAGRAM (plantUML) --- | |
5 | + | |
6 | +' NEW syntax => http://plantuml.com/fr/activity-diagram-beta | |
7 | +' OLD syntax => http://plantuml.com/fr/activity-diagram-legacy | |
8 | +' (See also https://plantweb.readthedocs.io) | |
9 | +' (See also https://pythonhosted.org/plantuml) | |
10 | + | |
11 | +' What is the current version of PlantUML (and Java) used ? | |
12 | +' startuml | |
13 | +' version | |
14 | +' enduml | |
15 | + | |
16 | +' Exemple de skin utilisable (celui de ChemCam) : | |
17 | +' skinparam activity { | |
18 | +' StartColor red | |
19 | +' EndColor Silver | |
20 | +' BackgroundColor Peru | |
21 | +' BackgroundColor<< Begin >> Olive | |
22 | +' BorderColor Peru | |
23 | +' FontName Impact | |
24 | +' } | |
25 | + | |
26 | + | |
27 | +title | |
28 | +__**Agent.run() function : Activity Diagram**__ | |
29 | + | |
30 | +end title | |
31 | + | |
32 | + | |
33 | +start | |
34 | + | |
35 | +:DO_EXIT = False | |
36 | +DO_RESTART = True; | |
37 | + | |
38 | +while (DO_RESTART ?) is (yes) | |
39 | + :load_config(); | |
40 | + :init(); | |
41 | + :DO_MAIN_LOOP = True; | |
42 | + while (DO_MAIN_LOOP ?) is (yes) | |
43 | + partition main_loop() { | |
44 | + :reload_config(); | |
45 | + note right | |
46 | + only if changed | |
47 | + end note | |
48 | + | |
49 | + :log_agent_status(); | |
50 | + note right | |
51 | + Log this agent status in DB | |
52 | + end note | |
53 | + | |
54 | + :routine_process(); | |
55 | + | |
56 | + :cmd = get_next_valid_command(); | |
57 | + if (cmd ?) then | |
58 | + partition command_process(cmd) { | |
59 | + :cmd = general_process(cmd); | |
60 | + if (cmd ?) then | |
61 | + :specific_process(cmd); | |
62 | + else (no) | |
63 | + endif | |
64 | + note right | |
65 | + only if I am "active" | |
66 | + end note | |
67 | + } | |
68 | + else (no) | |
69 | + endif | |
70 | + if (DO_RESTART or DO_EXIT ?) then (yes) | |
71 | + :DO_MAIN_LOOP = False; | |
72 | + endif | |
73 | + | |
74 | + | |
75 | + | |
76 | + | |
77 | + } | |
78 | + endwhile (no) | |
79 | +endwhile (no) | |
80 | + | |
81 | +stop | |
82 | + | |
83 | +@enduml | ... | ... |