API Reference
Simple attributes
- class facadedevice.local_attribute(create_attribute=True, use_current_time=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.
An event is pushed when the attribute is written to. That event’s timestamp will match the time of writing. However, subsequent reads of the attribute will report the current timestamp (by default). This behaviour can be changed with an initialisation parameter.
- Parameters:
create_attribute (
bool, optional) – Create the corresponding tango attribute. Default is True.use_current_time (
bool, optional) – Force current timestamp on each access. 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 (
bool, optional) – Use the default aggregation mechanism. Default is True.create_attribute (
bool, optional) – 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 (
bool, optional) – Create the corresponding device property. Default is True.standard_aggregation (
bool, optional) – Use the default aggregation mechanism. Default is True.create_attribute (
bool, optional) – 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 (
bool, optional) – Create the corresponding device property. Default is True.standard_aggregation (
bool, optional) – Use the default error aggregation mechanism. Default is True.create_attribute (
bool, optional) – 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, **kwargs)
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 (
bool, optional) – Use the default error aggregation mechanism. 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 first 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:
:class:`facadedevice.state_attribute
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