PST Base Device API

Module for the base TANGO device used in PST.LMC.

class ska_pst_lmc.component.pst_device.PstBaseDevice(*args: Any, **kwargs: Any)[source]

Base class for all the TANGO devices in PST.LMC.

This extends from CspSubElementObsDevice but is also generic in the type of the component manager.

The CspSubElementObsDevice class is used as a base rather than a SKASubarray due to the fact this PST is a software subelement within CSP.

init_device() None[source]

Initialise the attributes and properties of the PstReceive.

This overrides the SKABaseDevice.

init_command_objects() None[source]

Set up the command objects.

always_executed_hook() None[source]

Execute call before any TANGO command is executed.

delete_device() None[source]

Delete resources allocated in init_device.

This method allows for any memory or other resources allocated in the init_device method to be released. This method is called by the device destructor and by the device Init command.

create_component_manager() T[source]

Create and return a component manager for this device.

Raises

NotImplementedError – for no implementation

handle_component_state_change(*args: Any, **kwargs: Any) None[source]

Handle change in this device’s state.

This overrides the PstDeviceInterface and calls _component_state_changed on this class.

handle_communication_state_change(communication_state: ska_tango_base.control_model.CommunicationStatus) None[source]

Handle a change in device’s communication state.

This just calls the SKABaseDevice._communication_state_changed method

handle_attribute_value_update(attribute_name: str, value: Any) None[source]

Handle update of a device attribute value.

Parameters
  • attribute_name (str) – the name of the attribute to update.

  • value (Any) – the new value of the attribute to update to.

property component_manager: T

Get component manager.

Overrides the super class property of component_manager to be typesafe.

Returns

the component manager casted to type T.

property beam_id: int

Get the ID of the beam this device belongs to.

property device_name: str

Get the name of the device.

This is the relative device name (e.g. low_psi/beam/01) and not the FQDN which can include the Tango DB in a URL.

property facility: TelescopeFacilityEnum

Get the facility that this device is being used for.

property subsystem_id: str

Get the sub-system id where device is deployed.

handle_fault(fault_msg: str) None[source]

Handle putting the device into a fault state.

update_health_state(health_state: ska_tango_base.control_model.HealthState) None[source]

Update the health state of the device.

This delegates to the base class _update_health_state

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

Set the logging level for the device.

Both the Python logger and the TANGO logger are updated.

This calls SKABaseDevice.set_logging_level() then delegates to the component manager to perform necessary updates. This is used by having the BEAM.MGMT to update the subordinate Tango devices, which in turn update the core apps.

Parameters

value – Logging level for logger

Raises

LoggingLevelError – for invalid value

class ConfigureScanCommand(*args: Any, **kwargs: Any)[source]

A class for the PstBaseDevice’s ConfigureScan command.

This class overrides the CspSubElementObsDevice.ConfigureScanCommand’s validate_input method to no assert the id field.

validate_input(argin: str) Tuple[Dict[str, Any], ska_tango_base.commands.ResultCode, str][source]

Validate the configuration parameters against allowed values, as needed.

Parameters

argin (str) – The JSON formatted string with configuration for the device.

Returns

A tuple containing a return code and a string message.

Return type

(ResultCode, str)

simulationMode(value: ska_tango_base.control_model.SimulationMode) None

Set the simulation mode.

Parameters

value – The simulation mode, as a SimulationMode value

class ska_pst_lmc.component.pst_device.PstBaseProcessDevice(*args: Any, **kwargs: Any)[source]

Base class for all the TANGO devices that manager an external process.

This extends from PstBaseDevice but exposes the ConfigureBeam method. This allows for setting up the beam related configuration that may not change as often as the scan configuration.

property monitoring_polling_rate: int

Get the monitoring polling rate.

monitoringPollingRate(monitoring_polling_rate: int) None

Update the monitoring polling rate.

init_command_objects() None[source]

Set up the command objects.

class InitCommand(*args: Any, **kwargs: Any)[source]

A class for the CspSubElementObsDevice’s init_device() “command”.

do() Tuple[ska_tango_base.commands.ResultCode, str][source]

Stateless hook for device initialisation.

Returns

A tuple containing a return code and a string message indicating status. The message is for information purpose only.

Return type

(ResultCode, str)

is_ValidateConfigureScan_allowed() bool[source]

Return whether the ValidateConfigureScan command may be called in the current state.

Returns

whether the command may be called in the current device state

Return type

bool

is_ConfigureBeam_allowed() bool[source]

Return whether the ConfigureBeam command may be called in the current state.

Returns

whether the command may be called in the current device state

Return type

bool

is_DeconfigureBeam_allowed() bool[source]

Return whether the DeconfigureBeam command may be called in the current state.

Returns

whether the command may be called in the current device state

Return type

bool

is_DeconfigureScan_allowed() bool[source]

Return whether the DeconfigureScan command may be called in the current state.

Returns

whether the command may be called in the current device state

Return type

bool