DeviceClass

class tango.DeviceClass

Base class for all TANGO device-class class. A TANGO device-class class is a class where is stored all data/method common to all devices of a TANGO device class

create_device(self, device_name, alias=None, cb=None) → None

Creates a new device of the given class in the database, creates a new DeviceImpl for it and calls init_device (just like it is done for existing devices when the DS starts up)

An optional parameter callback is called AFTER the device is registered in the database and BEFORE the init_device for the newly created device is called

Throws tango.DevFailed:
  • the device name exists already or
  • the given class is not registered for this DS.
  • the cb is not a callable

New in PyTango 7.1.2

Parameters:
device_name:(str) the device name
alias:(str) optional alias. Default value is None meaning do not create device alias
cb:(callable) a callback that is called AFTER the device is registered in the database and BEFORE the init_device for the newly created device is called. Typically you may want to put device and/or attribute properties in the database here. The callback must receive a parameter: device name (str). Default value is None meaning no callback
Return:

None

delete_device(self, klass_name, device_name) → None

Deletes an existing device from the database and from this running server

Throws tango.DevFailed:
  • the device name doesn’t exist in the database
  • the device name doesn’t exist in this DS.

New in PyTango 7.1.2

Parameters:
klass_name:(str) the device class name
device_name:(str) the device name
Return:

None

device_destroyer(name)

for internal usage only

device_factory(device_list)

for internal usage only

device_name_factory(self, dev_name_list) → None
Create device(s) name list (for no database device server). This method can be re-defined in DeviceClass sub-class for device server started without database. Its rule is to initialise class device name. The default method does nothing.
Parameters:
dev_name_list:(seq) sequence of devices to be filled
Return:

None

dyn_attr(self, device_list) → None
Default implementation does not do anything Overwrite in order to provide dynamic attributes
Parameters:
device_list:(seq) sequence of devices of this class
Return:

None