Obs Interface

Interface for devices with an observation state.

class ska_tango_base.obs.obs_interface.ObsInterface[source]

Bases: BaseInterface

Provides the Tango interface for an SKA device with an Observation State.

Warning

The default scalar obsMode attribute provided by this class has been deprecated since ska-tango-base 1.5.0. Use the standard_obs_mode() method to override the scalar attribute and its signal with a list version in a subclass.

Example

class MyDevice(ObsInterface):
    _obs_mode, obsMode = standard_obs_mode()
_obs_state: Signal[ObsState]

Signal for the observation state of the device.

Write to this signal to report the observation state of the device to Tango clients.

obsState

Observation state attribute of the device.

This should be set by subclasses of this interface by writing to _obs_state.

_commanded_obs_state: CommandedObsStateSignal

Signal for the commanded observation state of the device.

Write to this signal whenever a command is executed which will result in a obs state transition.

commandedObsState

Attribute for the last commanded Observation State of the device.

This should be set by subclasses of this interface by writing to _commanded_obs_state.

_obs_mode: Signal[ObsMode] | Signal[list[ObsMode]]

Signal for the observation mode of the device.

Write to this signal to report observation mode of the device to Tango clients.

obsMode: attribute_from_signal | None

Observation mode attribute of the device.

This should be set by subclasses of this interface by writing to _obs_mode.

_config_progress: Signal[int]

Signal for the configuration progress of the device.

Write to this signal to report configuration progress to Tango clients.

configurationProgress

Configuration progress attribute of the device.

This should be set by subclasses of this interface by writing to _config_progress.

_config_delay_expected: Signal[int]

Signal for the configuration delay expected of the device.

Write to this signal to report the expected configuration delay to Tango clients.

configurationDelayExpected

Configuration delay expected attribute of the device.

This should be set by subclasses of this interface by writing to _config_delay_expected.

init_device() None[source]

Initialise the tango device after startup.

read_obsState() ObsState | tuple[ObsState, float, AttrQuality][source]

Read the observation state of the device.

Subclasses can override this to change the behaviour of the obsState attribute.

is_obsState_allowed(request_type: AttReqType) bool[source]

Check if the obsState can be read currently.

This can be overridden by subclasses to restrict when clients can access the attribute.

read_commandedObsState() ObsState | tuple[ObsState, float, AttrQuality][source]

Read the commanded observation state of the device.

Subclasses can override this to change the behaviour of the commandedObsState attribute.

is_commandedObsState_allowed(request_type: AttReqType) bool[source]

Check if the commandedObsState can be read currently.

This can be overridden by subclasses to restrict when clients can access the attribute.

read_obsMode() ObsMode | tuple[ObsMode, float, AttrQuality][source]

Read the observation mode of the device.

Subclasses can override this to change the behaviour of the obsMode attribute.

is_obsMode_allowed(request_type: AttReqType) bool[source]

Check if the obsMode can be read currently.

This can be overridden by subclasses to restrict when clients can access the attribute.

read_configurationProgress() int | tuple[int, float, AttrQuality][source]

Read the configuration progress of the device.

Subclasses can override this to change the behaviour of the configurationProgress attribute.

is_configurationProgress_allowed(request_type: AttReqType) bool[source]

Check if the configurationProgress can be read currently.

This can be overridden by subclasses to restrict when clients can access the attribute.

read_configurationDelayExpected() int | tuple[int, float, AttrQuality][source]

Read the expected configuration delay of the device.

Subclasses can override this to change the behaviour of the configurationDelayExpected attribute.

is_configurationDelayExpected_allowed(request_type: AttReqType) bool[source]

Check if the configurationDelayExpected can be read currently.

This can be overridden by subclasses to restrict when clients can access the attribute.

_update_obs_state(obs_state: ObsState) None[source]

Perform Tango operations in response to a change in obsState.

This helper method is passed to the observation state model as a callback, so that the model can trigger actions in the Tango device.

Parameters:

obs_state – the new obs_state value

ska_tango_base.obs.obs_interface.standard_obs_mode(description: str | None = None, **kwargs: Any) tuple[Signal[list[ObsMode]], attribute_from_signal][source]

Return a signal and attribute pair for the optional obsMode attribute.

The obsMode attribute exposes the active observation modes of the device as a list of ObsMode enumerants. The initial value is [ObsMode.IDLE]. The returned tuple should be unpacked into class-level signal and attribute declarations, for example:

_obs_mode, obsMode = standard_obs_mode()

Override description to provide a device-specific Tango attribute description.

Parameters:
  • description – Optional override for the Tango attribute description.

  • kwargs – Additional keyword arguments forwarded to attribute_from_signal().

Returns:

A (signal, attribute) tuple.