Base Component Manager

This module provides the base Component Manager fror PST.LMC.

class ska_pst_lmc.component.component_manager.PstApiComponentManager(*args: Any, **kwargs: Any)[source]

A base component Manager for the PST.LMC. that uses an API.

Instances of this component manager are required to provide an instance of a PstProcessApi to delegate functionality to. If the simulation mode changes then the instances are expected to handle changing between a simulation API and a real implementation of the API; the interface for the simulation and real API are to be the same.

Only components that use an external process, such as RECV and SMRB are to be extended from this class. Components such as BEAM need to use PstComponentManager as they don’t use a process API.

Initialise instance of the component manager.

Parameters
  • device_name (str) – the FQDN of the current device. This is used within the gRPC process to identify who is doing the calling.

  • api (PstProcessApi) – an API object used to delegate functionality to.

  • logger (logging.Logger) – a logger for this object to use

  • communication_status_changed_callback (Callable) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_fault_callback (Callable) – callback to be called when the component faults (or stops faulting)

property monitoring_polling_rate: int

Get current monitoring polling rate in milliseconds.

property api_endpoint: str

Get the API endpoint.

configure_beam(configuration: Dict[str, Any], task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Configure the beam resources of the component.

Parameters
  • configuration (Dict[str, Any]) – configuration to be assigned

  • task_callback (Callback) – callback for background processing to update device status.

deconfigure_beam(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Deconfigure the component’s beam configuration.

This will release all the resources associated with the component, including the SMRBs.

Parameters

task_callback (Callback) – callback for background processing to update device status.

configure_scan(configuration: Dict[str, Any], task_callback: Optional[Callable[[...], Any]]) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Configure the component for a scan.

Parameters
  • configuration (Dict[str, Any]) – the configuration to be configured

  • task_callback (Callback) – callback for background processing to update device status.

deconfigure_scan(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Deconfigure this component for current scan configuration.

Parameters

task_callback (Callback) – callback for background processing to update device status.

start_scan(args: Dict[str, Any], task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Start scanning.

Parameters
  • args (Dict[str, Any]) – scan arguments (i.e start time)

  • task_callback (Callback) – callback for background processing to update device status.

stop_scan(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Stop scanning.

abort(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Abort current process.

The only long lived process for API based devices is that of SCANNING. However, if another system fails this can be used to put all the subsystems into an ABORTED state.

obsreset(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Reset service.

This is used to reset a service in ABORTED or FAULT states back to an IDLE state. This will deconfigure a scan if already configured but will keep the assigned resources.

go_to_fault(fault_msg: str, task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Put the service into a FAULT state.

set_logging_level(log_level: ska_tango_base.control_model.LoggingLevel) None[source]

Set the LoggingLevel of the service.

class ska_pst_lmc.component.component_manager.PstComponentManager(*args: Any, **kwargs: Any)[source]

Base Component Manager for the PST.LMC. subsystem.

This base class is used to provide the common functionality of the PST TANGO components, such as providing the the communication with processes that are running (i.e. RECV, DSP, or SMRB).

This class also helps abstract away calling out to whether we’re using a simulated process or a real subprocess.

This component manager extects from the CspObsComponentManager. For more details about this check the CSP obs component manager docs.

Initialise instance of the component manager.

Parameters
  • device_name (str) – the FQDN of the current device. This is used within the gRPC process to identify who is doing the calling.

  • simulation_mode (SimulationMode) – enum to track if component should be in simulation mode or not.

  • logger (logging.Logger) – a logger for this object to use

  • communication_status_changed_callback (Callable) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_fault_callback (Callable) – callback to be called when the component faults (or stops faulting)

  • beam_id (int) – the ID of the beam that this component manger is for. The default value is 1 (used for testing).

property beam_id: int

Return the beam id for the current component.

This value is set during the construction of the component manager, and is injected from the DeviceID property of the TANGO device.

property device_name: str

Get the name of the current device.

start_communicating() None[source]

Establish communication with the component, then start monitoring.

This is the place to do things like:

  • Initiate a connection to the component (if your communication is connection-oriented)

  • Subscribe to component events (if using “pull” model)

  • Start a polling loop to monitor the component (if using a “push” model)

stop_communicating() None[source]

Cease monitoring the component, and break off all communication with it.

For example,

  • If you are communicating over a connection, disconnect.

  • If you have subscribed to events, unsubscribe.

  • If you are running a polling loop, stop it.

property simulation_mode: ska_tango_base.control_model.SimulationMode

Get value of simulation mode state.

Returns

current simulation mode state.

property config_id: str

Return the configuration id.

property scan_id: int

Return the scan id.

off(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Turn the component off.

Parameters

task_callback – callback to be called when the status of the command changes

standby(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Put the component into low-power standby mode.

Parameters

task_callback – callback to be called when the status of the command changes

on(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Turn the component on.

Parameters

task_callback – callback to be called when the status of the command changes

reset(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str]

Reset the component (from fault state).

Parameters

task_callback – callback to be called when the status of the command changes

validate_configure_scan(configuration: Dict[str, Any], task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Validate configure scan request with the specific configuration of the component.

Note this is for the whole ConfigureScan request for a PST BEAM component, which includes checking both the beam and scan configuration is correct. This is due to the fact that clients of BEAM.MGMT only exposes a ConfigureScan request as it’s an Obs device.

Parameters
  • configuration (Dict[str, Any]) – configuration for scan.

  • task_callback (Callback) – callback for background processing to update device status.

configure_beam(configuration: Dict[str, Any], task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Configure the beam specific configuration of the component.

Parameters
  • configuration (Dict[str, Any]) – configuration for beam

  • task_callback (Callback) – callback for background processing to update device status.

deconfigure_beam(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Deconfigure the component’s beam configuration.

This will release all the resources associated with the component, including the SMRBs.

Parameters

task_callback (Callback) – callback for background processing to update device status.

configure_scan(configuration: Dict[str, Any], task_callback: Optional[Callable[[...], Any]]) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Configure the component for a scan.

Parameters
  • configuration (Dict[str, Any]) – the configuration to be configured

  • task_callback (Callback) – callback for background processing to update device status.

deconfigure(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Deconfigure this component for current scan configuration.

Deprecated since version 0.2.2: Use deconfigure_scan()

Parameters

task_callback (Callback) – callback for background processing to update device status.

deconfigure_scan(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Deconfigure this component for current scan configuration.

Parameters

task_callback (Callback) – callback for background processing to update device status.

scan(scan_id: int, task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Start scanning.

Deprecated since version 0.2.2: Use start_scan()

Parameters
  • scan_id (int) – the ID for the scan that is to be performed.

  • task_callback (Callable) – callback for background processing to update device status.

start_scan(args: Dict[str, Any], task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Start scanning.

Parameters
  • args (Dict[str, Any]) – scan arguments (i.e start time)

  • task_callback (Callback) – callback for background processing to update device status.

end_scan(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Stop scanning.

Deprecated since version 0.2.2: Use stop_scan()

Parameters

task_callback (Callback) – callback for background processing to update device status.

stop_scan(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Stop scanning.

Parameters

task_callback (Callback) – callback for background processing to update device status.

obsreset(task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Reset the component to unconfigured but do not release resources.

go_to_fault(fault_msg: str, task_callback: Optional[Callable[[...], Any]] = None) Tuple[ska_tango_base.executor.TaskStatus, str][source]

Set the component into a FAULT state.

For BEAM this will make the sub-devices be put into a FAULT state. For API backed component managers it is expected that the service backing that API should be put into a FAULT state.

set_logging_level(log_level: ska_tango_base.control_model.LoggingLevel) None[source]

Set LoggingLevel.

Parameters

log_level – The required TANGO LoggingLevel

Returns

None.