poolcontroller
This module is part of the Python Pool library. It defines the base classes for
Classes
PoolController
- class PoolController(**kwargs)[source]
Bases:
PoolBaseController
Controller class mediator for sardana controller plugins
- property ctrl
actual controller object
- property ctrl_info
controller information object
- set_operator(operator)[source]
Defines the current operator object for this controller. For example, in acquisition, it should be a
PoolMeasurementGroup
object.- Parameters:
operator (object) – the new operator object
- property operator
current controller operator
- property log_level
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
- init_attribute_values(attr_values=None)[source]
Initialize attributes with (default) values.
Set values to attributes as passed in
attr_values
. In lack of attribute value apply default value. In lack of default value do nothing.
- raw_read_axis_states(axes=None, ctrl_states=None)[source]
Unsafe method. Reads the state for the given axes. If axes is None, reads the state of all active axes.
- Parameters:
axes (seq<int> or None) – the list of axis to get the state. Default is None meaning all active axis in this controller
- Returns:
a tuple of two elements: a map containing the controller state information for each axis and a boolean telling if an error occured
- Return type:
dict<PoolElement, state info>, bool
- read_axis_states(pool_ctrl, *args, **kwargs)[source]
Reads the state for the given axes. If axes is None, reads the state of all active axes.
- Parameters:
axes (seq<int> or None) – the list of axis to get the state. Default is None meaning all active axis in this controller
- Returns:
a map containing the controller state information for each axis
- Return type:
dict<PoolElement, state info>
- raw_read_axis_values(axes=None, ctrl_values=None)[source]
Unsafe method. Reads the value for the given axes. If axes is None, reads the value of all active axes.
- Parameters:
axes (seq<int> or None) – the list of axis to get the value. Default is None meaning all active axis in this controller
- Returns:
a map containing the controller value information for each axis
- Return type:
dict<PoolElement, SardanaValue>
- read_axis_values(pool_ctrl, *args, **kwargs)[source]
Reads the value for the given axes. If axes is None, reads the value of all active axes.
- Parameters:
axes (seq<int> or None) – the list of axis to get the value. Default is None meaning all active axis in this controller
- Returns:
a map containing the controller value information for each axis
- Return type:
dict<PoolElement, SardanaValue>
- raw_read_axis_value_refs(axes=None, ctrl_values=None)[source]
Unsafe method. Reads the value refs for the given axes. If axes is None, reads the value of all active axes.
Note
The raw_read_axis_value_refs method has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including removal of the class) may occur if deemed necessary by the core developers.
Todo
This method should be available only on the controllers which are referable.
- Parameters:
axes (seq<int> or None) – the list of axis to get the value. Default is None meaning all active axis in this controller
- Returns:
a map containing the controller value information for each axis
- Return type:
dict<PoolElement, SardanaValue>
- stop_axes(axes)[source]
Stops the given axes.
- Parameters:
axes (list<axes>) – the list of axes to stopped.
- Returns:
list of axes that could not be stopped
- Return type:
list<int>
- stop_element(pool_ctrl, *args, **kwargs)[source]
Stops the given element.
- Parameters:
element (PoolElement) – element to stop
- Raises:
Exception – not able to stop element
- stop_elements(pool_ctrl, *args, **kwargs)[source]
Stops the given elements. If elements is None, stops all active elements.
- Parameters:
elements (seq<PoolElement> or None) – the list of elements to stop. Default is None meaning all active elements in this controller
- Returns:
list of elements that could not be stopped
- Return type:
list<PoolElements>
- stop(pool_ctrl, *args, **kwargs)
Stops the given elements. If elements is None, stops all active elements.
- Parameters:
elements (seq<PoolElement> or None) – the list of elements to stop. Default is None meaning all active elements in this controller
- Returns:
list of elements that could not be stopped
- Return type:
list<PoolElements>
- abort_axes(pool_ctrl, *args, **kwargs)[source]
Aborts the given axes.
- Parameters:
axes (list<axes>) – the list of axes to aborted.
- Returns:
list of axes that could not be aborted
- Return type:
list<int>
- abort_element(pool_ctrl, *args, **kwargs)[source]
Aborts the given elements.
- Parameters:
element (PoolElement) – element to abort
- Raises:
Exception – not able to abort element
- abort_elements(pool_ctrl, *args, **kwargs)[source]
Abort the given elements. If elements is None, stops all active elements.
- Parameters:
elements (seq<PoolElement> or None) – the list of elements to stop. Default is None meaning all active elements in this controller
- Returns:
list of elements that could not be aborted
- Return type:
list<PoolElements>
- abort(pool_ctrl, *args, **kwargs)
Abort the given elements. If elements is None, stops all active elements.
- Parameters:
elements (seq<PoolElement> or None) – the list of elements to stop. Default is None meaning all active elements in this controller
- Returns:
list of elements that could not be aborted
- Return type:
list<PoolElements>
- emergency_break(pool_ctrl, *args, **kwargs)[source]
Stops the given elements. If elements is None, stops all active elements. If stop could not be executed, an abort is attempted.
- Parameters:
elements – the list of elements to stop. Default is None meaning all active elements in this controller
- Returns:
elements that could neither be stopped nor aborted
- Return type:
list<PoolElement>
- get_default_timer()[source]
Get default timer as announced by the controller (plug-in).
Only for Timerable controllers, e.g.
CounterTimerController
,OneDController
,TwoDController
.
PoolPseudoMotorController
- class PoolPseudoMotorController(**kwargs)[source]
Bases:
PoolController
- property motor_ids