doocspie.abo

This subpackages provides the modules for higher level synchronous readout from DOOCS.

train_abo

Module with train abo class for higher level synchronous readout from DOOCS.

This module provides the train abo class for higher level synchronous readout from DOOCS.

class doocspie.abo.train_abo.TrainAbo(properties=None, train_events=None, timeout_seconds=10, buffer_size=32, allow_zero_events=False)

TrainAbo class for higher level synchronous readout from DOOCS.

This class provides the train abo for higher level synchronous readout from DOOCS.

__init__(properties=None, train_events=None, timeout_seconds=10, buffer_size=32, allow_zero_events=False)

Constructor of the train abo class.

This constructor initializes the instance with optional parameters (see ‘Args’ below).

Parameters:
  • properties (tuple or dict, optional) – The optional properties to get train events with readouts for.

  • train_events (int, optional) – The optional number of train events to synchronously readout.

  • timeout_seconds (int) – The optional timeout seconds for unsuccessful readout.

  • buffer_size (int) – The optional number of buffers to be used for storing previous readouts.

  • allow_zero_events (bool, optional) – The optional state for allow zero train events.

__next__()

Special method to provide the next train event for the train abo iterator.

__iter__()

Special method to provide a train abo iterator.

__str__()

Special method to return a properly formatted string representation of the train abo.

property train_events

The number of total train events in the train abo.

Type:

int

property train_event

The number of the current train event in the train abo.

Type:

int

property usable_properties

The properties that can be used for synchronized readout in the train abo.

Type:

tuple

property unusable_properties

The properties that cannot be used for synchronized readout in the train abo.

Type:

tuple

property zero_event_properties

The properties that have an event number of ‘zero’.

Type:

tuple

property actual_properties

The properties that can actually be readout and returned via TrainEvent’s ‘get’.

Type:

tuple

add(address, label=None, offset=None, timestamp_event=None, meta_event=None, start=None, elements=None)

Add address with optional parameters to the properties for synchronous readout.

Parameters:
  • address (str) – The DOOCS address to add to the properties for synchronous readout.

  • label (str, optional) – Optional label for DOOCS address as a means for alternative property access.

  • offset (int, optional) – Optional offset to be applied on event numbers for synchronization.

  • timestamp_event (bool, optional) – Optional state to determine using the timestamp as an alternative event.

  • meta_event (str, optional) – Optional Meta property to replace the default event with.

  • start (int, optional) – Optional start position for reading out array-like types.

  • elements (int, optional) – Optional number of elements to read out for array-like types.

Returns:

None

Raises:

DoocspieException – Doocspie related exception for address duplication.

update()

Update the newly added properties for synchronous readout.

Returns:

None

reset()

Reset the train abo in order to use it again.

Returns:

None

start_loop(function)

Start the loop the train abo and execute the given function once there is a new train event.

Parameters:

function (function) – The function to execute for a new train event.

Returns:

None

stop_loop()

Stop the loop of the train abo and its execution of the supplied function.

Returns:

None

train_event

Module with train event class for higher level synchronous readout from DOOCS.

This module provides the train event class for higher level synchronous readout from DOOCS.

class doocspie.abo.train_event.TrainEvent(readouts, properties)

TrainEvent class for higher level synchronous readout from DOOCS.

This class provides the train event for higher level synchronous readout from DOOCS.

__init__(readouts, properties)

Constructor of the train event class.

This constructor initializes the instance using the readouts and its related properties.

Parameters:
  • readouts (dict) – The readouts for the related properties.

  • properties (tuple) – The properties related to the readouts.

__str__()

Special method to return a properly formatted string representation of the train event.

property properties

The properties that can be returned via ‘get’.

Type:

tuple

property id

The id of the current train event.

Type:

int

get(property)

Get the readout from the train event for the given property.

Parameters:

property (str) – The property for the readout to get from the train event.

Returns:

An instance of the readout object for the requested property.

Return type:

Readout

Raises:

DoocspieException – Doocspie related exception for non-existing property requested.

synchronizer

Module with synchronizer class for higher level synchronous readout from DOOCS.

This module provides the synchronizer class for higher level synchronous readout from DOOCS.

class doocspie.abo.synchronizer.Synchronizer(properties=None, timeout_seconds=10, buffer_size=32, allow_zero_events=False)

Synchronizer class for higher level synchronous readout from DOOCS.

This class provides the synchronizer for higher level synchronous readout from DOOCS.

__init__(properties=None, timeout_seconds=10, buffer_size=32, allow_zero_events=False)

Constructor of the synchronizer class.

This constructor initializes the instance with optional parameters (see ‘Args’ below).

Parameters:
  • properties (tuple or dict, optional) – The optional properties to get train events with readouts for.

  • timeout_seconds (int) – The optional timeout seconds for unsuccessful readout.

  • buffer_size (int) – The optional number of buffers to be used for storing previous readouts.

  • allow_zero_events (bool, optional) – The optional state for allow zero train events.

__str__()

Special method to return a properly formatted string representation of the synchronizer.

property timeout_seconds

The timeout seconds for unsuccessful readout.

Type:

int

property usable_properties

The properties that can be used for synchronized readout in the train abo.

Type:

tuple

property unusable_properties

The properties that cannot be used for synchronized readout in the train abo.

Type:

tuple

property zero_event_properties

The properties that have an event number of ‘zero’.

Type:

tuple

property actual_properties

The properties that can actually be readout.

Type:

tuple

update()

Update the newly added properties for synchronous readout.

Returns:

None

add(address, label=None, offset=None, timestamp_event=None, meta_event=None, start=None, elements=None)

Add address with optional parameters to the properties for synchronous readout.

Parameters:
  • address (str) – The DOOCS address to add to the properties for synchronous readout.

  • label (str, optional) – Optional label for DOOCS address as a means for alternative property access.

  • offset (int, optional) – Optional offset to be applied on event numbers for synchronization.

  • timestamp_event (bool, optional) – Optional state to determine using the timestamp as an alternative event.

  • meta_event (str, optional) – Optional Meta property to replace the default event with.

  • start (int, optional) – Optional start position for reading out array-like types.

  • elements (int, optional) – Optional number of elements to read out for array-like types.

Returns:

None

Raises:

DoocspieException – Doocspie related exception for address duplication.

get()

Get the synchronous readouts mapped by its address or label for the particular properties.

Returns:

The address (key) and readout (value) for the particular properties.

Return type:

dict

Raises:

DoocspieException – Doocspie related exception for synchronization timeout or no usable properties.

get_event_matched_readouts()

Get the event matched readouts mapped by its address or label for the particular properties.

Returns:

The address (key) and readout (value) for the particular properties.

Return type:

dict

get_label_of(source)

Get the optional label of the given source.

Parameters:

source (str) – The source to get the label for.

Returns:

The optional label of the given source.

Return type:

str