poolcontroller

This module is part of the Python Pool library. It defines the base classes for

Classes

PoolController

Inheritance diagram of PoolController
class PoolController(**kwargs)[source]

Bases: PoolBaseController

Controller class mediator for sardana controller plugins

serialize(*args, **kwargs)[source]
re_init()[source]
get_ctrl_types()[source]
is_timerable()[source]
is_referable()[source]
is_pseudo()[source]
is_online()[source]
get_ctrl()[source]
set_ctrl(ctrl)[source]
property ctrl

actual controller object

get_ctrl_info()[source]
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 (Any) – the new operator object

Return type:

None

get_operator()[source]
property operator

current controller operator

set_log_level(level)[source]
get_log_level()[source]
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

get_library_name()[source]
get_class_name()[source]
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.

Parameters:

attr_values (Optional[Dict[str, Any]]) – map of attribute names and values

Return type:

None

get_axis_attributes(axis)[source]
get_ctrl_attr(name)[source]
set_ctrl_attr(name, value)[source]
get_axis_attr(axis, name)[source]
set_axis_attr(axis, name, value)[source]
set_ctrl_par(name, value)[source]
get_ctrl_par(name)[source]
set_axis_par(axis, name, value)[source]
get_axis_par(axis, name)[source]
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 (Optional[Sequence[int]]) – the list of axis to get the state. Default is None meaning all active axis in this controller

Return type:

Tuple[Dict[PoolElement, Any], bool]

Returns:

a tuple of two elements: a map containing the controller state information for each axis and a boolean telling if an error occured

read_axis_states(axes=None)[source]

Reads the state for the given axes. If axes is None, reads the state of all active axes.

Parameters:

axes (Optional[Sequence[int]]) – the list of axis to get the state. Default is None meaning all active axis in this controller

Return type:

Dict[PoolElement, Any]

Returns:

a map containing the controller state information for each axis

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 (Optional[Sequence[int]]) – the list of axis to get the value. Default is None meaning all active axis in this controller

Return type:

Dict[PoolElement, SardanaValue]

Returns:

a map containing the controller value information for each axis

read_axis_values(axes=None)[source]

Reads the value for the given axes. If axes is None, reads the value of all active axes.

Parameters:

axes (Optional[Sequence[int]]) – the list of axis to get the value. Default is None meaning all active axis in this controller

Return type:

Dict[PoolElement, SardanaValue]

Returns:

a map containing the controller value information for each axis

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 (Optional[Sequence[int]]) – the list of axis to get the value. Default is None meaning all active axis in this controller

Return type:

Dict[PoolElement, SardanaValue]

Returns:

a map containing the controller value information for each axis

stop_axes(axes)[source]

Stops the given axes.

Parameters:

axes (List[int]) – the list of axes to stopped.

Return type:

List[int]

Returns:

list of axes that could not be stopped

stop_element(element)[source]

Stops the given element.

Parameters:

element (PoolElement) – element to stop

Raises:

Exception – not able to stop element

Return type:

None

stop_elements(elements=None)[source]

Stops the given elements. If elements is None, stops all active elements.

Parameters:

elements (Optional[Sequence[PoolElement]]) – the list of elements to stop. Default is None meaning all active elements in this controller

Return type:

List[PoolElement]

Returns:

list of elements that could not be stopped

stop(elements=None)

Stops the given elements. If elements is None, stops all active elements.

Parameters:

elements (Optional[Sequence[PoolElement]]) – the list of elements to stop. Default is None meaning all active elements in this controller

Return type:

List[PoolElement]

Returns:

list of elements that could not be stopped

abort_axes(axes)[source]

Aborts the given axes.

Parameters:

axes (List[int]) – the list of axes to aborted.

Return type:

List[int]

Returns:

list of axes that could not be aborted

abort_element(element)[source]

Aborts the given elements.

Parameters:

element (PoolElement) – element to abort

Raises:

Exception – not able to abort element

Return type:

None

abort_elements(elements=None)[source]

Abort the given elements. If elements is None, stops all active elements.

Parameters:

elements (Optional[Sequence[PoolElement]]) – the list of elements to stop. Default is None meaning all active elements in this controller

Return type:

List[PoolElement]

Returns:

list of elements that could not be aborted

abort(elements=None)

Abort the given elements. If elements is None, stops all active elements.

Parameters:

elements (Optional[Sequence[PoolElement]]) – the list of elements to stop. Default is None meaning all active elements in this controller

Return type:

List[PoolElement]

Returns:

list of elements that could not be aborted

emergency_break(elements=None)[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 (Optional[Any]) – the list of elements to stop. Default is None meaning all active elements in this controller

Return type:

List[PoolElement]

Returns:

elements that could neither be stopped nor aborted

send_to_controller(stream)[source]
raw_move(axis_pos)[source]
move(axis_pos)[source]
has_backlash()[source]
wants_rounding()[source]
define_position(axis, position)[source]
write_one(axis, value)[source]
get_default_timer()[source]

Get default timer as announced by the controller (plug-in).

Only for Timerable controllers, e.g. CounterTimerController, OneDController, TwoDController.

Return type:

Optional[int]

Returns:

axis of the default timer or None if not defined

PoolPseudoMotorController

Inheritance diagram of PoolPseudoMotorController
class PoolPseudoMotorController(**kwargs)[source]

Bases: PoolController

property motor_ids
serialize(*args, **kwargs)[source]
calc_all_pseudo(physical_pos, curr_pseudo_pos)[source]
calc_all_physical(pseudo_pos, curr_physical_pos)[source]
calc_pseudo(axis, physical_pos, curr_pseudo_pos)[source]
calc_physical(axis, pseudo_pos, curr_physical_pos)[source]

PoolPseudoCounterController

Inheritance diagram of PoolPseudoCounterController
class PoolPseudoCounterController(**kwargs)[source]

Bases: PoolController

property counter_ids
serialize(*args, **kwargs)[source]
calc(axis, values)[source]
calc_all(values)[source]