Observation Device

SKAObsDevice

A generic base device for Observations for SKA. It inherits SKABaseDevice class. Any device implementing an obsMode will inherit from SKAObsDevice instead of just SKABaseDevice.

Tango Device Class

class ska_tango_base.SKAObsDevice(*args: Any, **kwargs: Any)[source]

A generic base device for Observations for SKA.

class InitCommand(target, state_model, logger=None)[source]

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

Create a new InitCommand

Parameters
  • target (object) – the object that this command acts upon; for example, the SKASubarray device for which this class implements the command

  • state_model (DeviceStateModel) – the state model that this command uses to check that it is allowed to run, and that it drives with actions.

  • logger (a logger that implements the standard library logger interface) – the logger to be used by this Command. If not provided, then a default module logger will be used.

do()[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)

obsState = tango.server.attribute(dtype=<enum 'ObsState'>, doc=Observing State)

Device attribute.

obsMode = tango.server.attribute(dtype=<enum 'ObsMode'>, doc=Observing Mode)

Device attribute.

configurationProgress = tango.server.attribute(dtype=uint16, unit=%, max_value=100, min_value=0, doc=Percentage configuration progress)

Device attribute.

configurationDelayExpected = tango.server.attribute(dtype=uint16, unit=seconds, doc=Configuration delay expected in seconds)

Device attribute.

always_executed_hook()[source]

Method that is always executed before any device command gets executed.

Returns

None

delete_device()[source]

Method to cleanup when device is stopped.

Returns

None

read_obsState()[source]

Reads Observation State of the device

read_obsMode()[source]

Reads Observation Mode of the device

read_configurationProgress()[source]

Reads percentage configuration progress of the device

read_configurationDelayExpected()[source]

Reads expected Configuration Delay in seconds

Device State Model

class ska_tango_base.ObsDeviceStateModel(action_breakdown, obs_machine_class, logger, op_state_callback=None, admin_mode_callback=None, obs_state_callback=None)[source]

Base class for ObsDevice state models

Initialises the model.

Parameters
  • action_breakdown (dictionary defining actions to be performed on the observation state machine and,as needed, on the device state machine.) – the action breakdown associated with the observing state machine class

  • obs_machine_class (transitions.Machine) – state machine for the observing state of a SKAObsDevice class device.

  • logger (a logger that implements the standard library logger interface) – the logger to be used by this state model.

  • op_state_callback (callable) – A callback to be called when a transition implies a change to op state

  • admin_mode_callback (callable) – A callback to be called when a transition causes a change to device admin_mode

  • obs_state_callback (callable) – A callback to be called when a transition causes a change to device obs_state

property obs_state

Returns the obs_state

Returns

obs_state of this state model

Return type

ObsState

is_action_allowed(action)[source]

Whether a given action is allowed in the current state.

Parameters

action (ANY) – an action, as given in the transitions table

Returns

where the action is allowed in the current state:

Return type

bool: True if the action is allowed, False if it is not allowed

Raises

StateModelError – for an unrecognised action

try_action(action)[source]

Checks whether a given action is allowed in the current state, and raises a StateModelError if it is not.

Parameters

action (str) – an action, as given in the transitions table

Raises

StateModelError – if the action is not allowed in the current state

Returns

True if the action is allowed

Return type

boolean

perform_action(action)[source]

Performs an action on the state model

Parameters

action (ANY) – an action, as given in the transitions table

Raises

StateModelError – if the action is not allowed in the current state