Controller properties motor_role_ids and counter_role_ids with role names
Currently Controller Tango device properties motor_role_ids
and counter_role_ids
contain just ids (numeric or names):
This also forces these property values to follow the order defined in the controller class (plugin).
In the SEP20 configuration file format (YAML) we proposed to use mapping to define these roles:
physical_roles:
sl2t: mot01
sl2b: mot02
Using such a mapping has the following benefits:
- it is clear at first glance (without the need to refer to the controller class code) which role is assigned to each motors
- roles can be configured in arbitrary order
With @nurbldoff we designed the following refactoring of the sardana code:
- add
sardanacustomsetting.USE_PHYSICAL_ROLES_PROPERTY_ONLY
- in case it is
False
(default)-- keep the
motor_role_ids
andcounter_role_ids
Tango device properties as they are - on every server startup we add/update new property
physical_roles
(common name for pseudo motor and pseudo counter controllers) with list of alternative role name and motor id based on themotor_role_ids
andcounter_role_ids
values e.g.:
- keep the
- in case it is
True
- on every server startup we check if the
physical_roles
property exist and if it does not exist we convert, as described above, but only once and remove the old properties.
- on every server startup we check if the