Commit a43ddcb0 authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

CSP.LMC Common Package: set as R/W the CspSubarray xxxDelayExpected attributes.

Set a default value for configurationDelayExpected.
CSP_Mid.LMC: add progress counter attributes for Add/RemoveReceptors command.
Removed a bug in _validate_scan_configuration method.
Added tests to configure two subarrys and updated docker-compose files and
TANGO DB to use two CSP>LMC sub-arrays.
parent 8f03ff3d
Loading
Loading
Loading
Loading
Loading
+39 −1
Original line number Diff line number Diff line
@@ -928,12 +928,14 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):

    addSearchBeamDurationExpected = attribute(
        dtype='DevUShort',
        access=AttrWriteType.READ_WRITE,
        label="AddSearchBeams command duration expected",
        doc="The duration expected (in sec) for the AddSearchBeams command.",
    )

    remSearchBeamsDurationExpected = attribute(
        dtype='DevUShort',
        access=AttrWriteType.READ_WRITE,
        label="RemoveSearchBeams command duration expected",
        doc="The duration expected (in sec) for the RemoveSearchBeams command.",
    )
@@ -953,12 +955,14 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):

    addTimingBeamDurationExpected = attribute(
        dtype='DevUShort',
        access=AttrWriteType.READ_WRITE,
        label="AddTimingBeams command duration expected",
        doc="The duration expected (in sec) for the AddTimingBeams command.",
    )

    remTimingBeamsDurationExpected = attribute(
        dtype='DevUShort',
        access=AttrWriteType.READ_WRITE,
        label="RemoveTimingBeams command duration expected",
        doc="The duration expected (in sec) for the RemoveTimingBeams command.",
    )
@@ -977,6 +981,7 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):
 
    endSBDurationExpected = attribute(
        dtype='DevUShort',
        access=AttrWriteType.READ_WRITE,
        label="EndSB command duration expected",
        doc="The duration expected (in sec) for the EndSB command.",
    )
@@ -1233,6 +1238,9 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):
        self._admin_mode = AdminMode.ONLINE
        self._obs_mode = ObsMode.IDLE
        self._obs_state = ObsState.IDLE
        # TODO: change the configureDelayExpected attribute in the
        # SKAObsDevice base class to RW
        self._config_delay_expected = 5
        # connect to TANGO DB
        
        # use defaultdict to initialize the sub-element State,healthState
@@ -1320,7 +1328,7 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):
        # Implemented as a nested default dictionary
        # keys: FQDN
        # values: default dictionary (keys: command name, values: the duration (in sec))
        self._sc_subarray_cmd_duration_expected = defaultdict(lambda: defaultdict(lambda: 20))
        self._sc_subarray_cmd_duration_expected = defaultdict(lambda: defaultdict(lambda: 10))
        
        # _sc_subarray_scan_configuration: report the scan configuration
        # for each sub-array sub-component (CBF, PSS subarray, PSTBeams) 
@@ -1571,12 +1579,24 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):
        return self._cmd_duration_expected['addsearchbeams']
        # PROTECTED REGION END #    //  CspSubarray.addSearchBeamDurationExpected_read

    def write_addSearchBeamDurationExpected(self, value):
        # PROTECTED REGION ID(CspSubarray.addSearchBeamDurationExpected_write) ENABLED START #
        """Set the addSearchBeamDurationExpected attribute."""
        pass
        # PROTECTED REGION END #    //  CspSubarray.addSearchBeamDurationExpected_write

    def read_remSearchBeamsDurationExpected(self):
        # PROTECTED REGION ID(CspSubarray.remSearchBeamsDurationExpected_read) ENABLED START #
        """Return the remSearchBeamsDurationExpected attribute."""
        return self._cmd_duration_expected['removesearchbeams']
        # PROTECTED REGION END #    //  CspSubarray.remSearchBeamsDurationExpected_read

    def write_remSearchBeamsDurationExpected(self, value):
        # PROTECTED REGION ID(CspSubarray.remSearchBeamsDurationExpected_write) ENABLED START #
        """Set the remSearchBeamsDurationExpected attribute."""
        pass
        # PROTECTED REGION END #    //  CspSubarray.remSearchBeamsDurationExpected_write

    def read_addSearchBeamDurationMeasured(self):
        # PROTECTED REGION ID(CspSubarray.addSearchBeamDurationMeasured_read) ENABLED START #
        """Return the addSearchBeamDurationMeasured attribute."""
