tango-simlib: Easily generate TANGO device simulators
|
|
---|---|
Hi All SKA SA (CAMmers) created a user friendly library to ease creation of useful simulated devices. tango-simlib is a library that aids the data-driven development of TANGO device simulators. It aims to make it easy to develop basic simulators while making it possible to implement more complex simulators. In addition to the simulated device interface, a separate TANGO simulation-control interface is generated, allowing the simulator to be manipulated via a back-channel to simulate e.g. failure conditions on the simulated device interface. Using only the basic TANGO interface description captured via a POGO generated XMI file, a basic simulator with attributes and no-op command handlers can be generated with no further coding. Attribute simulation parameters and simple command behaviour can be specified using a JSON Simulator Description Datafile (SimDD). Custom behavior is implemented selectively using Python code by defining an override class containing a method for each command. The planned SKA radio telescope chose the TANGO controls framework, thus this library will be of immediate convenience for use by the element consortia to develop their local control and monitoring (LMC) simulators and device simulators and also will enable telescope manager (TM) to support early assembly, integration and verification efforts. The library is open-source and free for use: Manual - https://media.readthedocs.org/pdf/tango-simlib/latest/tango-simlib.pdf Homepage - http://tango-simlib.readthedocs.io Source - https://github.com/ska-sa/tango-simlib Author email - cam@ska.ac.za NB: This package is also available on PyPI, allowing : pip install tango-simlib Feel free to use, it’s free anyway ! Control And Monitoring @ SKA SA / CAMmers |
|
|
---|---|
Many thanks for posting all the links in the forum!!, I'll give it a try in the next weeks Sergi Rubio |
|
|
---|---|
Hi Javas Thanks I had installed tango-simlib successfully, but from the documentation, i can not get what's the relationship between Weather and WeatherSimControl device |
|
|
---|---|
Hi Jimmy The WeatherSimControl is used to control the behavior of the Weather simulator in real time. It can be used to change tango attributes values in real time and simulation parameters, that includes min/max range in which the tango attribute values should vary between in the case where the SimDD is used to specify simulation parameters. As you will be aware that when the SimControl is registered into tangoDB, a device property model_key is provided, which is the name of the main simulator say Weather device. Through this model_key property the SimControl locates the main simulator model, which containing quantities and action handlers, whereby the quantities are represented by the tango attributes on the Weather simulator. Once the SimControl has a ref to the Weather device model, it gets all quantity/attribute names and populate the enum labels of the DevEnum attribute with label 'Attribute name'. The attachment shows a scenario where a temperature attribute is selected for manipulation using WeatherSimControl, where its current value is incremented to 100 degrees Celsius, and the Weather device behaves accordingly. i.e it goes into alarm state, since the temperature attribute value is above the nominal range of the attribute values. Feel free to keep in contact. Javas |
|
|
---|---|
Hi Javas many thanks, i get a little. Based my old learning project "EvenTest" (EvenTest.xmi attached, it has three attributes: one Scalar attribute of DevLong named Value1, one Spectrum attribute of DevLong named Value2, one Image Attribute of DevULong named Value3), i find it seems tango-simlib only support Scalar datatype attribute process, not properly process Spectrum and Image attribute. At same time i find PyTango 9.2.1 seems not properly process unsigned data type. firstly: It seems data type problem, so edit EventTest.xmi, change Value3 attribute's data type from DevULong to DevLong(pogoDsl:UIntType —> pogoDsl:IntType), re-run:
|
|
|
---|---|
Hi Jimmy, It seems like PyTango does not support attributes of data_type DevInt when we are creating them dynamically I have created an issue regarding this on pytango.At the moment we have made a separate branch on tango-simlib that handles this error appropriately.
However at the moment I would suggest that you use DevShort or DevLong for your attribute data types. We do handle Spectrum attributes, but currently do not process Image attributes. We do encourage you to also raise issues that you might be having whilst using the package on github. Kind regards, K.Madisa |