Bases: taurus.core.util.singleton.Singleton, taurus.core.taurusfactory.TaurusFactory, taurus.core.util.log.Logger
A Singleton class designed to provide Tango related objects.
The TangoFactory model containning the Factory for the Tango scheme
Tango Factory uses the Taurus object naming (URI based):
foo://username:password@example.com:8042/over/there/index.dtb;type=animal?name=ferret#nose \_/ \________________/\_________/ \__/\_________/ \___/ \_/ \_________/ \_________/ \__/ | | | | | | | | | | scheme userinfo hostname port path filename extension parameter(s) query fragment \____________________________/ | authority
For Tango:
- The ‘scheme’ must be the string “tango” (lowercase mandatory)
- The ‘authority’ is the Tango database (<hostname> and <port> mandatory)
- The ‘path’ is the Tango object, which can be a Device or Attribute. For device it must have the format _/_/_ or alias For attribute it must have the format _/_/_/_ or devalias/_
- The ‘filename’ and ‘extension’ are always empty
- The ‘parameter’ is always empty
- The ‘the query’ is valid when the ‘path’ corresponds to an Attribute. Valid queries must have the format configuration=<config param>. Valid configuration parameters are: label, format, description, unit, display_unit, standard_unit, max_value, min_value, max_alarm, min_alarm, max_warning, min_warning. in this case the Tango object is a Configuration
Activates the polling (client side) for the given attribute with the given period (seconds).
Parameters: |
|
---|
Cleanup the singleton instance
Disable the application tango polling
Enable the application tango polling
Obtain the class object corresponding to the given name.
Parameters: | absolute_name (:class:~`str`) – the object absolute name string |
---|---|
Return type: | :class:~`taurus.core.taurusmodel.TaurusModel` |
Returns: | a class object that should be a subclass of a taurus.core.taurusmodel.TaurusModel |
Raise: | (:exc:~`taurus.core.taurusexception.TaurusException`) if the given name is invalid. |
Obtain the object corresponding to the given attribute name. If the corresponding attribute already exists, the existing instance is returned. Otherwise a new instance is stored and returned.
Parameters: | attr_name (:class:~`str`) – attribute name |
---|---|
Return type: | :class:~`taurus.core.tangoattribute.TangoAttribute` |
Returns: | attribute object |
Raise: | (:exc:~`taurus.core.taurusexception.TaurusException`) if the given alias is invalid. |
Deprecated: Use taurus.core.tango.TangoFactory.getConfiguration() instead.
Obtain attribute information corresponding to the given attribute name. If the corresponding attribute info already exists, the existing information is returned. Otherwise a new information instance is stored and returned.
Parameters: | full_attr_name (:class:~`str`) – attribute name in format: <tango device name>’/’<attribute name> |
---|---|
Return type: | :class:~`taurus.core.tango.TangoConfiguration` |
Returns: | configuration object |
Obtain the object corresponding to the given attribute or full name. If the corresponding configuration already exists, the existing instance is returned. Otherwise a new instance is stored and returned.
Parameters: | param (:class:~`taurus.core.taurusattribute.TaurusAttribute` or :class:~`str`) – attrubute object or full configuration name |
---|---|
Return type: | :class:~`taurus.core.tango.TangoConfiguration` |
Returns: | configuration object |
Obtain the object corresponding to the given database name or the default database if db_name is None. If the corresponding database object already exists, the existing instance is returned. Otherwise a new instance is stored and returned.
Parameters: | db_name (:class:~`str`) – database name string alias. If None, the default database is used |
---|---|
Return type: | :class:~`taurus.core.tangodatabase.TangoDatabase` |
Returns: | database object |
Raise: | (:exc:~`taurus.core.taurusexception.TaurusException`) if the given alias is invalid. |
Obtain the object corresponding to the given tango device name. If the corresponding device already exists, the existing instance is returned. Otherwise a new instance is stored and returned.
Parameters: | dev_name (:class:~`str`) – tango device name or tango alias for the device. It should be formed like: <host>:<port>/<tango device name> - If <host>:<port> is ommited then it will use the default database. - <tango device name> can be full tango device name (_/_/_) or a device alias. |
---|---|
Return type: | :class:~`taurus.core.tango.TangoDevice` |
Returns: | a device object |
Raise: | (:exc:~`taurus.core.taurusexception.TaurusException`) if the given dev_name is invalid. |
Returns a registered attribute or None if the corresponding attribute as not been registered. This is used mainly to avoid recursion between two objects supplied by this factory which can ask for the other object in the constructor.
Parameters: | attr_name (:class:~`str`) – attribute name |
---|---|
Return type: | :class:~`taurus.core.tango.TangoAttribute` or :class:~`None` |
Returns: | attribute object or None |
Returns a new dictionary will all registered attributes on this factory
Returns: | dictionary will all registered attributes on this factory |
---|---|
Return type: | dict |
Returns a new dictionary will all registered configurations on this factory
Returns: | dictionary will all registered configurations on this factory |
---|---|
Return type: | dict |
Returns a new dictionary will all registered databases on this factory
Returns: | dictionary will all registered databases on this factory |
---|---|
Return type: | dict |
Returns a registered device or None if the corresponding device as not been registered. This is used mainly to avoid recursion between two objects supplied by this factory which can ask for the other object in the constructor.
Parameters: | dev_name (:class:~`str`) – tango device name or tango alias for the device. It should be formed like: <host>:<port>/<tango device name> - If <host>:<port> is ommited then it will use the default database. - <tango device name> can be full tango device name (_/_/_) or a device alias. |
---|---|
Return type: | :class:~`taurus.core.tango.TangoDevice` or :class:~`None` |
Returns: | device object or None |
Returns a new dictionary will all registered devices on this factory
Returns: | dictionary will all registered devices on this factory |
---|---|
Return type: | dict |
Singleton instance initialization. For internal usage only
Tells if the local tango polling is enabled
Return type: | :class:~`bool` |
---|---|
Returns: | wheter or not the polling is enabled |
Reinitialize the singleton
Registers a new attribute class for the attribute name.
Parameters: |
|
---|
Registers a new python class to handle tango devices of the given tango class name
Parameters: |
|
---|
Deactivate the polling (client side) for the given attribute. If the polling of the attribute was not previously enabled, nothing happens.
Parameters: | attribute (:class:~`str`) – attribute name. |
---|
Removes a previously registered attribute.
Parameters: | attr_or_attr_name (:class:~`str` or :class:~`TangoAttribute`) – attribute name or attribute object |
---|
Removes a previously registered device.
Parameters: | dev_or_dev_name (:class:~`str` or :class:~`TangoDevice`) – device name or device object |
---|
the list of schemes that this factory supports. For this factory: ‘tango’ is the only scheme
Sets the new default tango host.
Parameters: | tango_host (:class:~`str`) – the new tango host |
---|
Unregisters the attribute class for the given attribute If no class was registered before for the given attribute, this call as no effect
Parameters: | attr_name (:class:~`str`) – attribute name |
---|
Unregisters the class for the given tango class name If no class was registered before for the given attribute, this call as no effect
Parameters: | dev_klass_name (:class:~`str`) – tango device class name |
---|