diff --git a/src/monitoring/AgentM.py b/src/monitoring/AgentM.py index a61cc23..eca5ed7 100755 --- a/src/monitoring/AgentM.py +++ b/src/monitoring/AgentM.py @@ -9,6 +9,7 @@ import sys #from common.models import Command sys.path.append("..") +sys.path.append("../..") from src.agent.Agent import Agent, extract_parameters # PM 20190416 recycle code diff --git a/src/monitoring/doc/AgentM_sequence_diag.pu b/src/monitoring/doc/AgentM_sequence_diag.pu new file mode 100644 index 0000000..61ad977 --- /dev/null +++ b/src/monitoring/doc/AgentM_sequence_diag.pu @@ -0,0 +1,83 @@ + +@startuml + +' --- Agent ACTIVIY DIAGRAM (plantUML) --- + +' NEW syntax => http://plantuml.com/fr/activity-diagram-beta +' OLD syntax => http://plantuml.com/fr/activity-diagram-legacy +' (See also https://plantweb.readthedocs.io) +' (See also https://pythonhosted.org/plantuml) + +' What is the current version of PlantUML (and Java) used ? +' startuml +' version +' enduml + +' Exemple de skin utilisable (celui de ChemCam) : +' skinparam activity { +' StartColor red +' EndColor Silver +' BackgroundColor Peru +' BackgroundColor<< Begin >> Olive +' BorderColor Peru +' FontName Impact +' } + + +title +__**Agent.run() function : Activity Diagram**__ + +end title + + +start + +:DO_EXIT = False +DO_RESTART = True; + +while (DO_RESTART ?) is (yes) + :load_config(); + :init(); + :DO_MAIN_LOOP = True; + while (DO_MAIN_LOOP ?) is (yes) + partition main_loop() { + :reload_config(); + note right + only if changed + end note + + :log_agent_status(); + note right + Log this agent status in DB + end note + + :routine_process(); + + :cmd = get_next_valid_command(); + if (cmd ?) then + partition command_process(cmd) { + :cmd = general_process(cmd); + if (cmd ?) then + :specific_process(cmd); + else (no) + endif + note right + only if I am "active" + end note + } + else (no) + endif + if (DO_RESTART or DO_EXIT ?) then (yes) + :DO_MAIN_LOOP = False; + endif + + + + + } + endwhile (no) +endwhile (no) + +stop + +@enduml -- libgit2 0.21.2