Tango device replicator class in Python

I want to find out if there is a generic TANGO device replicator class available in Python. The replicator should act as a bridge to represent the replicated class from a different facility in the current facility.

What I want is that the replicator class should take a FQDN property indicating which TANGO device (from a different facility) it should replicate in the current facility. On connection to the replicated device the replicator should inspect the commands and attributes and expose the same commands and attributes on the replicator device. The replicator should reflect the attribute values as they change on the replicated device and pass through commands to the replicated device.

Don't mind to do some work, but if someone has done this already then it will be useful as a start.

Thanks
Lize
Hi Lize,
we do have something similar in C++. I'll get it published and let you know.
Cheers,
Lorenzo
Hi Lize,

You can use the CopyCatDS from fandango, it does exactly what you want.

Give a while and I'll post a mini-howto in this post.

Sorry for the late answer!!

Sergi Rubio
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Here it is:

https://github.com/tango-controls/fandango/blob/documentation/doc/devices/CopyCatDS.rst

Install fandango library

Note that, although not mandatory, most of fandango requires PyTango previously installed.

With PIP (may need sudo): pip install –upgrade fandango

From a GIT clone (may need sudo):
git clone https://github.com/tango-controls/fandango
cd fandango
python setup.py install

If you're just trying it, I suggest to use a VirtualEnv (no sudo required):
virtualenv test –system-site-packages
source test/bin/activate
pip install –upgrade fandango
source test/bin/activate

Setup your CopyCatDS

Create and setup the device from jive or shell:
fandango.sh add_new_device CopyCatDS/test CopyCatDS test/copycatds/01
fandango.sh put_device_property test/copycatds/01 TargetDevice SYS/TG_TEST/1

The CopyAttributes can be used to select/filter the attributes to export (* is the default but image attributes are not well supported yet):
fandango.sh put_device_property test/copycatds/01 CopyAttributes '(?!.*image.*$)'

Start it

python $(fandango.sh findModule fandango)/interface/CopyCatDS.py test -v2 &

Show it with atkpanel or taurusdevicepanel:

taurusdevicepanel test/copycatds/01 &

Hope it helps,

Sergi Rubio, ALBA
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Hi Sergi
Thanks for that input. Looks interesting!
I will try it out in the next week or so.
Lize
 
Register or login to create to post a reply.