Commit 028e3d7f authored by Matias Guijarro's avatar Matias Guijarro
Browse files

Merge branch '1670-undulators-add-undulator_prefix-in-configuration' into 'master'

Resolve "undulators: add 'undulator_prefix' in configuration"

Closes #1670

See merge request !3688
parents 7487b530 73c44fcf
Pipeline #46583 failed with stages
in 97 minutes and 49 seconds
......@@ -88,6 +88,9 @@ class ESRF_Undulator(Controller):
"""
def initialize_axis(self, axis):
"""
Read configuration to forge tango attributes names.
"""
attr_pos_name = axis.config.get("attribute_position", str, "Position")
......@@ -110,17 +113,20 @@ class ESRF_Undulator(Controller):
log_debug(self, f"alpha={alpha} period={period}")
undu_prefix = axis.config.get("undu_prefix", str)
if undu_prefix is None:
log_debug(self, "'undu_prefix' not specified in config")
if attr_pos_name == "Position":
raise RuntimeError("'undu_prefix' must be specified in config")
undu_prefix = axis.config.get("undulator_prefix", str)
if undu_prefix is None:
log_debug(self, "'undu_prefix' not specified in config")
if attr_pos_name == "Position":
raise RuntimeError("'undu_prefix' must be specified in config")
else:
undu_prefix = ""
else:
undu_prefix = ""
else:
attr_pos_name = undu_prefix + attr_pos_name
attr_vel_name = undu_prefix + attr_vel_name
attr_fvel_name = undu_prefix + attr_fvel_name
attr_acc_name = undu_prefix + attr_acc_name
attr_pos_name = undu_prefix + attr_pos_name
attr_vel_name = undu_prefix + attr_vel_name
attr_fvel_name = undu_prefix + attr_fvel_name
attr_acc_name = undu_prefix + attr_acc_name
# check for revolver undulator
is_revolver = False
......
......@@ -15,7 +15,7 @@ velocity and acceleration have to be specified.
`ESRF_Undulator` controller is a `NoSettingsAxis`, i.e. the parameters
like velocity, accelerations are not configured in Beacon but read from Tango DS.
There are 2 ways to do that:
There are 2 ways to configure undulators axes:
* either giving the fulls names of the attributes:
```
......@@ -24,10 +24,10 @@ There are 2 ways to do that:
attribute_first_velocity: U42B_GAP_FirstVelocity
attribute_acceleration: U42B_GAP_Acceleration
```
* or just giving the undu_prefix:
* or better give only the `undulator_prefix` (or `undu_prefix`):
```
undu_prefix: U42C_GAP_
undulator_prefix: U42C_GAP_
```
## YAML configuration file example
......@@ -54,7 +54,7 @@ In this example, the 2 types of configuration are used:
alpha: 1.9206
-
name: u42c
undu_prefix: U42C_GAP_
undulator_prefix: U42C_GAP_
steps_per_unit: 1
tolerance: 0.1
low_limit: 0.01
......@@ -64,9 +64,24 @@ In this example, the 2 types of configuration are used:
```
## info
## information
Example of non-initialized undulator:
`wid()` command gives info about all undulators configured in a session:
```
DEMO [1]: wid()
---------------------------------------
ID Device Server //acs.esrf.fr:10000/id/master/id42
Power: 0.000 / 10.0 KW
Power density: 0.000 / 300.0 KW/mr2
u42b - GAP:200.000 - ENABLED
u42c - GAP:199.999 - ENABLED
u32a - GAP:199.999 - ENABLED
```
Inline info provides detailed information about undulator axis:
```
u42b
AXIS:
......
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