From 1fc68cb1b83710144fa1ce7a29ceecd14536ae75 Mon Sep 17 00:00:00 2001 From: Jean-Remy Hok Date: Mon, 15 Mar 2021 10:56:40 +0100 Subject: [PATCH 1/3] Fusion avec manageRobot --- conception/th_comRobot.txt | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 conception/th_comRobot.txt diff --git a/conception/th_comRobot.txt b/conception/th_comRobot.txt deleted file mode 100644 index 7b98292..0000000 --- a/conception/th_comRobot.txt +++ /dev/null @@ -1,18 +0,0 @@ -@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 From cb2975cef5d624b75921d93a000002425d6781d9 Mon Sep 17 00:00:00 2001 From: Jean-Remy Hok Date: Mon, 15 Mar 2021 11:36:06 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Mettre=20=C3=A0=20jour=20'conception/th=5Fm?= =?UTF-8?q?anageRobot.txt'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conception/th_manageRobot.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/conception/th_manageRobot.txt b/conception/th_manageRobot.txt index 61a55af..dda263c 100644 --- a/conception/th_manageRobot.txt +++ b/conception/th_manageRobot.txt @@ -19,6 +19,7 @@ while () :stopRobot?; :robot.Write(new Message(MESSAGE_ROBOT_STOP)); :robot.Close(); + :robotStarted = false; endif else :msgSend = new Message(MESSAGE_ANSWER_NACK); From e5053429c3e909100bbaeca0862905a8c1d79df6 Mon Sep 17 00:00:00 2001 From: Jean-Remy Hok Date: Mon, 15 Mar 2021 11:41:45 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Mettre=20=C3=A0=20jour=20'conception/th=5Fr?= =?UTF-8?q?eceiveFromMon.txt'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conception/th_receiveFromMon.txt | 94 ++++++++++++++++---------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/conception/th_receiveFromMon.txt b/conception/th_receiveFromMon.txt index 0d1caf3..4515680 100644 --- a/conception/th_receiveFromMon.txt +++ b/conception/th_receiveFromMon.txt @@ -3,53 +3,55 @@ skinparam monochrome true start :serverOk?; while () - :msgRcv = monitor.Read(); - if (msgRcv.CompareID(MESSAGE_MONITOR_LOST)) then (true) - :printf("Connection avec le moniteur perdue"); - :stopCamera!; - :stopRobot!; - :stopComRobot!; - :stopServer!; - endif + :msgRcv = monitor.Read(); + if (msgRcv.CompareID(MESSAGE_MONITOR_LOST)) then (true) + :printf("Connection avec le moniteur perdue"); + :stopCamera!; + :stopRobot!; + :stopServer!; + endif if (msgRcv.CompareID(MESSAGE_ROBOT_COM_OPEN)) then (true) :openComRobot!; - endif - if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITHOUT_WD)) then (true) - :watchdogMode = WITHOUT_WATCHDOG; - :startRobot!; - endif - if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITH_WD)) then (true) - :watchdogMode = WITH_WATCHDOG; - :startRobot!; - endif - if (msgRcv.CompareID(MESSAGE_ROBOT_GO_FORWARD - || msgRcv.CompareID(MESSAGE_ROBOT_GO_BACKWARD - || msgRcv.CompareID(MESSAGE_ROBOT_GO_LEFT - || msgRcv.CompareID(MESSAGE_ROBOT_GO_RIGHT - || msgRcv.CompareID(MESSAGE_ROBOT_STOP)) then (true) - :move = msg.GetId(); - endif - if (msgRcv.CompareID(MESSAGE_CAM_OPEN)) then (true) - :startCamera!; - endif - if (msgRcv.CompareID(MESSAGE_CAM_CLOSE)) then (true) - :stopCamera!; - endif - if (msgRcv.CompareID(MESSAGE_CAM_ASK_ARENA)) then (true) - :searchArena!; - endif - if (msgRcv.CompareID(MESSAGE_CAM_ARENA_CONFIRM)) then (true) - :validateArena!; - endif - if (msgRcv.CompareID(MESSAGE_CAM_ARENA_INFIRM)) then (true) - :cancelArena!; - endif - if (msgRcv.CompareID(MESSAGE_CAM_POSITION_COMPUTE_START)) then (true) - :startPosition!; - endif - if (msgRcv.CompareID(MESSAGE_CAM_POSITION_COMPUTE_STOP)) then (true) - :stopPosition!; - endif + endif + if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITHOUT_WD)) then (true) + :watchdogMode = WITHOUT_WATCHDOG; + :startRobot!; + endif + if (msgRcv.CompareID(MESSAGE_ROBOT_START_WITH_WD)) then (true) + :watchdogMode = WITH_WATCHDOG; + :startRobot!; + endif + if (msgRcv.CompareID(MESSAGE_ROBOT_RESET)) then (true) + :stopRobot!; + endif + if (msgRcv.CompareID(MESSAGE_ROBOT_GO_FORWARD + || msgRcv.CompareID(MESSAGE_ROBOT_GO_BACKWARD + || msgRcv.CompareID(MESSAGE_ROBOT_GO_LEFT + || msgRcv.CompareID(MESSAGE_ROBOT_GO_RIGHT + || msgRcv.CompareID(MESSAGE_ROBOT_STOP)) then (true) + :move = msg.GetId(); + endif + if (msgRcv.CompareID(MESSAGE_CAM_OPEN)) then (true) + :startCamera!; + endif + if (msgRcv.CompareID(MESSAGE_CAM_CLOSE)) then (true) + :stopCamera!; + endif + if (msgRcv.CompareID(MESSAGE_CAM_ASK_ARENA)) then (true) + :searchArena!; + endif + if (msgRcv.CompareID(MESSAGE_CAM_ARENA_CONFIRM)) then (true) + :validateArena!; + endif + if (msgRcv.CompareID(MESSAGE_CAM_ARENA_INFIRM)) then (true) + :cancelArena!; + endif + if (msgRcv.CompareID(MESSAGE_CAM_POSITION_COMPUTE_START)) then (true) + :startPosition!; + endif + if (msgRcv.CompareID(MESSAGE_CAM_POSITION_COMPUTE_STOP)) then (true) + :stopPosition!; + endif endwhile stop -@enduml +@enduml \ No newline at end of file