Commit 09f083bd authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

AT5-259: updated package documentation.

Removed some minor bugs.
parent fa132ca8
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@

CSP.LMC Common Class for the CSPMaster TANGO Device.
"""

# PROTECTED REGION ID (CspMaster.standardlibray_import) ENABLED START #
# Python standard library
import sys
@@ -35,13 +36,11 @@ from tango import AttrWriteType, DeviceProxy
#
from skabase.SKAMaster  import SKAMaster
from skabase.auxiliary import utils

from .utils.decorators import AdminModeCheck, CmdInputArgsCheck
from .utils.cspcommons import HealthState, AdminMode, ObsState, CmdExecState
from . import release
# PROTECTED REGION END# //CspMaster.additional_import


__all__ = ["CspMaster", "main"]

class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
@@ -1415,8 +1414,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):

        Set the administration mode for the whole CSP element.

        :param argin:
            value: one of the administration mode value (ON-LINE,\
        :param value: one of the administration mode value (ON-LINE,\
            OFF-LINE, MAINTENANCE, NOT-FITTED, RESERVED).
        :type: DevEnum
        :return: None
@@ -1599,10 +1597,10 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):

        Set the CBF sub-element *adminMode* attribute value.

        :parameter:value: one of the administration mode value (ON-LINE,\
        :param value: one of the administration mode value (ON-LINE,\
            OFF-LINE, MAINTENANCE, NOT-FITTED, RESERVED).
        :return: None
        :raises: tango.DevFailed: raised when there is no DeviceProxy providing interface \
        :raises: tango.DevFailed when there is no DeviceProxy providing interface \
            to the CBF sub-element Master, or an exception is caught in command execution.
        """
        self._se_write_adminMode(value, self.CspCbf)
@@ -1709,8 +1707,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):

        Command *On* is allowed when the device *State* is STANDBY.

        Returns:
            True if the method is allowed, otherwise False.
        :return: True if the method is allowed, otherwise False.
        """
        # PROTECTED REGION ID(CspMaster.is_On_allowed) ENABLED START #
        # Note: as per SKA Guidelines, the command is allowed when 
@@ -1753,6 +1750,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        :type: 'DevVarStringArray'                    
        :return: None
        :raises: *tango.DevFailed* exception when:
        
                - the CSP adminMode is not correct
                - one or more sub-element devices are already running a power command
                - there is no DeviceProxy providing interface to the CBF sub-element
@@ -1783,8 +1781,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):

        Command *Off* is allowed when the device *State* is STANDBY.

        Returns:
            True if the method is allowed, otherwise False.
        :return: True if the method is allowed, otherwise False.
        """
        # PROTECTED REGION ID(CspMaster.is_On_allowed) ENABLED START #
        # Note: as per SKA Guidelines, the command is allowed when 
@@ -1826,6 +1823,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        :type: 'DevVarStringArray'                    
        :return: None
        :raises: *tango.DevFailed* exception when:
        
                - the CSP adminMode is not correct
                - one or more sub-element devices are already running a power command
                - there is no DeviceProxy providing interface to the CBF sub-element
