API Reference

Simple attributes

class facadedevice.local_attribute(create_attribute=True, **kwargs)

Tango attribute with event support.

Local attributes support the standard attribute keywords.

It can be used as a decorator to set a method providing the default value for the corresponding attribute.

Parameters:create_attribute (str) – Create the corresponding tango attribute. Default is True.
class facadedevice.logical_attribute(bind, standard_aggregation=True, **kwargs)

Tango attribute computed from the values of other attributes.

Use it as a decorator to register the function that make this computation. Logical attributes also support the standard attribute keywords.

Parameters:
  • bind (list of str) – List of node names to bind to. It has to contain at least one name.
  • standard_aggregation (optional, bool) – Use the default aggregation mecanism. Default is True.
  • create_attribute (optional, bool) – Create the corresponding tango attribute. Default is True.

Remote attributes

class facadedevice.proxy_attribute(property_name, create_property=True, **kwargs)

Tango attribute linked to the attribute of a remote device.

Parameters:
  • property_name (str) – Name of the property containing the attribute name.
  • create_property (optional, bool) – Create the corresponding device property. Default is True.
  • standard_aggregation (optional, bool) – Use the default aggregation mecanism. Default is True.
  • create_attribute (optional, bool) – Create the corresponding tango attribute. Default is True.

Also supports the standard attribute keywords.

class facadedevice.combined_attribute(property_name, create_property=True, **kwargs)

Tango attribute computed from the values of other remote attributes.

Use it as a decorator to register the function that make this computation. The remote attribute names are provided by a property, either as a list or a pattern.

Parameters:
  • property_name (str) – Name of the property containing the attribute names.
  • create_property (optional, bool) – Create the corresponding device property. Default is True.
  • standard_aggregation (optional, bool) – Use the default error aggregation mecanism. Default is True.
  • create_attribute (optional, bool) – Create the corresponding tango attribute. Default is True.

Also supports the standard attribute keywords.

State handling

class facadedevice.state_attribute(bind=None, standard_aggregation=True)

Tango state attribute with event support.

Parameters:
  • bind (list of str) – List of node names to bind to, or None to disable the binding. Default is None.
  • standard_aggregation (optional, bool) – Use the default error aggregation mecanism. Default is True.

Commands

class facadedevice.proxy_command(property_name, create_property=True, write_attribute=False, **kwargs)

Command to write an attribute or run a command of a remote device.

It can be used as a decorator to define a more precise behavior. The decorated method takes the subcommand as its firt argument.

Parameters:
  • property_name (str) – Name of the property containing the attribute or command name.
  • create_property (str) – Create the corresponding device property. Default is True.
  • write_attribute (bool) – True if the subcommand should an attribute write, False otherwise. Default is false.

Also supports the standard command keywords.

Facade base classes

class facadedevice.Facade(cl, name)

Base class for facade devices.

It supports the following objects:

It also provides a few helpers:

  • self.graph: act as a <key, node> dictionnary
  • self.get_combined_results: return the subresults of a combined attribute

The init_device method shouldn’t be overridden. It performs specific exception handling. Instead, override safe_init_device if you have to add some extra logic. Don’t forget to call the parent method since it performs a few useful steps:

  • load device properties
  • configure and build the graph
  • run the connection routine

It also provides an expert command called GetInfo that displays useful information such as:

  • the connection status
  • the list of all event subscriptions
  • the exception history
class facadedevice.TimedFacade(cl, name)

Similar to the facadedevice.Facade base class with time handling.

In particular, it adds:

  • the UpdateTime polled command, used trigger updates periodically
  • the Time local attribute, a float updated at every tick
  • the on_time method, a callback that runs at every tick