DeviceClass

class tango.DeviceClass(*args, **kwargs)

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

DeviceClass.add_wiz_class_prop(self, str, str) -> None
DeviceClass.add_wiz_class_prop(self, str, str, str) -> None

For internal usage only

Parameters

None

Return

None

DeviceClass.add_wiz_dev_prop(self, str, str) -> None
DeviceClass.add_wiz_dev_prop(self, str, str, str) -> None

For internal usage only

Parameters

None

Return

None

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

export_device(self, dev, corba_dev_name='Unused')None

For internal usage only

Parameters
dev

(DeviceImpl) device object

corba_dev_name

(str) CORBA device name. Default value is ‘Unused’

Return

None

get_cmd_by_name(self, (str)cmd_name)tango.Command

Get a reference to a command object.

Parameters
cmd_name

(str) command name

Return

(tango.Command) tango.Command object

New in PyTango 8.0.0

get_command_list(self)sequence<tango.Command>

Gets the list of tango.Command objects for this class

Parameters

None

Return

(sequence<tango.Command>) list of tango.Command objects for this class

New in PyTango 8.0.0

get_cvs_location(self)None

Gets the cvs localtion

Parameters

None

Return

(str) cvs location

get_cvs_tag(self)str

Gets the cvs tag

Parameters

None

Return

(str) cvs tag

get_device_list(self)sequence<tango.DeviceImpl>

Gets the list of tango.DeviceImpl objects for this class

Parameters

None

Return

(sequence<tango.DeviceImpl>) list of tango.DeviceImpl objects for this class

get_doc_url(self)str

Get the TANGO device class documentation URL.

Parameters

None

Return

(str) the TANGO device type name

get_name(self)str

Get the TANGO device class name.

Parameters

None

Return

(str) the TANGO device class name.

get_type(self)str

Gets the TANGO device type name.

Parameters

None

Return

(str) the TANGO device type name

register_signal(self, signo)None
register_signal(self, signo, own_handler=false)None

Register a signal. Register this class as class to be informed when signal signo is sent to to the device server process. The second version of the method is available only under Linux.

Throws tango.DevFailed:
  • if the signal number is out of range

  • if the operating system failed to register a signal for the process.

Parameters
signo

(int) signal identifier

own_handler

(bool) true if you want the device signal handler to be executed in its own handler instead of being executed by the signal thread. If this parameter is set to true, care should be taken on how the handler is written. A default false value is provided

Return

None

set_type(self, dev_type)None

Set the TANGO device type name.

Parameters
dev_type

(str) the new TANGO device type name

Return

None

signal_handler(self, signo)None

Signal handler.

The method executed when the signal arrived in the device server process. This method is defined as virtual and then, can be redefined following device class needs.

Parameters
signo

(int) signal identifier

Return

None

unregister_signal(self, signo)None

Unregister a signal. Unregister this class as class to be informed when signal signo is sent to to the device server process

Parameters
signo

(int) signal identifier

Return

None