DServer#

DServer based on the LatestDeviceImpl class, but has additional methods.

The only time you can access an instance of this class is within a running device server process.

Below is an example of the usage:

import tango

util = tango.Util.instance()
dserver = util.get_dserver_device()

print(f"{dserver.query_class()=}")
print(f"{dserver.query_device()=}")

Warning

The get and query methods are safe to use, but the rest will significantly affect the behaviour of your Tango devices, so use with caution.

class tango.DServer#
add_event_heartbeat(self: tango._tango.DServer) None#

Command to ask the heartbeat thread to send the event heartbeat every 9 seconds

add_obj_polling(self: tango._tango.DServer, argin: tuple[list[int], list[str]], with_db_upd: bool = True, delta_ms: SupportsInt | SupportsIndex = 0) None#

Command to add one object to be polled

Parameters:
  • argin (tuple[list[int], list[str]]) – The polling parameters, as a sequence of two sequences. E.g. ([2000], [“sys/tg_test/1”, “attribute”, “double_scalar”]) Where first element: list of integers, where element at index 0 is update period in milliseconds. And second element: a list of strings: index 0: device name; index 1: object type, either “command” or “attribute”; index 2: object name

  • with_db_upd (bool) – set to true if db has to be updated

  • delta_ms (int)

delete_devices(self: tango._tango.DServer) None#

Call destructor for all objects registered in the server

dev_lock_status(self: tango._tango.DServer, dev_name: str) tuple[list[int], list[str]]#

Command to get device lock status

Parameters:

dev_name (str) – device name

Returns:

device lock status

dev_poll_status(self: tango._tango.DServer, arg0: str) list[str]#

Command to read device polling status

Parameters:

dev_name (str) – The device name

Returns:

The device polling status as a string (multiple lines)

get_fqdn(self: tango._tango.DServer) str#
get_full_name(self: tango._tango.DServer) str#
get_instance_name(self: tango._tango.DServer) str#
get_opt_pool_usage(self: tango._tango.DServer) bool#
get_personal_name(self: tango._tango.DServer) str#
get_poll_th_conf(self: tango._tango.DServer) tango._tango.StdStringVector#
get_poll_th_pool_size(self: tango._tango.DServer) int#
get_process_name(self: tango._tango.DServer) str#
kill(self: tango._tango.DServer) None#

Command to kill the device server process. This is done by starting a thread which will kill the process. Starting a thread allows the client to receive something from the server before it is killed

lock_device(self: tango._tango.DServer, in_data: tuple[list[int], list[str]]) None#

Command to lock device

Parameters:

in_data (tuple[list[int], list[str]]) – a structure with: (lock validity, name of the device(s) to be locked,)

polled_device(self: tango._tango.DServer) list[str]#

Command to read all the devices actually polled by the device server

query_class(self: tango._tango.DServer) list[str]#

Command to read all the classes used in a device server process

query_class_prop(self: tango._tango.DServer, arg0: str) list[str]#

Command to return the list of property device at class level for the specified class

query_dev_prop(self: tango._tango.DServer, arg0: str) list[str]#

Command to return the list of property device at device level for the specified class

query_device(self: tango._tango.DServer) list[str]#

Command to read all the devices implemented by a device server process

query_sub_device(self: tango._tango.DServer) list[str]#

Command to read all the sub devices used by a device server process

re_lock_devices(self: tango._tango.DServer, in_data: list[str]) None#

Command to relock device

Parameters:

in_data (tuple[list[int], list[str]]) – a structure with: (lock validity, name of the device(s) to be relocked)

rem_event_heartbeat(self: tango._tango.DServer) None#

Command to ask the heartbeat thread to stop sending the event heartbeat

rem_obj_polling(self: tango._tango.DServer, argin: list[str], with_db_upd: bool = True) None#

Command to remove an already polled object from the device polled object list

Parameters:
  • argin (list[str]) – The polling parameters: device name; object type (command or attribute); object name

  • with_db_upd (bool) – set to true if db has to be updated

restart(self: tango._tango.DServer, d_name: str) None#

Command to restart a device

Parameters:

d_name (str) – The device name to be re-started

restart_server(self: tango._tango.DServer) None#

Command to restart a server (all devices embedded within the server)

start_logging(self: tango._tango.DServer) None#
start_polling(self: tango._tango.DServer) None#

Command to start the polling thread

stop_logging(self: tango._tango.DServer) None#
stop_polling(self: tango._tango.DServer) None#

Command to stop the polling thread

un_lock_device(self: tango._tango.DServer, in_data: tuple[list[int], list[str]]) int#

Command to unlock device

Parameters:

in_data (tuple[list[int], list[str]]) – a structure with: (lock validity, name of the device(s) to be unlocked)

upd_obj_polling_period(self: tango._tango.DServer, argin: tuple[list[int], list[str]], with_db_upd: bool = True) None#

Command to update an already polled object update period

Parameters:
  • argin (tuple[list[int], list[str]]) – The polling parameters, as a sequence of two sequences. E.g. ([2000], [“sys/tg_test/1”, “attribute”, “double_scalar”]) Where first element: list of integers, where element at index 0 is update period in milliseconds. And second element: a list of strings: index 0: device name; index 1: object type, either “command” or “attribute”; index 2: object name

  • with_db_upd (bool) – set to true if db has to be updated