============================= PoweredInterface Tango Device ============================= Provides the Tango interface for a SKA device that controls a powered component. This class extends :py:class:`~.future._base_interface.BaseInterface` with support for power state transitions (ON, OFF, STANDBY) driven by the component under control. It is up to subclasses to override various abstract methods to provide the appropriate behaviour and set the Operational State as appropriate, except for the initial state that is set in :py:meth:`!init_device`. The Operational State of an SKA Tango device is exposed as the built-in Tango device state via :py:meth:`~tango.server.Device.set_state()`. Subclasses are not expected to call :py:meth:`~tango.server.Device.set_state()` themselves. Instead, the state is driven automatically by calling :py:meth:`~.future._base_interface.BaseInterface.init_completed`, :py:meth:`~.future._base_interface.OpStateEmitMixin.software_fault` :py:meth:`~.future._powered_interface.PoweredOpStateEmitMixin.component_on`, :py:meth:`~.future._powered_interface.PoweredOpStateEmitMixin.component_off` and :py:meth:`~.future._powered_interface.PoweredOpStateEmitMixin.component_standby` from the appropriate places in the device implementation, which will additionally ensure that change and archive events are sent. The Operational State of the :py:class:`!PoweredInterface` only supports a subset of the :py:class:`~tango.DevState` enumeration, with the following interpretations: - **INIT**: The device is initialising. Mandatory initial state for all devices. - **ON**: The system under control is powered on. Mandatory default state if the device is operational. - **OFF**: The system under control is powered off. Optional. - **STANDBY**: The system under control is in low-power standby mode. Optional. - **FAULT**: The system under control is in fault. Optional. :py:class:`!PoweredInterface` also provides the signals :py:attr:`~.future._base_interface.BaseInterface._admin_mode`, :py:attr:`~.future._powered_interface.PoweredInterface._commanded_state` and :py:attr:`~.future._base_interface.BaseInterface._health_state` as well as the corresponding Tango attributes :py:attr:`~.future._base_interface.BaseInterface.adminMode`, :py:attr:`~.future._powered_interface.PoweredInterface.commandedState` and :py:attr:`~.future._base_interface.BaseInterface.healthState`, as well as :py:attr:`~.future._base_interface.BaseInterface.healthInfo`. The :py:attr:`~.future._base_interface.BaseInterface.adminMode` Tango attribute is writable and should not be set by subclasses of this interface. The :py:attr:`~.future._powered_interface.PoweredInterface.commandedState` should be set by subclasses as appropriate, using the corresponding signal. The :py:attr:`~.future._base_interface.BaseInterface.healthState` and :py:attr:`~.future._base_interface.BaseInterface.healthInfo` read-only attributes should be set by subclasses by calling :py:meth:`~.future._base_interface.BaseInterface.report_health`. This interface also provides optional state transition commands :py:meth:`!Off()`, :py:meth:`!Standby()`, :py:meth:`!On()` as well as implementations of the :py:meth:`~.future._powered_interface.PoweredInterface.is_Off_allowed()`, :py:meth:`~.future._powered_interface.PoweredInterface.is_Standby_allowed()` and :py:meth:`~.future._powered_interface.PoweredInterface.is_On_allowed()` methods which respect the Operational State machine. Subclasses can provide an implementation for these commands by overriding the :py:meth:`~.future._powered_interface.PoweredInterface.execute_Off()`, :py:meth:`~.future._powered_interface.PoweredInterface.execute_Standby()` and :py:meth:`~.future._powered_interface.PoweredInterface.execute_On()` methods. Properties ---------- .. index:: single: LoggingLevelDefault; PoweredInterface.LoggingLevelDefault .. py:attribute:: LoggingLevelDefault :module: PoweredInterface Default logging level at device startup. :data type: DevUShort :default value: 4 .. index:: single: LoggingTargetsDefault; PoweredInterface.LoggingTargetsDefault .. py:attribute:: LoggingTargetsDefault :module: PoweredInterface Default logging targets at device startup. :data type: DevVarStringArray :default value: ['tango::logger'] Attributes ---------- .. index:: single: State; PoweredInterface.State .. py:attribute:: State :module: PoweredInterface The operational state of the device as enumeration. :access: READ :data type: DevState :data format: SCALAR .. index:: single: Status; PoweredInterface.Status .. py:attribute:: Status :module: PoweredInterface More detailed textual information about the device's status. :access: READ :data type: DevString :data format: SCALAR .. index:: single: adminMode; PoweredInterface.adminMode .. py:attribute:: adminMode :module: PoweredInterface The Admin Mode of the device. Set by a client to mark the device for science or only engineering. :access: READ_WRITE :data type: DevEnum :data format: SCALAR .. index:: single: buildState; PoweredInterface.buildState .. py:attribute:: buildState :module: PoweredInterface Read the Build State of the device. :access: READ :data type: DevString :data format: SCALAR .. index:: single: commandedState; PoweredInterface.commandedState .. py:attribute:: commandedState :module: PoweredInterface The last commanded Operating State of the device. Initial string is "None". Only other strings it can change to is "OFF", "STANDBY" or "ON", following the Off(), Standby() or On() commands. If the state transition commands are long running commands the commanded state will only update when the long running command starts executing. :access: READ :data type: DevString :data format: SCALAR .. index:: single: healthInfo; PoweredInterface.healthInfo .. py:attribute:: healthInfo :module: PoweredInterface Read the Health Info of the device. It provides an explanation for the currently reported Health State :access: READ :data type: DevString :data format: SPECTRUM :max_dim_x: 256 .. index:: single: healthState; PoweredInterface.healthState .. py:attribute:: healthState :module: PoweredInterface Read the Health State of the device. It interprets the current device condition and condition of all managed devices to set this. :access: READ :data type: DevEnum :data format: SCALAR .. index:: single: loggingLevel; PoweredInterface.loggingLevel .. py:attribute:: loggingLevel :module: PoweredInterface Read the logging level of the device. Initialises to LoggingLevelDefault on startup. See :py:class:`~ska_control_model.LoggingLevel` :access: READ_WRITE :data type: DevEnum :data format: SCALAR .. index:: single: loggingTargets; PoweredInterface.loggingTargets .. py:attribute:: loggingTargets :module: PoweredInterface Read the additional logging targets of the device. Note that this excludes the handlers provided by the ska_ser_logging library defaults - initialises to LoggingTargetsDefault on startup. :access: READ_WRITE :data type: DevString :data format: SPECTRUM :max_dim_x: 4 .. index:: single: versionId; PoweredInterface.versionId .. py:attribute:: versionId :module: PoweredInterface Read the Version Id of the device. :access: READ :data type: DevString :data format: SCALAR Commands -------- .. index:: single: GetVersionInfo; PoweredInterface.GetVersionInfo .. py:method:: GetVersionInfo() -> DevVarStringArray :module: PoweredInterface Get the version information of the device. :returns: The device class name and its package information. .. index:: single: Init; PoweredInterface.Init .. py:method:: Init() -> DevVoid :module: PoweredInterface Reinitialise the Tango device. .. index:: single: On; PoweredInterface.On .. py:method:: On() -> DevVarLongStringArray :module: PoweredInterface Turn the device on. :returns: [ResultCode][Status message or command ID]