Simulator Library for PyTango
|
|
---|---|
Hi, At SKA SA we're probably going to be writing a number of simulated TANGO devices in the near future using PyTango. Is there any publicly available "simulator library" that would ease this task? Something that will e.g. generate randomly varying attributes with set limits, rates of change, etc? I have searched without finding anything, but perhaps I missed something? Thanks Neilen |
|
|
---|---|
AFAIK, there is nothing as high level as what you ask, but using the high-level server API of PyTango in conjunction with class decorators (or monkey-patching) it could be done. |
|
|
---|---|
Carlos, Thanks, yeah, that should not be too much work :) Cheers Neilen |
|
|
---|---|
Hi Neilen, Sorry for the late answer, but you may try the PySignalSimulator device. I posted some notes on how to use it in the PANIC discussion thread: http://www.tango-controls.org/community/forums/c/general/development/panic-the-alba-alarm-system/?page=1#post-523 You'll have to download fandango and the PySignalSimulator device svn co https://tango-cs.svn.sourceforge.net/svnroot/tango-cs/share/fandango/trunk/fandango fandango svn co https://tango-ds.svn.sourceforge.net/svnroot/tango-ds/DeviceClasses/Simulators/PySignalSimulator/trunk PySignalSimulator Documentation on packages: https://plone.tango-controls.org/Members/srubio/pysignalsimulator-device-server https://plone.tango-controls.org/howtos/dynamicattributes http://www.tango-controls.org/resources/howto/how-fandango/ Summarizing: #Create a new device (it can be done from Jive) >>> from fandango.tango import add_new_device,put_device_property >>> add_new_device('PySignalSimulator/1','PySignalSimulator','test/sim/1') >>> put_device_property('test/sim/1',{'DynamicAttributes':['A=t%100']}) #Launch the devices > python PySignalSimulator/PySignalSimulator.py 1 & Sergi Rubio |