SKADevice

This module implements a generic base model and device for SKA.

It exposes the generic attributes, properties and commands of an SKA device.

class ska_tango_base.ska_device.SKADevice[source]

Bases: Device

A generic base device for SKA.

LoggingLevelDefault

Device property.

Default logging level at device startup. See LoggingLevel

LoggingTargetsDefault

Device property.

Default logging targets at device startup. See the project readme for details.

init_device() None[source]

Initialise the tango device after startup.

Subclasses that have no need to override the default implementation of state management may leave init_device() alone. Override the do() method on the nested class InitCommand instead.

set_logging_level(value: LoggingLevel) None[source]

Set the logging level for the device.

Both the Python logger and the Tango logger are updated.

Parameters:

value – Logging level for logger

Raises:

LoggingLevelError – for invalid value

set_logging_targets(targets: list[str]) None[source]

Set the additional logging targets for the device.

Note that this excludes the handlers provided by the ska_ser_logging library defaults.

Parameters:

targets – Logging targets for logger

buildState() str

Read the Build State of the device.

Returns:

the build state of the device

_build_state: str

Value returned by the buildState() attribute.

Should be set by subclasses during device initialisation.

Typically this will include the name of the python package, the version number of that package and a brief description of that package.

versionId() str

Read the Version Id of the device.

Returns:

the version id of the device

_version_id: str

Value returned by the versionId() attribute.

Should be set by subclasses during device initialisation.

Must be of the form "<major>.<minor>.<patch>".

loggingLevel(value: LoggingLevel) None

Set the logging level for the device.

Both the Python logger and the Tango logger are updated.

Parameters:

value – Logging level for logger

loggingTargets(value: list[str]) None

Set the additional logging targets for the device.

Note that this excludes the handlers provided by the ska_ser_logging library defaults.

Parameters:

value – Logging targets for logger

GetVersionInfo() list[str]

Return the version information of the device.

To modify behaviour for this command, modify the do() method of the command class.

Returns:

The device class name and its package information.