tango-controls / SimulatorDS

PyTango device server for simulation/testing
https://www.tango-controls.org
Other
4 stars 3 forks source link

exporting a DS attributes #4

Closed PhilLAL closed 6 years ago

PhilLAL commented 6 years ago

Hi Sergi, following instructions given on page https://github.com/tango-controls/SimulatorDS/blob/master/doc/gen_simulation.rst#export-attributes-from-your-production-host I tried to export attributes : fandango -l find_devices "LI/HFH/SHF.01-MOD.01/*" > devices.txt give the following device.txt

find_devices(*['LI/HFH/SHF.01-MOD.01/*'])

Then I launched SimulatorDS/gen_simulation.py export devices.txt xgui_attributes.pck which give the following xgui_attributes.pck :

ccollections
defaultdict
p0
(cfandango.objects
Struct
p1
tp2
Rp3
.

Since the format is strange, I think I made a mistake or there is an error. Perhaps there are some steps I did not check. Could you confirm and help me solving this issue?

Thank you.

PhilLAL commented 6 years ago

Hi Sergi, a small up in case this message has not been seen.

sergirubio commented 6 years ago

Hi PhilLAL, I was busy on maintenance tasks I'll review the procedure on monday and i'll come back with some feedback Sergi

PhilLAL commented 6 years ago

Thank you :)

PhilLAL commented 6 years ago

Hi Sergi, please let me know if I can help you giving more information.

sergirubio commented 6 years ago

Hi PhilLAL ... could you try if the error reproduce using a checkout from develop branch?

git clone -b develop https://github.com/tango-controls/fandango cd fandango python setup.py install

sergirubio commented 6 years ago

I have released a new pip package, please try again

PhilLAL commented 6 years ago

Hi Sergi, thank you for your help. After trying to test this under virtualenv, I got some issues so I tested it with a virtual machine, TANGO9 on debian 9. I installed fandango with pip and then launched device TangoTest (with default device sys/tg_test/1). Then, I launched fandango -l find_devices "sys/tg_test/1/*" > Device-TangoTest.txt but I got empty a file with only a newline:

tango9@tango9:~$ cat Device-TangoTest.txt 

tango9@tango9:~$
sergirubio commented 6 years ago

Hi PhilLAL

In your command, you have an extra "/" that affects the query, try this instead:

   `fandango -l find_devices "sys/tg_test/1" > device-tangotest.txt`

When doing the export, the format of the files is correct, pickle uses this format

    `SimulatorDS/gen_simulation.py export device-tangotest.txt test_attributes.pck`

Then change the TANGO_HOST and proceed loading the attributes

     `export TANGO_HOST=new_host:10000
      gen_simulation.py load test-attributes.pck new_host`
PhilLAL commented 6 years ago

Indeed, I introduced an extra "/". Thank you for your time Sergi