Polling component manager

This module provides a polling component manager.

class PollingComponentManager(logger: Logger, communication_state_callback: Callable[[CommunicationStatus], None], component_state_callback: Callable[[...], None], poll_rate: float = 0.1, **kwargs: Any)[source]

Abstract base class for a component manager that polls its component.

start_communicating() None[source]

Start polling the component.

polling_started() None[source]

Respond to polling having started.

This is a hook called by the poller when it starts polling.

stop_communicating() None[source]

Stop polling the spectrum analyser.

polling_stopped() None[source]

Respond to polling having stopped.

This is a hook called by the poller when it stops polling.

poll_failed(exception: Exception) None[source]

Respond to an exception being raised by a poll attempt.

This is a hook called by the poller when an exception occurs.

Parameters:

exception – the exception that was raised by a recent poll attempt.

poll_succeeded(poll_response: PollResponseT) None[source]

Handle a successful poll, including any values received.

This is a hook called by the poller at the end of each successful poll.

Parameters:

poll_response – response to the poll, including any values received.

get_request() PollRequestT[source]

Return the reads and writes to be executed in the next poll.

Raises:

NotImplementedError – because this class is abstract.

Returns:

reads and writes to be executed in the next poll.

poll(poll_request: PollRequestT) PollResponseT[source]

Poll the hardware.

Connect to the hardware, write any values that are to be written, and then read all values.

Parameters:

poll_request – specification of the reads and writes to be performed in this poll.

Raises:

NotImplementedError – because this class is abstract.

Returns:

responses to queries in this poll