fandango.device.Dev4Tango module

@if gnuheader

## ## file : device.py ## ## description : CLASS FOR Enhanced TANGO DEVICE SERVERs ## ## project : Tango Control System ## ## $Author: Sergi Rubio Manrique, srubio@cells.es $ ## ## $Revision: 2008 $ ## ## copyleft : ALBA Synchrotron Controls Section, CELLS ## Bellaterra ## Spain ## ############################################################################# ## ## This file is part of Tango Control System ## ## Tango Control System is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as published ## by the Free Software Foundation; either version 3 of the License, or ## (at your option) any later version. ## ## Tango Control System is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, see <http://www.gnu.org/licenses/>. ########################################################################### @endif @package device @brief provides Dev4Tango, StateQueue, DevChild @todo @warning IMPORTING THIS MODULE IS CAUSING SOME ERRORS WHEN CLOSING PYTHON DEVICE SERVERS, BE CAREFUL!

This module is used to have all those classes used inside DeviceServers or to control/configure them and are not part of the Astor api (ServersDict)

class fandango.device.Dev4Tango.Dev4Tango(cl, name)[source]

Bases: PyTango._PyTango.Device_4Impl, fandango.log.Logger

See documentation at doc/devices/Dev4Tango.rst

This class provides several new features to TangoDevice implementations. By including log.Logger it also includes objects.Object as parent class. It allows to use call__init__(self, klass, *args, **kw) to avoid multiple inheritance from same parent problems. Therefore, use self.call__init__(PyTango.Device_4Impl,cl,name) instead of PyTango.Device_4Impl.__init__(self,cl,name)

It also allows to connect several devices within the same server or not usint taurus.core

State()[source]

State redefinition is required to keep independency between attribute configuration (max/min alarms) and the device State

attr_list = {'LastUpdate': [[PyTango._PyTango.CmdArgType.DevDouble, PyTango._PyTango.AttrDataFormat.SCALAR, PyTango._PyTango.AttrWriteType.READ]], 'MemUsage': [[PyTango._PyTango.CmdArgType.DevDouble, PyTango._PyTango.AttrDataFormat.SCALAR, PyTango._PyTango.AttrWriteType.READ]]}
check_Properties(props_list)

It verifies that all properties has been initialized

check_properties(props_list)[source]

It verifies that all properties has been initialized

default_status()[source]

Default status

dev_state()[source]
event_received(source, type_, attr_value)[source]

This method manages the events received from external attributes. This method must be overriden in child classes.

getAttributeTemplate(name, type_=PyTango._PyTango.CmdArgType.DevDouble, rw=PyTango._PyTango.AttrWriteType.READ, unit='', frmt='')[source]

Returns an Attr object ready to be inserted with self.add_attribute(&Attr,&reader,&writer,&allowed)

getAttributeTime(attr_value)[source]

AttributeValue.time is of Type TimeVal={tv_sec,tv_usec,...}, not accepted by set_attribute_value_date_quality method of DeviceImpl

getMemUsage()[source]
get_admin_device()[source]
get_device_properties(myclass)[source]
get_devs_in_server(MyClass=None)[source]

Method for getting a dictionary with all the devices running in this server

get_polled_attrs()[source]

Returns a dictionary like {attr_name:period} @TODO: Tango8 has its own get_polled_attr method; check for incompatibilities

get_state()[source]
init_logger(name=None, use_tango=False)[source]

A default initialization for the Logger class

Use_tango:Use internal tango streams (-v) or not.
init_my_Logger(name=None, use_tango=False)

A default initialization for the Logger class

Use_tango:Use internal tango streams (-v) or not.
is_Attr_allowed(req_type)

This method is a template for any Attribute allowed control.

is_attr_allowed(req_type)[source]

This method is a template for any Attribute allowed control.

launch_external_command(device, target, argin=None)[source]
read_LastUpdate(attr)[source]
read_MemUsage(attr)[source]
read_ShortStatus()[source]

This reduced Status allows Status attribute to be archived (a ShortStatus attribute must exist)

set_polled_attribute(name, period, type_='attribute')[source]
set_polled_command(command, period)[source]
set_state(state)[source]
subscribe_external_attributes(device, attributes, use_tau=False)[source]
trace(prio, s)[source]
unsubscribe_external_attributes()[source]
update_external_attributes()[source]

This thread replaces TauEvent generation in case that the attributes are read from a device within the same server.

update_properties(property_list=[])[source]
write_external_attribute(device, attribute, data)[source]
class fandango.device.Dev4Tango.DevChild(cl, name)[source]

Bases: fandango.device.Dev4Tango.Dev4Tango