Future Control Mode Mixin
Mixin to provide ControlMode for a device.
- class ska_tango_base.future._control_mode_mixin.ControlModeMixin[source]
Bases:
BaseInterfaceMixin 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()andstop_monitoring_component()methods to start and stop monitoring their component when the control mode changes. These methods are respectively called on transitions from/toNO_MONITOR_NO_CONTROL.After a call to
init_device(), the device should not be communicating with its component as if the control mode wasNO_MONITOR_NO_CONTROL. Any memorized value for thecontrolModeattribute will then be written andstart_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 theMONITOR_AND_CONTROLcontrol 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
controlModeattribute.
- write_controlMode(mode: ControlMode) None[source]
Set the control mode of the device.
Subclasses can override this to change the behaviour of the
controlModeattribute. Most subclasses should instead override thestart_monitoring_component()/stop_monitoring_component()methods.- Parameters:
mode – new control mode of 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 useHealthState.FAILEDto indicate that the connect has not yet been established.