sardana-org / sardana

Moved to GitLab: https://gitlab.com/sardana-org/sardana
39 stars 52 forks source link

Change default names of sardana, controllers, motors and other sardana's devices in Tango #1122

Open MikeFalowski opened 5 years ago

MikeFalowski commented 5 years ago

I wonder if it is possible to change default naming of Sardana elements in Tango? Or to rename elements later?

When I created Pool "test" instance, corresponding device was created Pool/test/1. When I renamed it later, there wasn't problem. Unfortunately, when I tried this with controllers, controller in Sardana got FQDN (e.g. it was controller/IcePap/ipap1 and lsctrl was showing ipap1, after renaming to sar/ctrl/ipap1 in lsctrl showing it as tango://tango.example.com:10000/sar/ctrl/ipap1`.

Of course, renaming more dynamics elements, like Mesaurement Groups, is not the best option, so setting default naming would do the thing.

Any suggestion or help would be greatly appreciated.

MikeFalowski commented 5 years ago

I found what was the problem with the controller. When device is renamed, the alias of this device is being deleted.

Still I'm looking for a way to change the default naming.

reszelaz commented 5 years ago

Sorry for the late reply @MikeFalowski !

There is no official way to customize the default naming. This one is hard-coded in: https://github.com/sardana-org/sardana/blob/4b24003ebbb7ecedaaefb2b857b81330bfcd755c/src/sardana/pool/poolmetacontroller.py#L96

Could you try if modifying this templates solves your need? If yes maybe we could think of moving the default name configuration to sardanacustomsettings?