fastcs.controllers.controller#

Members

Controller

Controller containing Attributes and named sub Controllers

class fastcs.controllers.controller.Controller(description: str | None = None, ios: Sequence[AttributeIO[Any, AttributeIORef]] | None = None)[source]#

Controller containing Attributes and named sub Controllers

async connect() None[source]#

Hook to perform initial connection to device

This should set _connected to True if the connection was successful to enable scan tasks.

async reconnect()[source]#

Hook to reconnect to device after an error

This should set _connected to True if the connection was successful to enable scan tasks.

If the connection cannot be re-established it should log an error with the reason. It should not raise an exception.

async disconnect() None[source]#

Hook to tidy up resources before stopping the application

create_api_and_tasks() tuple[ControllerAPI, list[Callable[[], Coroutine[None, None, None]]], list[Callable[[], Coroutine[None, None, None]]]][source]#

Create api for transports tasks for FastCS backend

Creates a tuple of
  • The ControllerAPI for this controller

  • Initial coroutines to be run once on startup

  • Periodic coroutines to run as background tasks

Returns:

tuple[ControllerAPI, list[ScanCallback], list[ScanCallback]]