@@ -1859,8 +1857,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):

        Command *Standby* is allowed when the device *State* is ON.

        Returns:
            True if the method is allowed, otherwise False.
        :return: True if the method is allowed, otherwise False.
        """
        # PROTECTED REGION ID(CspMaster.is_On_allowed) ENABLED START #
        # Note: as per SKA Guidelines, the command is allowed when 
@@ -1898,6 +1895,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        :type: 'DevVarStringArray' 
        :return: None
        :raises: *tango.DevFailed* exception when:
        
                - the CSP adminMode is not correct
                - one or more sub-element devices are already running a power command
                - there is no DeviceProxy providing interface to the CBF sub-element
+89 −139

File changed.

Preview size limit exceeded, changes collapsed.

+11 −12
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ASCII"?>
<pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl">
  <classes name="CspSubarray" pogoRevision="9.6">
    <description description="CSP subarray functionality is modeled via a TANGO CSP.LMC Common Class for the CSPSubarray TANGO Device." title="CSP.LMC Common CspSubarray" sourcePath="/home/softir/src/ska-git/csp-lmc/csp-lmc-common/pogo" language="PythonHL" filestogenerate="XMI   file,Code files,Protected Regions" license="GPL" copyright="INAF - SKA Telescope" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
    <description description="CSP subarray functionality is modeled via a TANGO CSP.LMC Common Class for the CSPSubarray TANGO Device." title="CSP.LMC Common CspSubarray" sourcePath="/home/softir/ska-git/csp-lmc/csp-lmc-common/pogo" language="PythonHL" filestogenerate="XMI   file,Code files,Protected Regions" license="GPL" copyright="INAF - SKA Telescope" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
      <inheritances classname="Device_Impl" sourcePath=""/>
      <inheritances classname="SKAObsDevice" sourcePath="../../../lmc-base-classes/skabase/SKAObsDevice"/>
      <inheritances classname="SKASubarray" sourcePath="/home/softir/src/ska-git/lmc-base-classes/skabase/SKASubarray"/>
      <inheritances classname="SKASubarray" sourcePath="/home/softir/ska-git/lmc-base-classes/skabase/SKASubarray"/>
      <identification contact="at inaf.it - elisabetta.giani" author="elisabetta.giani" emailDomain="inaf.it" classFamily="SkaCsp" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="INAF" reference=""/>
    </description>
    <classProperties name="PSTBeams" description="PST sub-element PSTBeams TANGO devices FQDNs">
@@ -60,7 +60,6 @@
    <deviceProperties name="LoggingTargetsDefault" description="Default logging targets at device startup.&#xA;Each item has the format:  target_type::target_name.&#xA;To log to stdout, use 'console::cout'.&#xA;To log to syslog, use 'syslog::&lt;address>',&#xA;  where &lt;address> is a file path,&#xA;  for example 'syslog::/var/run/rsyslog/dev/log'.&#xA;To log to a file, use 'file::&lt;path>',&#xA;  where &lt;path> is a file path,&#xA;  for example 'file::/tmp/my_dev.log'.">
      <type xsi:type="pogoDsl:StringVectorType"/>
      <status abstract="false" inherited="true" concrete="true"/>
      <DefaultPropValue>console::cout</DefaultPropValue>
    </deviceProperties>
    <deviceProperties name="CspMaster" description="The TANGO address of the CspMaster.">
      <type xsi:type="pogoDsl:StringType"/>
@@ -742,7 +741,7 @@
      <properties description="State of the assigned VlbiBeams" label="Assigned VlbiBeams State" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedSearchBeamsHealthState" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="1500" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -750,7 +749,7 @@
      <properties description="HealthState of the assigned SearchBeams" label="Assigned SearchBeams HealthState" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedTimingBeamsHealthState" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="16" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -758,7 +757,7 @@
      <properties description="HealthState of the assigned TimingBeams" label="Assigned TimingBeams HealthState" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedVlbiBeamsHealthState" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="20" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -766,7 +765,7 @@
      <properties description="HealthState of the assigned VlbiBeams" label="Assigned VlbiBeams HealthState" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedSearchBeamsObsState" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="1500" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -774,7 +773,7 @@
      <properties description="ObsState of the assigned SearchBeams" label="Assigned SearchBeams ObsState" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedTimingBeamsObsState" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="16" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -782,7 +781,7 @@
      <properties description="ObsState of the assigned TimingBeams" label="Assigned TimingBeams ObsState" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedVlbiBeamsObsState" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="20" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -790,7 +789,7 @@
      <properties description="ObsState of the assigned VlbiBeams" label="Assigned VlbiBeams ObsState" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedSearchBeamsAdminMode" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="1500" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -798,7 +797,7 @@
      <properties description="AdminMode of the assigned SearchBeams" label="Assigned SearchBeams AdminMode" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedTimingBeamsAdminMode" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="16" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
@@ -806,7 +805,7 @@
      <properties description="AdminMode of the assigned TimingBeams" label="Assigned TimingBeams AdminMode" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedVlbiBeamsAdminMode" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="20" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StateType"/>
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
+9 −4
Original line number Diff line number Diff line
@@ -429,7 +429,6 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
    # Commands
    # --------
    @AdminModeCheck('AddReceptors')
    @ObsStateCheck('addresources')
    def is_AddReceptors_allowed(self):
        return self._is_subarray_composition_allowed()
        
@@ -438,6 +437,7 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
        doc_in="List of the receptor IDs to add to the subarray.",
    )
    @DebugIt()
    @ObsStateCheck('addresources')
    @SubarrayRejectCmd(['RemoveReceptors', 'Configure'])
    def AddReceptors(self, argin):
        # PROTECTED REGION ID(MidCspSubarrayBase.AddReceptors) ENABLED START #
@@ -546,7 +546,7 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
            self._sc_subarray_cmd_starting_time[self.CbfSubarray] = time.time()
            self._command_thread['addreceptors'].start()
        else:
            log_msg = "Device {} is not running!".format(str(self._cbf_subarray_fqdn))
            log_msg = "Device {} is not running!".format(str(self.CbfSubarray))
            self.logger.error(log_msg)
            tango.Except.throw_exception("Command failed",
                                         log_msg,
@@ -554,7 +554,6 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
                                         tango.ErrSeverity.ERR)
        # PROTECTED REGION END #    //  MidCspSubarrayBase.AddReceptors
    @AdminModeCheck('RemoveReceptors')
    @ObsStateCheck('removeresources')
    def is_RemoveReceptors_allowed(self):
        
        return self._is_subarray_composition_allowed()
@@ -564,6 +563,7 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
        doc_in="The list with the receptor IDs to remove",
    )
    @DebugIt()
    @ObsStateCheck('removeresources')
    @SubarrayRejectCmd(['AddReceptors', 'Configure'])
    def RemoveReceptors(self, argin):
        # PROTECTED REGION ID(MidCspSubarrayBase.RemoveReceptors) ENABLED START #
@@ -654,10 +654,15 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
                                         tango.ErrSeverity.ERR)
       
        # PROTECTED REGION END #    //  MidCspSubarrayBase.RemoveReceptors
    @AdminModeCheck('RemoveAllReceptors')
    def is_RemoveAllReceptors_allowed(self):
        
        return self._is_subarray_composition_allowed()
    @command(
    )
    @DebugIt()
    @ObsStateCheck('removeresources')
    @SubarrayRejectCmd(['AddReceptors', 'Configure'])
    def RemoveAllReceptors(self):
        # PROTECTED REGION ID(MidCspSubarrayBase.RemoveAllReceptors) ENABLED START #
        """
+2 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
#   - tangodb: MariaDB database with TANGO schema
#   - databaseds: TANGO database device server
#   - rsyslog-csplmc: rsyslog service for logger
#   - cspmaster: CspMaster device
#   - midcspmaster: MidCspMaster device
#
# Requires:
#   - None
@@ -56,6 +56,7 @@ services:
      sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
             retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
             retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01 &&\
             retry --max=5 -- tango_admin --ping-device mid_csp/elt/master &&\
             /venv/bin/python /app/csp-lmc-mid/MidCspSubarray.py subarray1"
    volumes_from:
      - rsyslog-csplmc:rw
Loading