Commit 03ef2c8d authored by Cyril Guilloud's avatar Cyril Guilloud

flexdc tests and timing of socket communication

parent 7430f191
......@@ -20,8 +20,6 @@ NOT DONE :
"""
class FlexDC(Controller):
def __init__(self, name, config, axes):
Controller.__init__(self, name, config, axes)
......@@ -105,8 +103,10 @@ class FlexDC(Controller):
# DP : desired position
# When an axis is in motion, DP holds the real time servo
# loop control reference position
t0=time.time()
_pos = int(self._flexdc_query("%sDP"%axis.channel))
print "FLEXDC setpoint position :", _pos
t1=time.time() - t0
print "FLEXDC setpoint position : %g (took %gs)"%(_pos, t1)
return _pos
......@@ -167,6 +167,7 @@ class FlexDC(Controller):
# Adds ACK character:
_cmd = _cmd + "Z"
print id(self.sock)
_ans = self.sock.write_readline(_cmd, eol=">" )
if self.sock.raw_read(1) != "Z":
print "missing ack character ???"
......
......@@ -12,7 +12,7 @@ config_xml = """
<host value="flexdcnina"/>
<axis name="fd">
<channel value="X"/>
<step_size value="2000"/>
<step_size value="13111"/>
<target_radius value="20"/>
<target_time value="10"/>
<smoothing value="4"/>
......@@ -52,7 +52,7 @@ class TestFlexDCController(unittest.TestCase):
def test_velocity(self):
fd = bliss.get_axis("fd")
print "FlexDC valocity :", fd.velocity()
print "FlexDC velocity :", fd.controller.velocity(fd)
def test_get_info(self):
fd = bliss.get_axis("fd")
......@@ -77,7 +77,7 @@ if __name__ == '__main__':
'''
NA Interactive test :
NINA Interactive test :
load_cfg_fromstring("""<config>
<controller class="FlexDC" name="id16phn">
......@@ -103,6 +103,5 @@ print a.get_info()
print a.controller
# print a.controller.sock.write_readline("\n")
'''
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment