poolsynchronization

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

Classes

  • MultipleSynchDescription

PoolSynchronization

Inheritance diagram of PoolSynchronization
class PoolSynchronization(main_element, name='Synchronization')[source]

Bases: PoolAction

Synchronization action.

It coordinates trigger/gate elements and software synchronizer.

add_listener(listener)[source]
start_action(ctrls, multi_synch_description, moveable=None, software_synchronizer_initial_domain=None, *args, **kwargs)[source]

Start synchronization action.

Parameters:
Return type:

None

is_triggering(states)[source]

Determines if we are synchronizing or not based on the states returned by the controller(s) and the software synchronizer.

Parameters:

states (Dict[PoolElement, Tuple[Tuple[int, str], str]]) – a map containing state information as returned by read_state_info: ((state, status), exception_error)

Return type:

bool

Returns:

returns True if is triggering or False otherwise

action_loop()[source]

action_loop method

SynchDescription

Inheritance diagram of SynchDescription
class SynchDescription(*args, **kwargs)[source]

Bases: list

Synchronization description. It is composed from groups - repetitions of equidistant synchronization events. Each group is described by SynchParam parameters which may have values in SynchDomain domains.

property repetitions
property delay_time
property active_time
property total_time
property passive_time
property integration_time
to_dial(sign, offset)[source]

Convert position domain group parameters to dial position

Maintain time domain group parameters (if present) as they are.

Formula is: pos = sign * dial + offset.

Parameters:
  • sign (int) – sign (1 or -1) to apply in the formula

  • offset (float) – offset to apply in the formula

Return type:

SynchDescription

Returns:

new synchronization description in dial position

MultiSynchDescription

Inheritance diagram of MultiSynchDescription
class MultiSynchDescription(*args, **kwargs)[source]

Bases: dict

Multiple synchronization descriptions. It is formed from pairs of Synchronizer names and SynchDescription objects. A dictionary must be provided where keys are the synchronizer names as strings and values are either a SynchDescription object or the equivalent List.

To assign a description to software synchronized elements, use the key "software".

update(*args, **kwargs)[source]

Cast dictionary values to SynchDescription objects.

static from_json(synch_description_json)[source]

JSON decode multi synchronization description data structure and return MultiSynchDescription.

Parameters:

synch_description_json (str) – json-like multiple synchronization description

Return type:

MultiSynchDescription

Returns:

new multi synchronization description

Todo

At some point remove the backwards compatibility for memorized values created with Python 2. In Python 2 IntEnum was serialized to “<class>.<attr>” e.g. “SynchDomain.Time” and we were using a class method fromStr to interpret the enumeration objects.