Events

A class representing events in the application. It can be an event provided by the GUI, or by some external source.

Interface

class src.data_acquisition.events.Event(*, logger: Logger | None = None)[source]

Bases: ABC

abstractmethod clone() Event[source]

Method used to create a clone of the event, so that it can be used as a prototype and reused by event managers.

Returns:

A new instance of the same type as this event, with the same configuration.

start_listening() None[source]
stop_listening() None[source]
subscribe(callback: Callable[[], None]) None[source]
unsubscribe(callback: Callable[[], None]) None[source]

How to subclass

Subclasses should implement the following methods:

  • clone() -> Event

  • _start_listening()

  • _stop_listening()

Available properties and methods:

  • _trigger_callback() - should be used to trigger registered callbacks when the event occurs.

Catalog