Class DspLmcServiceHandler

Inheritance Relationships

Base Type

Class Documentation

class DspLmcServiceHandler : public ska::pst::common::LmcServiceHandler

Class to act as a bridge between the local monitoring and control of invidual DSP subcomponents (e.g. DSP.DISK, DSP.FT, etc) by routing gRPC requests to the LMC service handler for the correct DSP subcomponent.

Public Functions

inline DspLmcServiceHandler(std::shared_ptr<ska::pst::common::LmcServiceHandler> _dsp_disk_lmc, std::shared_ptr<ska::pst::common::LmcServiceHandler> _dsp_ft_lmc, std::shared_ptr<ska::pst::common::LmcServiceHandler> _dsp_df_lmc)

Construct a new DSP Lmc Service Handler object.

Parameters
  • _dsp_disk_lmc – the LmcServiceHandler object the LMC service handler for DSP.DISK

  • _dsp_ft_lmc – the LmcServiceHandler object the LMC service handler for DSP.FT

  • _dsp_df_lmc – the LmcServiceHandler object the LMC service handler for DSP.DF

virtual ~DspLmcServiceHandler() = default

Destroy the DSP Lmc Service Handler object.

virtual void validate_beam_configuration(const ska::pst::lmc::BeamConfiguration &configuration) override

Validate a beam configuration.

Validate a beam configuration for correctness but does not apply the configuration.

Throws
  • std::exception – if there is a problem with the beam configuration of the service.

  • ska::pst::common::pst_validation_error – if there are validation errors in the request.

virtual void validate_scan_configuration(const ska::pst::lmc::ScanConfiguration &configuration) override

Validate a scan configuration.

Validate a scan configuration for correctness but does not apply the configuration.

Throws
  • std::exception – if there is a problem with the scan configuration of the service.

  • ska::pst::common::pst_validation_error – if there are validation errors in the request.

virtual void configure_beam(const ska::pst::lmc::BeamConfiguration &configuration) override

Handle configuring the service to be a part of a beam.

This implementation checks the ‘pst_processing_mode’ of the configuration object and then delegates to the correct subordinate LMC service handler. Upon successful configuration of the DSP subcomponent this method will delegate future requests to the configured DSP subcomponent.

Parameters

configuration – the configuration for the beam, which should include a ‘dsp’ sub-field message.

Throws

ska::pst::common::LmcServiceException – if resources had already been assigned.

virtual void deconfigure_beam() override

Handle deconfiguring the service from a beam.

This calls the ska::pst::common::LmcServiceHandler::deconfigure_beam based on the current PST processing mode.

Throws

ska::pst::common::LmcServiceException – if manager is not beam configured.

virtual void get_beam_configuration(ska::pst::lmc::BeamConfiguration *resources) override

Handle getting the current beam configuration for the service.

This will delegate getting the current beam configuration from the subordinate DSP LMC service handler based on the current PST processing mode.

Parameters

resources – the protobuf message to used to return beam configuration details.

Throws

ska::pst::common::LmcServiceException – if manager is not beam configured.

virtual bool is_beam_configured() const noexcept override

Check if this service is configured for a beam.

Will return true if the DspLmcServiceHandler has beam configuration.

virtual void configure_scan(const ska::pst::lmc::ScanConfiguration &configuration) override

Handle configuring the service for a scan.

This will configure the DspLmcServiceHandler for a scan. This will delegate to the active DSP LMC service handler based on the PST processing mode that was provided in the configure_beam command.

Parameters

configuration – a protobuf message that should have a valid DSP sub-message set.

Throws

ska::pst::common::LmcServiceException – if manager is not beam configured, configuration parameter doesn’t have a valid DSP sub-message, or that the underlying DSP sub-component application manager is already configured for a scan.

virtual void deconfigure_scan() override

Handle deconfiguring service for a scan.

This will deconfigure the DspLmcServiceHandler for a scan.

Throws

ska::pst::common::LmcServiceException – if manager is not configured for a scan.

virtual void get_scan_configuration(ska::pst::lmc::ScanConfiguration *configuration) override

Handle getting the current scan configuration for the service.

This will return a valid DSP sub-field message with the current scan configuration.

Parameters

configuration – the out protobuf message to used to return scan configuration details.

Throws

ska::pst::common::LmcServiceException – if manager is configured for a scan.

virtual bool is_scan_configured() const noexcept override

Check if the service has been configured for a scan.

Returns

This will return true if DspLmcServiceHandler is configured for a scan.

virtual void start_scan(const ska::pst::common::AsciiHeader &start_scan_config) override

Handle initiating a scan.

This will delegate to the start_scan method on the currently active DSP LMC service handler

Throws

ska::pst::common::LmcServiceException – if manager is not configured for a scan, or is already scanning.

virtual void stop_scan() override

Handle ending a scan.

This will delegate to the stop_scan method on the currently active DSP LMC service handler

Throws

ska::pst::common::LmcServiceException – if service is not scanning.

virtual void abort() override

Performs the abort command on the currently active DSP sub-component.

This method will set the state of the ApplicationManager into ABORTED

virtual void reset() override

Handle resetting State into Idle.

This ties the states between LmcService ObsState::EMPTY with ApplicationManager State::Idle

virtual void restart() override

Handle restarting the Service.

Calls ApplicationManager quit() then force_exit(restart_exit_code).

virtual bool is_scanning() const noexcept override

Check if the service is currently performing a scan.

Returns

true if the DSP sub-component is scanning.

virtual void get_monitor_data(ska::pst::lmc::MonitorData *data) override

Handle getting the monitoring data for the service.

This will delegate getting monitoring data from the active DSP subcomponent.

Parameters

data – Pointer to the protobuf message to return. This will set the dsp sub-message with the monitoring data.

Throws

ska::pst::common::LmcServiceException – if service is not scanning.

virtual void get_env(ska::pst::lmc::GetEnvironmentResponse *response) noexcept override

Return environment variables back to the client.

This will combine the environment data from all the DSP subcomponents by delegating to the individual DSP LMC service handlers.

Parameters

response – Pointer to a protobuf message message that includes the a map to populate.

virtual ska::pst::common::State get_application_manager_state() override

Get the application manager state.

If there is a beam configured DSP LMC service handler then the request is delegated to that else this will return the EMPTY state.

Returns

ska::pst::common::State returns current the enum State of the underlying application manager.

virtual std::exception_ptr get_application_manager_exception() override

Get the exception pointer from the underlying application manager.

This will check if any of the underlying DSP LMC service handlers return a non nullptr for the exception pointer and return that.

Returns

std::exception_ptr returns the current captured exception caught by the underlying application manager.

virtual void go_to_runtime_error(std::exception_ptr exc) override

Put application into a runtime error state.

Parameters

exc – an exception pointer to store on the application manager.

inline ska::pst::lmc::PstProcessingModeProto get_pst_processing_mode() const

Get the current PST processing mode.

Returns

ska::pst::lmc::PstProcessingModeProto