STAT Process API

Module for providing the API to be communicate with the STAT process.

The PstStatProcessApiSimulator is used in testing or simulation.)

class ska_pst_lmc.stat.stat_process_api.PstStatProcessApi(logger: Logger, component_state_callback: Callable)[source]

Abstract class for the API of the STAT process.

This extends from PstProcessApi but provides the specific method of getting the monitoring data.

Initialise the API.

Parameters
  • simulator – the simulator instance to use in the API.

  • logger – the logger to use for the API.

  • component_state_callback – this allows the API to call back to the component manager / TANGO device to deal with state model changes.

class ska_pst_lmc.stat.stat_process_api.PstStatProcessApiSimulator(logger: Logger, component_state_callback: Callable, simulator: Optional[PstStatSimulator] = None)[source]

A simulator implemenation version of the API of PstStatProcessApi.

Initialise the API.

Parameters
  • logger – the logger to use for the API.

  • component_state_callback – this allows the API to call back to the component manager / TANGO device to deal with state model changes.

  • simulator – the simulator instance to use in the API.

configure_beam(configuration: dict, task_callback: Callable) None[source]

Configure beam resources.

This method is effectively a no-op operation.

Parameters
  • configuration – dictionary of parameters to be configured and their requested values.

  • task_callback – callable to connect back to the component manager.

deconfigure_beam(task_callback: Callable) None[source]

Deconfigure the beam.

This method is effectively a no-op operation.

Parameters

task_callback – callable to connect back to the component manager.

configure_scan(configuration: dict, task_callback: Callable) None[source]

Configure a scan.

Parameters
  • configuration – the configuration of for the scan.

  • task_callback – callable to connect back to the component manager.

deconfigure_scan(task_callback: Callable) None[source]

Deconfigure a scan.

Parameters

task_callback – callable to connect back to the component manager.

start_scan(args: dict, task_callback: Callable) None[source]

Start scanning.

Parameters
  • args – arguments for the scan.

  • task_callback – callable to connect back to the component manager.

stop_scan(task_callback: Callable) None[source]

End a scan.

Parameters

task_callback – callable to connect back to the component manager.

abort(task_callback: Callable) None[source]

Abort a scan.

Parameters

task_callback – callable to connect back to the component manager.

reset(task_callback: Callable) None[source]

Reset service when in ABORTED / FAULT state.

Parameters

task_callback – callable to connect back to the component manager.

class ska_pst_lmc.stat.stat_process_api.PstStatProcessApiGrpc(client_id: str, grpc_endpoint: str, logger: Logger, component_state_callback: Callable, background_task_processor: Optional[BackgroundTaskProcessor] = None)[source]

This is an gRPC implementation of the PstStatProcessApi API.

This uses an instance of a PstGrpcLmcClient to send requests through to the STAT.CORE application. Instances of this class should be per subband, rather than one for all of STAT as a whole.

Initialise the API.

Parameters
  • client_id – the identification of the client, this should be based off the FQDN of the MGMT device.

  • grpc_endpoint – the service endpoint to connect to. As the SMRB.RB instances are for each subband this forces this class to be per subband.

  • logger – the logger to use for the API.

  • component_state_callback – this allows the API to call back to the component manager / TANGO device to deal with state model changes.

  • background_task_processor – an optional background processor that will run background tasks like monitor.