diff --git a/script/RobotMX.py b/script/RobotMX.py deleted file mode 100644 index 81d7675..0000000 --- a/script/RobotMX.py +++ /dev/null @@ -1,13 +0,0 @@ -run("RobotTCP") - -class RobotMX(RobotTCP): - def mount(self, puck, sample): - return self.execute('mount', puck, sample) - - def on_event(self,ev): - print "EVT: " + ev - - -add_device(RobotMX("robot", "129.129.126.100:1000"), force = True) -robot.setPolling(100) -#robot.set_monitor_speed(20) diff --git a/script/RobotTCP.py b/script/RobotTCP.py index 828f811..8f1cd89 100644 --- a/script/RobotTCP.py +++ b/script/RobotTCP.py @@ -144,12 +144,20 @@ class RobotTCP(TcpDevice, Stoppable): return self.get_pnt() - #Robot control - + #Robot control def is_powered(self): self.powered = self.eval_bool("isPowered()") return self.powered + def enable(self): + self.evaluate("enablePower()") + if not self.is_powered(): + raise Exception("Cannot enable power") + + #waits for power to be actually cut off + def disable(self): + self.evaluate("disablePower()", timeout=5000) + def get_monitor_speed(self): self.speed = self.eval_int("getMonitorSpeed()") @@ -159,13 +167,6 @@ class RobotTCP(TcpDevice, Stoppable): if (ret==-2): raise Exception("The monitor speed is under the control of the operator") if (ret==-3): raise Exception("The specified speed is not supported") - def enable(self): - return self.evaluate("enablePower()") - - #waits for power to be actually cut off - def disable(self): - return self.evaluate("disablePower()", timeout=5000) - def is_calibrated(self): return self.eval_bool("isCalibrated()")