DeviceClass#

class tango.DeviceClass(name)#

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

add_wiz_class_prop(*args, **kwargs)#

Overloaded function.

  1. add_wiz_class_prop(self: tango._tango.DeviceClass, name: str, desc: str) -> None

For internal usage only

Parameters:
  • name (str) – class property name

  • desc (str) – class property description

  1. add_wiz_class_prop(self: tango._tango.DeviceClass, name: str, desc: str, default: str) -> None

For internal usage only

Parameters:
  • name (str) – class property name

  • desc (str) – class property description

  • desc – class property default value

add_wiz_dev_prop(*args, **kwargs)#

Overloaded function.

  1. add_wiz_dev_prop(self: tango._tango.DeviceClass, name: str, desc: str) -> None

For internal usage only

Parameters:
  • name (str) – device property name

  • desc (str) – device property description

  1. add_wiz_dev_prop(self: tango._tango.DeviceClass, name: str, desc: str, default: str) -> None

For internal usage only

Parameters:
  • name (str) – device property name

  • desc (str) – device property description

  • default (str) – device property default value

create_device(device_name: str, alias: str | None = None, cb: Callable | None = 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

Parameters:
  • device_name (str) – name of the new device

  • alias (str) – optional alias. Default value is None meaning do not create device alias

  • cb (typing.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

Throws:

DevFailed:

  • the device name exists already

  • the given class is not registered for this DS

  • the cb is not a callable

Added in version 7.1.2.

delete_device(device_name: str) None#

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

Parameters:
  • klass_name (str) – the device class name

  • device_name (str) – name of the new device

Throws:

DevFailed:

  • the device name doesn’t exist in the database

  • the device name doesn’t exist in this DS.

Added in version 7.1.2.

device_destroyer(name)#

for internal usage only

device_factory(device_list)#

for internal usage only

device_name_factory(dev_name_list: list[str]) 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 (list[str]) – sequence of devices to be filled

dyn_attr(device_list)#

Default implementation does not do anything Overwrite in order to provide dynamic attributes

Parameters:

device_list (list[DeviceImpl]) – sequence of devices of this class

export_device(self: tango._tango.DeviceClass, dev: Tango::DeviceImpl, corba_dev_name: str = 'Unused') None#

For internal usage only

Parameters:
  • dev (DeviceImpl) – device object

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

get_class_attr(self: tango._tango.DeviceClass) Tango::MultiClassAttribute#

Returns the instance of the tango.MultiClassAttribute for the class

Return type:

MultiClassAttribute

get_cmd_by_name(self: tango._tango.DeviceClass, cmd_name: str) Tango::Command#

Get a reference to a command object.

Parameters:

cmd_name (str) – command name

Return type:

Command

Added in version 8.0.0.

get_command_list(self: tango._tango.DeviceClass) object#

Gets the list of Command objects for this class

Return type:

list[Command]

Added in version 8.0.0.

get_cvs_location(self: tango._tango.DeviceClass) str#

Gets the cvs localtion

get_cvs_tag(self: tango._tango.DeviceClass) str#

Gets the cvs tag

get_device_list(self: tango._tango.DeviceClass) object#

Gets the list of tango.DeviceImpl objects for this class

Return type:

list[DeviceImpl]

get_doc_url(self: tango._tango.DeviceClass) str#

Get the TANGO device class documentation URL.

get_name(self: tango._tango.DeviceClass) str#

Get the TANGO device class name.

get_type(self: tango._tango.DeviceClass) str#

Gets the TANGO device type name.

register_signal(*args, **kwargs)#

Overloaded function.

  1. register_signal(self: tango._tango.DeviceClass, signo: typing.SupportsInt | typing.SupportsIndex) -> 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.

Parameters:

signo (int) – signal identifier

Throws:

DevFailed: - if the signal number is out of range - if the operating system failed to register a signal for the process

  1. register_signal(self: tango._tango.DeviceClass, signo: typing.SupportsInt | typing.SupportsIndex, own_handler: bool) -> 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.

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

Throws:

DevFailed: - if the signal number is out of range - if the operating system failed to register a signal for the process

set_type(self: tango._tango.DeviceClass, dev_type: str) None#

Set the TANGO device type name.

Parameters:

dev_type (str) – the new TANGO device type name

signal_handler(self: tango._tango.DeviceClass, signo: SupportsInt | SupportsIndex) 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

unregister_signal(self: tango._tango.DeviceClass, signo: SupportsInt | SupportsIndex) 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