Commit 348ca772 authored by Sebastien Petitdemange's avatar Sebastien Petitdemange
Browse files

motor settings: fix, configuration and settings are now more restrictive.

By default for any motor controller, **velocity** and **acceleration**
must be in the configuration file (.yml).
But some controller can't read/set **acceleration** or **velocity**.
In that case each controller must unset explicitly this config
mandatory flag.
parent 04d4a329
......@@ -18,7 +18,9 @@ class cs8tango(Controller):
self._lock = gevent.lock.Semaphore()
def initialize(self):
pass
# velocity and acceleration are not mandatory in config
self.axis_settings.config_setting["velocity"] = False
self.axis_settings.config_setting["acceleration"] = False
def initialize_axis(self, axis):
axis.settings.set("dial_position", self.read_position(axis))
......
......@@ -26,6 +26,9 @@ class leica(Controller):
sys.excepthook(*sys.exc_info())
def initialize(self):
# velocity and acceleration are not mandatory in config
self.axis_settings.config_setting["velocity"] = False
self.axis_settings.config_setting["acceleration"] = False
try:
self.usb_controller = leica_usb.LeicaFocus()
except Exception:
......
......@@ -23,6 +23,10 @@ class MD2(Controller):
"""
Read the state to check if the MD2 application replies
"""
# velocity and acceleration are not mandatory in config
self.axis_settings.config_setting["velocity"] = False
self.axis_settings.config_setting["acceleration"] = False
self._get_swstate()
def initialize_axis(self, axis):
......
......@@ -66,6 +66,10 @@ class Mechonics(Controller):
_ans = self.serial.read()
return _ans
def initialize(self):
# acceleration is not mandatory in config
self.axis_settings.config_setting["acceleration"] = False
def initialize_axis(self, axis):
self.velocities[axis] = self.config.config_dict["axes"][0]["velocity"]
self.channels[axis] = self.config.config_dict["axes"][0]["channel"]
......
......@@ -24,6 +24,9 @@ class NF8753(Controller):
self.__busy = False
def initialize(self):
# acceleration is not mandatory in config
self.axis_settings.config_setting["acceleration"] = False
try:
self.sock = get_comm(self.config.config_dict, TCP, port=23)
except ValueError:
......
......@@ -46,6 +46,9 @@ class PI_E51X(Controller):
elog.debug("mvt started, gate set to 1")
def initialize(self):
# acceleration is not mandatory in config
self.axis_settings.config_setting["acceleration"] = False
self.sock = pi_gcs.get_pi_comm(self.config, TCP)
def finalize(self):
......
......@@ -34,6 +34,8 @@ class PI_E727(Controller):
"""
Controller intialization : opens a single socket for all 3 axes.
"""
# acceleration is not mandatory in config
self.axis_settings.config_setting["acceleration"] = False
self.trace("controller initialize")
self.host = self.config.get("host")
......
......@@ -35,6 +35,9 @@ class PI_E753(Controller):
"""
Controller intialization : opens a single socket for all 3 axes.
"""
# acceleration is not mandatory in config
self.axis_settings.config_setting["acceleration"] = False
self.sock = pi_gcs.get_pi_comm(self.config, TCP)
def finalize(self):
......
......@@ -55,6 +55,10 @@ class PI_HEXA(Controller):
"""
Initialize the communication to the hexapod controller
"""
# velocity and acceleration are not mandatory in config
self.axis_settings.config_setting["velocity"] = False
self.axis_settings.config_setting["acceleration"] = False
comm_type = get_comm_type(self.config.config_dict)
comm_option = {"timeout": 30.}
if comm_type == TCP:
......
......@@ -133,6 +133,10 @@ class PiezoJack(Controller):
self.icepap = None
def initialize(self):
# velocity and acceleration are not mandatory in config
self.axis_settings.config_setting["velocity"] = False
self.axis_settings.config_setting["acceleration"] = False
# axes used to drive the piezojack, one icepap and one piezo
self.piezo = self._tagged["piezo"][0]
self.icepap = self._tagged["icepap"][0]
......
......@@ -229,6 +229,11 @@ class SHexapod(Controller):
raise ValueError("Could not find Hexapod (is it connected?)")
return self._protocol
def initialize(self):
# velocity and acceleration are not mandatory in config
self.axis_settings.config_setting["velocity"] = False
self.axis_settings.config_setting["acceleration"] = False
def initialize_hardware(self):
self.protocol().control = True
......
......@@ -82,6 +82,11 @@ class SoftController(Controller):
self._move = get_move_func(obj, axis_config["move"])
self._stop = get_stop_func(obj, axis_config["stop"])
def initialize(self):
# velocity and acceleration are not mandatory in config
self.axis_settings.config_setting["velocity"] = False
self.axis_settings.config_setting["acceleration"] = False
def initialize_axis(self, axis):
pass
......
......@@ -35,6 +35,9 @@ class VSCANNER(Controller):
"""
Opens one socket for 2 channels.
"""
# acceleration is not mandatory in config
self.axis_settings.config_setting["acceleration"] = False
try:
self.serial = get_comm(self.config.config_dict, SERIAL, timeout=1)
self._status = "SERIAL communication configuration found"
......
Supports Markdown
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