From 682123b6d9bade706212dfdc7c9060f0df3d2e39 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Thu, 26 Jan 2017 16:21:16 +0100 Subject: [PATCH] Closedown --- script/TestRobotCmds.py | 1 + script/local.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/script/TestRobotCmds.py b/script/TestRobotCmds.py index 27d82d5..67f9991 100644 --- a/script/TestRobotCmds.py +++ b/script/TestRobotCmds.py @@ -1,5 +1,6 @@ import java.lang.System as System + index = 0 max_time = 0 diff --git a/script/local.py b/script/local.py index c0e2152..54280c6 100644 --- a/script/local.py +++ b/script/local.py @@ -36,10 +36,10 @@ class RobotModbus(DeviceBase): robot_req.write(0) def execute(self, command, *argv): - #if robot_req.read() != 0: - # raise Exception("Ongoing command") - #if robot_ack.read() != 0: - # raise Exception("Robot is not ready") + if robot_req.read() != 0: + raise Exception("Ongoing command") + if robot_ack.read() != 0: + raise Exception("Robot is not ready") robot_cmd.write(command) args = [0,0,0,0,0,0] index = 0 @@ -61,13 +61,13 @@ class RobotModbus(DeviceBase): def request(self): robot_req.write(1) - #while robot_ack.read() == 0: - # time.sleep(0.001) + while robot_ack.read() == 0: + time.sleep(0.001) def cancel_request(self): robot_req.write(0) - #while robot_ack.read() != 0: - # time.sleep(0.001) + while robot_ack.read() != 0: + time.sleep(0.001) def mount(self, puck, sample): return self.execute('1', '1', puck, sample)