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.
-
class
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
-
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