pyTangoDevice (version 1, 23 may 2006)
index
d:\python\pytangodevice.py

 
Modules
       
time

 
Classes
        
 
class pyTangoDevice
    Class to use  a Tango device
******************************************
        Olivier Tache               
<olivier.tache@cea.fr>
http://www-drecam.cea.fr/scm
------------------------------------------
DRECAM / SCM / LIONS
Direction des Sciences de la Matiere
Commissariat a l'Energie Atomique
CEA SACLAY
91191 Gif / Yvette Cedex
******************************************
 
pyTangoDevice version 1
 
Class to use  a Tango device 
ex :
>>> test=pyTangoDevice("tango/tangotest/1")
Now tango can access easily to the device
Read an attribute :
>>> test.short_scalar
45
Write an attribute :
>>> test.short_scalar_w=3
Execute a command :
>>> test.Init()
Execute a command with a return value :
>>> test.DevLong(1)
1
Get the current state :
>>> device.State()
PyTango.DevState.ON
 
--- for some use we need a function to access to atributes,
so each attribute have a set and get command
>>> test.get_double_scalar()
221.70272980813175
>>> test.set_short_scalar_w(3) for READ attribute only
 
--- for some use we need to wait that a device is ready (ON)
so I add a function waitStateON() to wait the DevState::ON 
>>> test.waitStateON() will not work because tangotest state is UNKNOWN
 
  Methods defined here:
__getattr__(self, name)
call for an attribute 'name'
ex : >>> print mydevice.name
call the function read_attribute('name').value
__init__(self, name)
Class to use easily a Tango device
name : device server name
__repr__(self)
__setattr__(self, name, arg)
pass a value to an atribute name
ex : >>> mydevice.name=10.2
check if attribute is writable
call the function read_attribute and write_attribute
__str__(self)
waitStateON(self)
function to wait the DevState::ON (DevState.ON)
of the device server

Data and other attributes defined here:
DeviceName = ''
DeviceProxy = ''
State = ''
Status = ''
myDict = {}

 
Data
        WAIT_TIME = 0.29999999999999999
__author__ = 'Olivier Tache <olivier.tache@cea.fr>'
__date__ = '23 may 2006'
__version__ = 1

 
Author
        Olivier Tache <olivier.tache@cea.fr>