@@ -1595,12 +1615,24 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):
        return self._cmd_duration_expected['addtimingbeams']
        # PROTECTED REGION END #    //  CspSubarray.addTimingBeamDurationExpected_read

    def write_addTimingBeamDurationExpected(self, value):
        # PROTECTED REGION ID(CspSubarray.addTimingBeamDurationExpected_write) ENABLED START #
        """Set the addTimingBeamDurationExpected attribute."""
        pass
        # PROTECTED REGION END #    //  CspSubarray.addTimingBeamDurationExpected_write

    def read_remTimingBeamsDurationExpected(self):
        # PROTECTED REGION ID(CspSubarray.remTimingBeamsDurationExpected_read) ENABLED START #
        """Return the remTimingBeamsDurationExpected attribute."""
        return self._cmd_duration_expected['removetimingbeams']
        # PROTECTED REGION END #    //  CspSubarray.remTimingBeamsDurationExpected_read

    def write_remTimingBeamsDurationExpected(self, value):
        # PROTECTED REGION ID(CspSubarray.remTimingBeamsDurationExpected_write) ENABLED START #
        """Set the remTimingBeamsDurationExpected attribute."""
        pass
        # PROTECTED REGION END #    //  CspSubarray.remTimingBeamsDurationExpected_write

    def read_addTimingBeamDurationMeasured(self):
        # PROTECTED REGION ID(CspSubarray.addTimingBeamDurationMeasured_read) ENABLED START #
        """Return the addTimingBeamDurationMeasured attribute."""
@@ -1637,6 +1669,12 @@ class CspSubarray(with_metaclass(DeviceMeta,SKASubarray)):
        return int(self._cmd_duration_expected['endsb'])
        # PROTECTED REGION END #    //  CspSubarray.endSBDurationExpected_read

    def write_endSBDurationExpected(self, value):
        # PROTECTED REGION ID(CspSubarray.endSBDurationExpected_write) ENABLED START #
        """Set the endSBDurationExpected attribute."""
        pass
        # PROTECTED REGION END #    //  CspSubarray.endSBDurationExpected_write

    def read_endSBDurationMeasured(self):
        # PROTECTED REGION ID(CspSubarray.endSBDurationMeasured_read) ENABLED START #
        """Return the endSBDurationMeasured attribute."""
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
"""Release information for Python Package"""

name = """csp-lmc-common"""
version = "0.3.0"
version = "0.3.1"
version_info = version.split(".")
description = """SKA CSP.LMC Common Software"""
author = "INAF-OAA"
+4 −3
Original line number Diff line number Diff line
@@ -287,15 +287,16 @@ class SubarrayRejectCmd(object):
            dev_instance = args[0]
            cmd_to_exec = f.__name__
            commands_to_reject = self._args
            dev_instance.logger.debug(
                "SubarrayRejectCmd: function {}".format(f.__name__))
            dev_instance.logger.info(
                "SubarrayRejectCmd decorator: command to execute {}".format(f.__name__))
            # If a sub-array is executing an AddXXX (RemoveXX) command, an exception is
            # thown only when the requested command is RemoveXXX (AddXXX)remove/add resources or ConfigureScan.
            # If the requested command is already running, the decorator returns.

            list_of_running_cmd = [cmd_name for cmd_name, cmd_state in dev_instance._cmd_execution_state.items()
                                   if cmd_state == CmdExecState.RUNNING]
            print(list_of_running_cmd)
            if list_of_running_cmd:
                dev_instance.logger.info("Commands {} are running".format(list_of_running_cmd))
            if cmd_to_exec.lower() in list_of_running_cmd:
                # the requested command is already running
                # return with no exception (see SKA Guidelines)
+2 −2
Original line number Diff line number Diff line
@@ -18,5 +18,5 @@ license = """BSD-3-Clause"""
url = """www.tango-controls.org"""
copyright = """"""

release=0.3.0
tag=csp-lmc-common-0.3.0
release=0.3.1
tag=csp-lmc-common-0.3.1
+7 −7
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/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/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">
      <inheritances classname="Device_Impl" sourcePath=""/>
      <inheritances classname="SKAObsDevice" sourcePath="../../../lmc-base-classes/skabase/SKAObsDevice"/>
      <inheritances classname="SKASubarray" sourcePath="/home/softir/ska-git/lmc-base-classes/skabase/SKASubarray"/>
      <inheritances classname="SKASubarray" sourcePath="/home/softir/src/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">
@@ -474,7 +474,7 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="Store the last valid scan configuration." label="Valid Scan Configuration" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="addSearchBeamDurationExpected" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="addSearchBeamDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
@@ -482,7 +482,7 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="The duration expected (in sec) for the AddSearchBeams command." label="AddSearchBeams command duration expected" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="remSearchBeamsDurationExpected" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="remSearchBeamsDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
@@ -506,7 +506,7 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="The duration measured (in sec) for the RemoveSearchBeams command." label="RemoveSearchBeams command duration measured" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="addTimingBeamDurationExpected" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="addTimingBeamDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
@@ -514,7 +514,7 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="The duration expected (in sec) for the AddTimingBeams command." label="AddTimingBeams command duration expected" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="remTimingBeamsDurationExpected" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="remTimingBeamsDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
@@ -538,7 +538,7 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="The duration measured (in sec) for the RemoveTimingBeams command." label="EndSB command duration measured" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="endSBDurationExpected" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="endSBDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
Loading