Commit 946923f8 authored by Cyril Guilloud's avatar Cyril Guilloud

added sleep in socket closing to let controller breath...

parent 2e7b61d6
......@@ -28,9 +28,11 @@ class FlexDC(Controller):
# Init of controller.
def initialize(self):
print "FLEXDC CONTROLLER initialize"
self.sock = tcp.Socket(self.host, 4000)
def finalize(self):
print "FLEXDC CONTROLLER finalize"
self.sock.close()
# Init of each axis.
......@@ -56,12 +58,12 @@ class FlexDC(Controller):
# 0 -> point to point
# ( 1 -> jogging ; 2 -> position based gearing )
# ( 5 -> position based ECAM ; 8 -> Step command (no profile) )
print self._flexdc_query("%sMM=0"%axis.channel)
self._flexdc_query("%sMM=0"%axis.channel)
# Special motion mode attribute parameter
# 0 -> no special mode
# ( 1 -> repetitive motion )
print self._flexdc_query("%sSM=0"%axis.channel)
self._flexdc_query("%sSM=0"%axis.channel)
# Defines smoothing (typically 4).
self._flexdc_query("%sWW=%d"%(axis.channel, axis.smoothing))
......
......@@ -38,7 +38,7 @@ class Mockup(Controller):
# this is to test axis are initialized only once
axis.settings.set('init_count', axis.settings.get('init_count')+1)
# Add new axis oject methods
# Add new axis oject method.
add_axis_method(axis, self.get_identifier)
......
......@@ -5,6 +5,7 @@ Unittest for FlexDC controller in bliss library.
import unittest
import sys
import os
import time
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
......@@ -64,8 +65,9 @@ class TestFlexDCController(unittest.TestCase):
# called at end of each test
def tearDown(self):
fd = bliss.get_axis("fd")
fd.controller.sock.close()
# Little wait time to let time to flexdc controller to
# close peacefully its sockets...
time.sleep(0.05)
# def test_axis_move(self):
# fd = bliss.get_axis("fd")
......
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