poolaction
¶
This module is part of the Python Pool libray. It defines the class for an abstract action over a set of pool elements
Functions
Classes
-
get_thread_pool
()[source]¶ Returns the global pool of threads for Sardana
- Returns
the global pool of threads object
- Return type
taurus.core.util.ThreadPool
PoolAction¶

-
class
PoolAction
(main_element, name='GlobalAction')[source]¶ Bases:
taurus.core.util.log.Logger
A generic class to handle any type of operation (like motion or acquisition)
-
OperationContextClass
¶ alias of
OperationContext
-
get_main_element
()[source]¶ Returns the main element for this action
- Returns
sardana.pool.poolelement.PoolElement
-
property
main_element
¶ Returns the main element for this action
- Returns
sardana.pool.poolelement.PoolElement
-
property
pool
¶ Returns the pool object for this action
- Returns
sardana.pool.pool.Pool
-
add_element
(element)[source]¶ Adds a new element to this action.
- Parameters
element (sardana.pool.poolelement.PoolElement) – the new element to be added
-
remove_element
(element)[source]¶ Removes an element from this action. If the element is not part of this action, a ValueError is raised.
- Parameters
element (sardana.pool.poolelement.PoolElement) – the new element to be removed
- Raises
ValueError
-
get_elements
(copy_of=False)[source]¶ Returns a sequence of all elements involved in this action.
- Parameters
copy_of (bool) – If False (default) the internal container of elements is returned. If True, a copy of the internal container is returned instead
- Returns
a sequence of all elements involved in this action.
- Return type
seq<sardana.pool.poolelement.PoolElement>
-
get_pool_controller_list
()[source]¶ Returns a list of all controller elements involved in this action.
- Returns
a list of all controller elements involved in this action.
- Return type
list<sardana.pool.poolelement.PoolController>
-
get_pool_controllers
()[source]¶ Returns a dict of all controller elements involved in this action.
- Returns
a dict of all controller elements involved in this action.
- Return type
dict<sardana.pool.poolelement.PoolController, seq<sardana.pool.poolelement.PoolElement>>
-
is_running
()[source]¶ Determines if this action is running or not
- Returns
True if action is running or False otherwise
- Return type
bool
-
start_action
(*args, **kwargs)[source]¶ Start procedure for this action. Default implementation raises NotImplementedError
- Raises
NotImplementedError
-
set_finish_hooks
(hooks)[source]¶ Set finish hooks for this action.
- Parameters
hooks (OrderedDict or None) – an ordered dictionary where keys are the hooks and values is a flag if the hook is permanent (not removed after the execution)
-
add_finish_hook
(hook, permanent=True)[source]¶ Append one finish hook to this action.
- Parameters
hook (callable) – hook to be appended
permanent (boolean) – flag if the hook is permanent (not removed after the execution)
-
finish_action
()[source]¶ Finishes the action execution. If a finish hook is defined it safely executes it. Otherwise nothing happens
-
was_stopped
()[source]¶ Determines if the action has been stopped from outside
- Returns
True if action has been stopped from outside or False otherwise
- Return type
bool
-
was_aborted
()[source]¶ Determines if the action has been aborted from outside
- Returns
True if action has been aborted from outside or False otherwise
- Return type
bool
-
was_action_interrupted
()[source]¶ Determines if the action has been interruped from outside (either from an abort or a stop).
- Returns
True if action has been interruped from outside or False otherwise
- Return type
bool
-
action_loop
()[source]¶ Action loop for this action. Default implementation raises NotImplementedError
- Raises
NotImplementedError
-
read_state_info
(ret=None, serial=False)[source]¶ Reads state information of all elements involved in this action
- Parameters
ret (dict) – output map parameter that should be filled with state information. If None is given (default), a new map is created an returned
serial (bool) – If False (default) perform controller HW state requests in parallel. If True, access is serialized.
- Returns
a map containing state information per element
- Return type
dict<sardana.pool.poolelement.PoolElement, stateinfo>
-
raw_read_state_info
(ret=None, serial=False)[source]¶ Unsafe. Reads state information of all elements involved in this action
- Parameters
ret (dict) – output map parameter that should be filled with state information. If None is given (default), a new map is created an returned
serial (bool) – If False (default) perform controller HW state requests in parallel. If True, access is serialized.
- Returns
a map containing state information per element
- Return type
dict<sardana.pool.poolelement.PoolElement, stateinfo>
-
read_value
(ret=None, serial=False)[source]¶ Reads value information of all elements involved in this action
- Parameters
ret (dict) – output map parameter that should be filled with value information. If None is given (default), a new map is created an returned
serial (bool) – If False (default) perform controller HW value requests in parallel. If True, access is serialized.
- Returns
a map containing value information per element
- Return type
dict<:class:~`sardana.pool.poolelement.PoolElement`, (value object, Exception or None)>
-
raw_read_value
(ret=None, serial=False)[source]¶ Unsafe. Reads value information of all elements involved in this action
- Parameters
ret (dict) – output map parameter that should be filled with value information. If None is given (default), a new map is created an returned
serial (bool) – If False (default) perform controller HW value requests in parallel. If True, access is serialized.
- Returns
a map containing value information per element
- Return type
dict<:class:~`sardana.pool.poolelement.PoolElement,
sardana.sardanavalue.SardanaValue
>
-
read_value_loop
(ret=None, serial=False)[source]¶ Reads value information of all elements involved in this action
- Parameters
ret (dict) – output map parameter that should be filled with value information. If None is given (default), a new map is created an returned
serial (bool) – If False (default) perform controller HW value requests in parallel. If True, access is serialized.
- Returns
a map containing value information per element
- Return type
dict<:class:~`sardana.pool.poolelement.PoolElement`, (value object, Exception or None)>
-
raw_read_value_loop
(ret=None, serial=False)[source]¶ Unsafe. Reads value information of all elements involved in this action
- Parameters
ret (dict) – output map parameter that should be filled with value information. If None is given (default), a new map is created an returned
serial (bool) – If False (default) perform controller HW value requests in parallel. If True, access is serialized.
- Returns
a map containing value information per element
- Return type
dict<:class:~`sardana.pool.poolelement.PoolElement,
sardana.sardanavalue.SardanaValue
>
-
OperationInfo¶

PoolActionItem¶
