Future Control Mode Mixin

Mixin to provide ControlMode for a device.

class ska_tango_base.future._control_mode_mixin.ControlModeMixin[source]

Bases: BaseInterface

Mixin to provide a control mode for an SKA Tango device.

An SKA Tango device with a control mode can be instructed by a client to stop controlling and/or monitoring its component. Typically, this should only be needed for Tango devices that monitor and control a low-level hardware, although if needed it can be implemented by higher level devices (such as subarrays).

Subclasses must override the start_monitoring_component() and stop_monitoring_component() methods to start and stop monitoring their component when the control mode changes. These methods are respectively called on transitions from/to NO_MONITOR_NO_CONTROL.

After a call to init_device(), the device should not be communicating with its component as if the control mode was NO_MONITOR_NO_CONTROL. Any memorized value for the controlMode attribute will then be written and start_monitoring_component() will be called if that was requested by the end user.

Subclasses should also provide is-allowed methods that check check_component_controlled() for every command that should be disabled when not in the MONITOR_AND_CONTROL control mode.

_control_mode

Signal for the control mode of the device.

In general, this signal should not be written to by the device and instead should be updated by clients.

controlMode

The control mode of the device.

This attribute is memorized and written by clients.

read_controlMode() ControlMode | tuple[ControlMode, float, AttrQuality][source]

Read the control mode of the device.

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

write_controlMode(mode: ControlMode) None[source]

Set the control mode of the device.

Subclasses can override this to change the behaviour of the controlMode attribute. Most subclasses should instead override the start_monitoring_component()/stop_monitoring_component() methods.

Parameters:

mode – new control mode of the device.

init_device() None[source]

Initialise the device.

start_monitoring_component() None[source]

Start monitoring the component.

Subclasses must override this to enable component monitoring.

The health of the component should be reported with report_health(). If the connection to the component is established asynchronously, then use HealthState.FAILED to indicate that the connect has not yet been established.

stop_monitoring_component() None[source]

Stop monitoring the component.

Subclasses must override this to disable component monitoring. This function should not return until the connection to the component has been severed.

check_component_controlled() None[source]

Raise an exception if the Tango device is not controlling its component.