.

Average: 0
Rating Count: 0

Development status: New development
Information status: New
Repository: http://svn.code.sf.net/p/tango-ds/code/DeviceClasses/Simulators/PySignalSimulator
Contact:



Class Description


PySignalSimulator Class Description:

This device requires <a href="http://www.tango-controls.org/Documents/tools/fandango/fandango">Fandango module<a> to be available in the PYTHONPATH.

This Python Device Server will allow to declare dynamic attributes which values will depend on a given time-dependent formula:

<h5 id="Example:">Example: <pre class="wiki"> Square=0.5+square(t) #(t = seconds since the device started) NoisySinus=2+1.5*sin(3*t)-0.5*random() SomeNumbers=DevVarLongArray([1000.*i for i in range(1,10)])

Attributes are DevDouble by default, but any Tango type or python expression can be used for declaration. Format is specified at <a class="ext-link" href="http://www.tango-controls.org/Members/srubio/dynamicattributes"><span class="icon">tango-controls.org</span></a>

Signals that can be easily generated with amplitude between 0.0 and 1.0 are:

rampt(t), sin(t), cos(t), exp(t), triangle(t), square(t,duty), random()

The MaxValue/MinValue property for each Attribute will determine the State of the Device only if the property DynamicStates is not defined.

If defined, DynamicStates will use this format:

<pre class="wiki"> FAULT=2*square(0.9,60) ALARM=NoisySinus ON=1

This device inherits from fandango.dynamic.DynamicDS Class

Families: Simulators

Key words:

Platform: All Platforms

Language: Python

License:

Contact:

Class interface


Attributes:

Commands:

Pipes:

Properties:

Name Description
UseScipyDevBoolean Disable numpy or scipy, NOT IMPLEMENTED YET
SimulationDelayDevDouble Delay, in seconds, to be applied to each read_attribute call
DynamicStatesStringArrayType This property will allow to declare new States dinamically based on <br/> dynamic attributes changes. The function Attr will allow to use the <br/> value of attributes in formulas.<br/> <br/> ALARM=Attr(T1)>70<br/> OK=1
PushEventsDevDouble Set condition for pushing events, N or N>t=periodic; N>diff/rel for change event
DynamicAttributesStringArrayType Attributes and formulas to create for this device. <br/> This Tango Attributes will be generated dynamically using this syntax: <br/> T3=int(SomeCommand(7007)/10.) <br/> See the class description to know how to make any method available in attributes declaration.


Please log in to comment.

README


This is the simulation suite for PyTango, it allows to create dynamic device servers and replicate existings systems into playable mockups.

It requires fandango: https://svn.code.sf.net/p/tango-cs/code/share/fandango/trunk/fandango

Usage:
gen_simulation.py ['list', 'export', 'generate', 'load', 'play', 'push'] file_input/instance [main_method/polling_period]

('list', '[main.py main_method]', 'export device/attribute lists from application into a file')
('export', '[attributes.txt]', 'export values from an attribute list into a .pck file')
('generate', '[...]', 'create the property files for simulators')
('load', '[...]', 'create simulators from files')
('play', '[...]', 'run the simulators')
('push', '[...]', 'configure simulators event pushing')

CHANGELOG

3.1: Improved simulation script, added 64 bits, better PyTangoArchiving and Scipy support.

3.0: Added gen_simulation script to extract and replay attribute values for complex simulation

2.5: Init() capable, added Scipy and PyTangoArchiving
Library/Modules loading refactored in the code.

16 Jan 2018, DS Admin
Created:
The device class has been added to catalogue.
Added by:dadmin on:16 Jan 2018, 2:23 p.m.