From c1ce48a19e98e711d0712ccd24ce5e27f0f6e575 Mon Sep 17 00:00:00 2001 From: Yohan Simard Date: Fri, 12 Mar 2021 14:46:45 +0100 Subject: [PATCH 1/3] Add comRobot thread to activity diagrams --- conception/th_comRobot.txt | 18 ++++++++++++++++++ conception/th_manageRobot.txt | 9 --------- conception/th_receiveFromMon.txt | 7 +++++-- 3 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 conception/th_comRobot.txt diff --git a/conception/th_comRobot.txt b/conception/th_comRobot.txt new file mode 100644 index 0000000..7b98292 --- /dev/null +++ b/conception/th_comRobot.txt @@ -0,0 +1,18 @@ +@startuml +skinparam monochrome true +start +while () + :openComRobot?; + :err = robot.Open(); + if (err) then (robot_ok) + :msgSend = new Message(MESSAGE_ANSWER_ACK); + else + :msgSend = new Message(MESSAGE_ANSWER_NACK); + endif + :messageToMon!msgSend; + + :closeComRobot?; + :robot.Close(); +endwhile +stop +@enduml diff --git a/conception/th_manageRobot.txt b/conception/th_manageRobot.txt index 40bde76..0340b20 100644 --- a/conception/th_manageRobot.txt +++ b/conception/th_manageRobot.txt @@ -3,14 +3,6 @@ skinparam monochrome true start while () :startRobot?; - :err = robot.Open(); - if (err) then (robot_ok) - :msgSend = new Message(MESSAGE_ANSWER_ACK); - else - :msgSend = new Message(MESSAGE_ANSWER_NACK); - endif - - :messageToMon!msgSend; if (watchdogMode) then (WITH_WATCHDOG) :msgSend = robot.Write(new Message(MESSAGE_ROBOT_START_WITH_WD)); @@ -26,7 +18,6 @@ while () :stopRobot? :ordre = STOP_MOVE; - :robot.Close(); endwhile stop diff --git a/conception/th_receiveFromMon.txt b/conception/th_receiveFromMon.txt index c7bb9bf..0d1caf3 100644 --- a/conception/th_receiveFromMon.txt +++ b/conception/th_receiveFromMon.txt @@ -8,16 +8,19 @@ while () :printf("Connection avec le moniteur perdue"); :stopCamera!; :stopRobot!; + :stopComRobot!; :stopServer!; endif if (msgRcv.CompareID(MESSAGE_ROBOT_COM_OPEN)) then (true) :openComRobot!; endif if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITHOUT_WD)) then (true) - :startRobotWithoutWd!; + :watchdogMode = WITHOUT_WATCHDOG; + :startRobot!; endif if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITH_WD)) then (true) - :startRobotWithWd!; + :watchdogMode = WITH_WATCHDOG; + :startRobot!; endif if (msgRcv.CompareID(MESSAGE_ROBOT_GO_FORWARD || msgRcv.CompareID(MESSAGE_ROBOT_GO_BACKWARD From a11dc90427300fc18c821e49660427866dcdba61 Mon Sep 17 00:00:00 2001 From: Jean-Remy Hok Date: Fri, 12 Mar 2021 14:51:15 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Mettre=20=C3=A0=20jour=20'conception/th=5Fm?= =?UTF-8?q?ove.txt'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conception/th_move.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/conception/th_move.txt b/conception/th_move.txt index 569f665..1b8dc08 100644 --- a/conception/th_move.txt +++ b/conception/th_move.txt @@ -9,7 +9,6 @@ while () :msgSend = robot.Write(new Message(move)); if (msgSend->getId()) then (MESSAGE_ANSWER_ACK) :counter = 0; - :robotStarted = true; else (MESSAGE_ANSWER_ROBOT_TIMEOUT || \nMESSAGE_ANSWER_ROBOT_UNKNOWN_COMMAND || \nMESSAGE_ANSWER_ROBOT_ERROR) :counter++; if (counter) then (3) From c2c23e912cf19f445c071a34c4b7cea32fdb724a Mon Sep 17 00:00:00 2001 From: Yohan Simard Date: Fri, 12 Mar 2021 14:55:05 +0100 Subject: [PATCH 3/3] add missing closeComRobot --- conception/th_move.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/conception/th_move.txt b/conception/th_move.txt index 1b8dc08..b33db70 100644 --- a/conception/th_move.txt +++ b/conception/th_move.txt @@ -13,6 +13,7 @@ while () :counter++; if (counter) then (3) :stopRobot!; + :closeComRobot!; :monitor.write(Message(MESSAGE_ANSWER_COM_ERROR)); else () endif