PoolDevice
¶
Generic Tango Pool Device base classes
Classes
PoolDevice¶
-
class
PoolDevice
(dclass, name)[source]¶ Bases:
sardana.tango.core.SardanaDevice.SardanaDevice
Base Tango Pool device class
-
ExtremeErrorStates
= (<_mock._Mock object>, <_mock._Mock object>)¶ list of extreme error states
-
BusyStates
= (<_mock._Mock object>, <_mock._Mock object>)¶ list of busy states
-
BusyRetries
= 3¶ Maximum number of retries in a busy state
-
init
(name)[source]¶ initialize the device once in the object lifetime. Override when necessary but always call the method from your super class
Parameters: name (str) – device name
-
pool_device
¶ The tango pool device
-
pool
¶ The sardana pool object
-
get_element
()[source]¶ Returns the underlying pool element object
Returns: the underlying pool element object Return type: PoolElement
-
set_element
(element)[source]¶ Associates this device with the sardana element
Parameters: element ( PoolElement
) – the sardana element
-
element
¶ The underlying sardana element
-
init_device
()[source]¶ Initialize the device. Called during startup after
init()
and every time the tangoInit
command is executed. Override when necessary but always call the method from your super class
-
delete_device
()[source]¶ Clean the device. Called during shutdown and every time the tango
Init
command is executed. Override when necessary but always call the method from your super class
-
is_Abort_allowed
()[source]¶ Returns True if it is allowed to execute the tango abort command
Returns: True if it is allowed to execute the tango abort command or False otherwise Return type: bool
-
is_Stop_allowed
()[source]¶ Returns True if it is allowed to execute the tango stop command
Returns: True if it is allowed to execute the tango stop command or False otherwise Return type: bool
-
get_dynamic_attributes
()[source]¶ Returns the standard dynamic and fully dynamic attributes for this device. The return is a tuple of two dictionaries:
- standard attributes: caseless dictionary with key being the attribute name and value is a tuple of attribute name(str), tango information, attribute information
- dynamic attributes: caseless dictionary with key being the attribute name and value is a tuple of attribute name(str), tango information, attribute information
- tango information
- seq<
CmdArgType
,AttrDataFormat
,AttrWriteType
> - attribute information
- attribute information as returned by the sardana controller
Returns: the standard dynamic and fully dynamic attributes Return type: seq< CaselessDict
,CaselessDict
>
-
remove_unwanted_dynamic_attributes
(new_std_attrs, new_dyn_attrs)[source]¶ Removes unwanted dynamic attributes from previous device creation
-
add_dynamic_attribute
(attr_name, data_info, attr_info, read, write, is_allowed)[source]¶ Adds a single dynamic attribute
Parameters: - attr_name (str) – the attribute name
- data_info (seq<
CmdArgType
,AttrDataFormat
,AttrWriteType
>) – tango attribute information - attr_info – attribute information
- read – read method for the attribute
- write – write method for the attribute
- is_allowed – is allowed method
-
add_standard_attribute
(attr_name, data_info, attr_info, read, write, is_allowed)[source]¶ Adds a single standard dynamic attribute
Parameters: - attr_name (str) – the attribute name
- data_info (seq<
CmdArgType
,AttrDataFormat
,AttrWriteType
>) – tango attribute information - attr_info – attribute information
- read – read method for the attribute
- write – write method for the attribute
- is_allowed – is allowed method
-
read_DynamicAttribute
(attr)[source]¶ Generic read dynamic attribute. Default implementation raises
NotImplementedError
Parameters: attr ( Attribute
) – attribute to be readRaises: NotImplementedError
-
write_DynamicAttribute
(attr)[source]¶ Generic write dynamic attribute. Default implementation raises
NotImplementedError
Parameters: attr ( Attribute
) – attribute to be writtenRaises: NotImplementedError
-
is_DynamicAttribute_allowed
(req_type)[source]¶ Generic is dynamic attribute allowed. Default implementation calls
_is_allowed()
Parameters: req_type – request type
-
dev_state
()[source]¶ Calculates and returns the device state. Called by Tango on a read state request.
Returns: the device state Return type: DevState
-
dev_status
()[source]¶ Calculates and returns the device status. Called by Tango on a read status request.
Returns: the device status Return type: str
-
wait_for_operation
()[source]¶ Waits for an operation to finish. It uses the maxumum number of retries. Sleeps 0.01s between retries.
Raises: Exception
in case of a timeout
-
PoolDeviceClass¶
-
class
PoolDeviceClass
(name)[source]¶ Bases:
sardana.tango.core.SardanaDevice.SardanaDeviceClass
Base Tango Pool Device Class class
-
class_property_list
= {}¶ Sardana device class properties definition
See also
server
-
device_property_list
= {'Force_HW_Read': [<_mock._Mock object at 0x7f9ba9cba8d0>, 'Force a hardware read of value even when in operation (motion/acquisition', False], 'Id': [<_mock._Mock object at 0x7f9ba9cbaa50>, 'Internal ID', 0]}¶ Sardana device properties definition
See also
server
-
cmd_list
= {'Abort': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']], 'Restore': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']], 'Stop': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']]}¶ Sardana device command definition
See also
server
-
attr_list
= {}¶ Sardana device attribute definition
See also
server
-
standard_attr_list
= {}¶
-
PoolElementDevice¶
-
class
PoolElementDevice
(dclass, name)[source]¶ Bases:
sardana.tango.pool.PoolDevice.PoolDevice
Base Tango Pool Element Device class
-
init_device
()[source]¶ Initialize the device. Called during startup after
init()
and every time the tangoInit
command is executed. Override when necessary but always call the method from your super class
-
read_Instrument
(attr)[source]¶ Read the value of the
Instrument
tango attribute. Returns the instrument full name or empty string if this element doesn’t belong to any instrumentParameters: attr ( Attribute
) – tango instrument attribute
-
write_Instrument
(attr)[source]¶ Write the value of the
Instrument
tango attribute. Sets a new instrument full name or empty string if this element doesn’t belong to any instrument. The instrument must have been previously created.Parameters: attr ( Attribute
) – tango instrument attribute
-
get_dynamic_attributes
()[source]¶ Override of
PoolDevice.get_dynamic_attributes
. Returns the standard dynamic and fully dynamic attributes for this device. The return is a tuple of two dictionaries:- standard attributes: caseless dictionary with key being the attribute name and value is a tuple of attribute name(str), tango information, attribute information
- dynamic attributes: caseless dictionary with key being the attribute name and value is a tuple of attribute name(str), tango information, attribute information
- tango information
- seq<
CmdArgType
,AttrDataFormat
,AttrWriteType
> - attribute information
- attribute information as returned by the sardana controller
Returns: the standard dynamic and fully dynamic attributes Return type: seq< CaselessDict
,CaselessDict
>
-
read_DynamicAttribute
(attr)[source]¶ Read a generic dynamic attribute. Calls the controller of this element to get the dynamic attribute value
Parameters: attr ( Attribute
) – tango attribute
-
write_DynamicAttribute
(attr)[source]¶ Write a generic dynamic attribute. Calls the controller of this element to get the dynamic attribute value
Parameters: attr ( Attribute
) – tango attribute
-
PoolElementDeviceClass¶
-
class
PoolElementDeviceClass
(name)[source]¶ Bases:
sardana.tango.pool.PoolDevice.PoolDeviceClass
Base Tango Pool Element Device Class class
-
device_property_list
= {'Axis': [<_mock._Mock object at 0x7f9ba9cbaa50>, 'Axis in the controller', [0]], 'Ctrl_id': [<_mock._Mock object at 0x7f9ba9cbaa50>, 'Controller ID', [0]], 'Force_HW_Read': [<_mock._Mock object at 0x7f9ba9cba8d0>, 'Force a hardware read of value even when in operation (motion/acquisition', False], 'Id': [<_mock._Mock object at 0x7f9ba9cbaa50>, 'Internal ID', 0], 'Instrument_id': [<_mock._Mock object at 0x7f9ba9cbaa50>, 'Controller ID', [0]]}¶ Sardana device properties definition
See also
server
-
attr_list
= {'Instrument': [[<_mock._Mock object at 0x7f9ba9cbaad0>, <_mock._Mock object at 0x7f9ba9cbb110>, <_mock._Mock object at 0x7f9ba9cbb0d0>], {'Display level': <_mock._Mock object at 0x7f9ba4f5a390>, 'label': 'Instrument'}], 'SimulationMode': [[<_mock._Mock object at 0x7f9ba9cba8d0>, <_mock._Mock object at 0x7f9ba9cbb110>, <_mock._Mock object at 0x7f9ba9cbb0d0>], {'label': 'Simulation mode'}]}¶ Sardana device attribute definition
See also
server
-
cmd_list
= {'Abort': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']], 'Restore': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']], 'Stop': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']]}¶
-
PoolGroupDevice¶
-
class
PoolGroupDevice
(dclass, name)[source]¶ Bases:
sardana.tango.pool.PoolDevice.PoolDevice
Base Tango Pool Group Device class
PoolGroupDeviceClass¶
-
class
PoolGroupDeviceClass
(name)[source]¶ Bases:
sardana.tango.pool.PoolDevice.PoolDeviceClass
Base Tango Pool Group Device Class class
-
device_property_list
= {'Elements': [<_mock._Mock object at 0x7f9ba9cbae50>, 'elements in the group', []], 'Force_HW_Read': [<_mock._Mock object at 0x7f9ba9cba8d0>, 'Force a hardware read of value even when in operation (motion/acquisition', False], 'Id': [<_mock._Mock object at 0x7f9ba9cbaa50>, 'Internal ID', 0]}¶ Sardana device properties definition
See also
server
-
cmd_list
= {'Abort': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']], 'Restore': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']], 'Stop': [[<_mock._Mock object at 0x7f9ba9cbaf50>, ''], [<_mock._Mock object at 0x7f9ba9cbaf50>, '']]}¶ Sardana device command definition
See also
server
-
attr_list
= {'ElementList': [[<_mock._Mock object at 0x7f9ba9cbaad0>, <_mock._Mock object at 0x7f9ba9cbb150>, <_mock._Mock object at 0x7f9ba9cbb050>, 4096]]}¶ Sardana device attribute definition
See also
server
-