Future Subarray Interface
Interfaces for subarray devices.
- class ska_tango_base.future._subarray_interface.SubarrayInterface[source]
Bases:
LRCMixin,AbstractSubarrayInterfaceProvides the Tango interface for an SKA subarray device.
This class extends
ObsInterfacewith the standard subarray command set and long running command (LRC) support viaLRCMixin, which supplies aTaskExecutor-backedtask_executorand the associated LRC attributes.Subclasses must override the
execute_*methods for each command and apply thesubmit_lrc_task()decorator to make them long running commands.Observation state is driven by writing to the signals inherited from
ObsInterface, primarily via_update_obs_state(). Thestarted_*andcompleted_*callbacks onAbstractSubarrayInterfacemanage thecommand_in_progressportion of the observation state automatically when usingsubmit_lrc_task().Use
AbstractSubarrayInterfacedirectly only when you need to supply your owntask_executorimplementation (e.g. viaComponentManagerLRCMixin).
- class ska_tango_base.future._subarray_interface.AbstractSubarrayInterface[source]
Bases:
AbstractLRCMixin,ObsInterfaceProvides the Tango interface for an SKA subarray.
This abstract class combines
ObsInterfaceandAbstractLRCMixinthat requires a concreteTaskExecutorProtocolto be provided viatask_executor.In most cases you should use
SubarrayInterfaceinstead, which bundles this class withLRCMixinand aTaskExecutorComponentManager-backed task executor. Use this abstract class only when you need to provide your owntask_executorimplementation (e.g. viaComponentManagerLRCMixin).- CapabilityTypes
Types of capability supported by this subarray.
- SubID
Unique identifier for this subarray.
- _activation_time
Signal for the activation time of the device.
Write to this signal to report the time of activation to Tango clients.
- activationTime
Activation time attribute of the device.
This should be set by subclasses of this interface by writing to
_activation_time.
- assignedResources
The resources assigned to the device.
- read_assignedResources() list[str][source]
Read the resources assigned to the device.
Subclasses of this interface must provide this method.
- configuredCapabilities
The configured capabilities of the device.
For example, [“Correlators:512”, “PssBeams:4”, “PstBeams:4”, “VlbiBeams:0”].
- read_configuredCapabilities() list[str][source]
Read the capabilities configured in the device.
Subclasses of this interface must provide this method.
- read_activationTime() float | tuple[float, float, AttrQuality][source]
Read the activation time of the device.
Subclasses can override this to change the behaviour of the
activationTimeattribute.
- is_activationTime_allowed(attr: AttReqType) bool[source]
Check if the activationTime can be read currently.
This can be overridden by subclasses to restrict when clients can access the attribute.
- is_AssignResources_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether
AssignResources()may be executed or enqueued.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_AssignResources(argin: str) tuple[list[ResultCode], list[str]][source]
Execute the standard AssignResources command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make AssignResources a long running command.Before calling this command, the device must be in obsState EMPTY or IDLE.
While this command is running, the device should have obsState RESOURCING.
Once this command has completed successfully, the device should have obsState IDLE.
If this command does not complete successfully, the device should have obsState FAULT.
- Parameters:
argin – the resources to be assigned
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- AssignResources(argin: str) tuple[list[ResultCode], list[str]][source]
Assign resources to this subarray.
Subclasses should override the
execute_AssignResourcesmethod to change the behaviour of this command.- Parameters:
argin – the resources to be assigned
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- is_ReleaseResources_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether
ReleaseResources()may be executed or enqueued.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_ReleaseResources(argin: str) tuple[list[ResultCode], list[str]][source]
Execute the standard ReleaseResources command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make ReleaseResources a long running command.Before calling this command, the device must be in obsState IDLE.
While this command is running, the device should have obsState RESOURCING.
Once this command has completed successfully, the device should have obsState IDLE or EMPTY depending on remaining resources.
If this command does not complete successfully, the device should have obsState FAULT.
- Parameters:
argin – the resources to be released
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- ReleaseResources(argin: str) tuple[list[ResultCode], list[str]][source]
Delta removal of assigned resources.
Subclasses should override the
execute_ReleaseResourcesmethod to change the behaviour of this command.- Parameters:
argin – the resources to be released
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- is_ReleaseAllResources_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether the
ReleaseAllResources()command may be called.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_ReleaseAllResources() tuple[list[ResultCode], list[str]][source]
Execute the standard ReleaseAllResources command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make ReleaseAllResources a long running command.Before calling this command, the device must be in obsState IDLE.
While this command is running, the device should have obsState RESOURCING.
Once this command has completed successfully, the device should have obsState EMPTY.
If this command does not complete successfully, the device should have obsState FAULT.
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- ReleaseAllResources() tuple[list[ResultCode], list[str]][source]
Remove all resources to tear down to an empty subarray.
Subclasses should override the
execute_ReleaseAllResourcesmethod to change the behaviour of this command.- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- is_Configure_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether the
Configure()command may be called currently.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_Configure(argin: str) tuple[list[ResultCode], list[str]][source]
Execute the standard Configure command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make Configure a long running command.Before calling this command, the device must be in obsState IDLE or READY.
While this command is running, the device should have obsState CONFIGURING.
Once this command has completed successfully, the device should have obsState READY.
If this command does not complete successfully, the device should have obsState FAULT.
- Parameters:
argin – the scan configuration specification
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- Configure(argin: str) tuple[list[ResultCode], list[str]][source]
Configure the capabilities of this subarray.
Subclasses should override the
execute_Configuremethod to change the behaviour of this command.- Parameters:
argin – the scan configuration specification
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- is_Scan_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether the
Scan()command may be called currently.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_Scan(argin: str) tuple[list[ResultCode], list[str]][source]
Execute the standard Scan command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make Scan a long running command.Before calling this command, the device must be in obsState READY.
Once this command has completed successfully, the device should have obsState SCANNING.
If this command does not complete successfully, the device should have obsState FAULT.
- Parameters:
argin – the per-scan configuration
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- Scan(argin: str) tuple[list[ResultCode], list[str]][source]
Start scanning.
Subclasses should override the
execute_Scanmethod to change the behaviour of this command.- Parameters:
argin – the per-scan configuration
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- is_EndScan_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether the
EndScan()command may be called currently.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_EndScan() tuple[list[ResultCode], list[str]][source]
Execute the standard EndScan command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make EndScan a long running command.Before calling this command, the device must be in obsState SCANNING.
Once this command has completed successfully, the device should have obsState READY.
If this command does not complete successfully, the device should have obsState FAULT.
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- EndScan() tuple[list[ResultCode], list[str]][source]
End the scan.
Subclasses should override the
execute_EndScanmethod to change the behaviour of this command.- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- is_End_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether the
End()command may be called currently.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_End() tuple[list[ResultCode], list[str]][source]
Execute the standard End command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make End a long running command.Before calling this command, the device must be in obsState READY.
Once this command has completed successfully, the device should have obsState IDLE.
If this command does not complete successfully, the device should have obsState FAULT
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- End() tuple[list[ResultCode], list[str]][source]
End the scan block.
Subclasses should override the
execute_Endmethod to change the behaviour of this command.- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- is_Restart_allowed(request_type: LRCReqType | None = None) bool[source]
Return whether the
Restart()command may be called currently.This method can be overridden by subclasses to change when this command is allowed.
- Parameters:
request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state
- execute_Restart() tuple[list[ResultCode], list[str]][source]
Execute the standard Restart command.
This method must be overridden by all subclasses. The
submit_lrc_task()decorator can be used to make Restart a long running command.Before calling this command, the device must be in obsState FAULT or ABORTED.
While this command is running, the device should have obsState RESTARTING.
Once this command has completed successfully, the device should have obsState EMPTY.
If this command does not complete successfully, the device should have obsState FAULT.
- Returns:
A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.
- Restart() tuple[list[ResultCode], list[str]][source]
Restart the subarray. That is, deconfigure and release all resources.
Subclasses should override the
execute_Restartmethod to change the behaviour of this command.- Returns:
A tuple containing a result code and the unique ID of the command
- is_Abort_allowed() bool[source]
Return whether the
Abort()command may be called currently.This method can be overridden by subclasses to change when this command is allowed.
- Raises:
StateModelError – command not permitted in observation state
- Returns:
whether the command may be called in the current device state