Commit 1cf362a5 authored by Manuel Perez's avatar Manuel Perez

Workaround to get velocity/acctime on non synchronized trajectory

parent 7e329fe7
......@@ -25,9 +25,9 @@ class IcePAPTraj(Controller):
"""Implement IcePAP stepper motor controller access"""
default_group = None
def __init__(self, name, config, axes):
def __init__(self, name, config, axes, encoders):
"""Contructor"""
Controller.__init__(self, name, config, axes)
Controller.__init__(self, name, config, axes, encoders)
# Records the list of axes
self.axes_names = []
......
......@@ -299,6 +299,14 @@ class Trajectory(object):
# By default set parameter velocity on all axes
axis_list = self._check_axislist()
# If a trajectory has not been loaded yet, there is
# no sense to request velocity/acctime to the DSP
# but emulate anyway an answer for library clients
# not aware of this non sense.
axis = axis_list[0]
if self._sync[axis] == False:
return self._velocity
# Prepare the systems commands
cmd = "?PARVEL"
cmds = {}
......@@ -388,6 +396,14 @@ class Trajectory(object):
# By default set parameter acceleration on all axes
axis_list = self._check_axislist()
# If a trajectory has not been loaded yet, there is
# no sense to request velocity/acctime to the DSP
# but emulate anyway an answer for library clients
# not aware of this non sense.
axis = axis_list[0]
if self._sync[axis] == False:
return self._acctime
# Prepare the systems commands
cmd = "?PARACCT"
cmds = {}
......
......@@ -67,6 +67,7 @@ config_xml = """
"""
<acceleration value="4"/> // unit is par/sec2
Global resources, yes, I know it's bad
"""
hostname = ""
......@@ -267,7 +268,7 @@ class TestIcePAPController(unittest.TestCase):
def test_get_parameter_acctime_empty(self):
mypar = bliss.get_axis("mypar")
vel = mypar.velocity()
vel = mypar.acctime()
def test_get_parameter_acctime(self):
mypar = bliss.get_axis("mypar")
......
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