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

AT5-259: Created the CspSearchBeamsMonitor TANGO classderived from CspCapabilityMonitor.

Modified CspMaster and MidCspMaster to implements the SearchBeams attributed monitored by the
CspSearchBeamsMonitor class.
MidCspCapabilityMonitor defined as multiclass server of CSP.LMC monitor classes.
Updated docker-compose and dsconfig configuration files.
parent 76024c0b
Loading
Loading
Loading
Loading
+34 −18
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
            # Raised when a mapping (dictionary) key is not found in the set
            # of existing keys.
            # no proxy registered for the subelement device
            msg = "Can't retrieve the information of key {}".format(key_err)
            msg = "Can't retrieve proxy for device {}".format(key_err)
            self.logger.error(msg)
            return False
        except tango.DevFailed:
@@ -655,18 +655,6 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        dtype='DevVarStringArray',
    )

    SearchBeams = device_property(
        dtype='DevVarStringArray',
    )

    TimingBeams = device_property(
        dtype='DevVarStringArray',
    )

    VlbiBeams = device_property(
        dtype='DevVarStringArray',
    )

    SearchBeamsMonitor = device_property(
        dtype='DevString',
    )
@@ -1055,6 +1043,14 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        label="List of devices that completed the task",
        doc="List of devices that completed the task",
    )
    
    reservedSearchBeamIDs = attribute(
        dtype=('DevString',),
        max_dim_x=16,
        label="SearchBeams reserved IDS",
        doc="For each sub-array idm reports the list of the reserved SearchBeam IDs",
    )

    reportSearchBeamState = attribute(name="reportSearchBeamState",
        label="SearchBeam Capabilities State",
        forwarded=True
@@ -1115,10 +1111,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        label="VlbiBeams Capability devices addresses",
        forwarded=True
    )
    reservedSearchBeamIDs = attribute(name="reservedSearchBeamIDs",
        label="IDs of reserved SeachBeam Capabilities",
        forwarded=True
    )
    
    unassignedVlbiBeamIDs = attribute(name="unassignedVlbiBeamIDs",
        label="Unassigned VlbiBeam Capabilities IDs",
        forwarded=True
@@ -1131,7 +1124,22 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        label="Unassigned SeachBeam Capabilities IDs",
        forwarded=True
    )

    numOfUnassignedVlbiBeams = attribute(name="numOfUnassignedVlbiBeams",
        label="Num of onassigned VlbiBeam Capabilities IDs",
        forwarded=True
    )
    numOfUnassignedTimingBeams = attribute(name="numOfUnassignedTimingBeams",
        label="Num of unassigned TimingBeam Capabilities IDs",
        forwarded=True
    )
    numOfUnassignedSearchBeams = attribute(name="numOfUnassignedSearchBeams",
        label="Num of unassigned SeachBeam Capabilities IDs",
        forwarded=True
    )
    numOfReservedSearchBeams = attribute(name="numOfReservedSearchBeams",
        label="Number of reserved SeachBeam Capabilities",
        forwarded=True
    )
    searchBeamMembership = attribute(name="searchBeamMembership",
        label="SearchBeam Membership",
        forwarded=True
@@ -1673,6 +1681,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        """Return the cspSubarrayAddresses attribute."""
        return self.CspSubarrays
        # PROTECTED REGION END #    //  CspMaster.cspSubarrayAddresses_read
        
    def read_listOfDevCompletedTask(self):
        # PROTECTED REGION ID(CspMaster.listOfDevCompletedTask_read) ENABLED START #
        """Return the listOfDevCompletedTask attribute."""
@@ -1683,6 +1692,13 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        return self._list_dev_completed_task[self._last_executed_command]
        # PROTECTED REGION END #    //  CspMaster.listOfDevCompletedTask_read
    
    def read_reservedSearchBeamIDs(self):
        # PROTECTED REGION ID(CspMaster.reservedSearchBeamIDs_read) ENABLED START #
        """Return the reservedSearchBeamIDs attribute."""
        return ('',)
        # PROTECTED REGION END #    //  CspMaster.reservedSearchBeamIDs_read


    # --------
    # Commands
    # --------
+129 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
#
# This file is part of the CspSearchBeamsMonitor project
#
# INAF.SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.

""" CSP.LMC Capability monitor for SearchBeams Capabilty devices

CSP.LMC Capability monitor for SearchBeams Capabilty devices
"""
# PROTECTED REGION ID (CspSearchBeamsMonitor.standardlibray_import) ENABLED START #
# Python standard library
from future.utils import with_metaclass
# PROTECTED REGION END# //CspSearchBeamsMonitor.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from csp_lmc_common.CspCapabilityMonitor import CspCapabilityMonitor
# Additional import
# PROTECTED REGION ID(CspSearchBeamsMonitor.additionnal_import) ENABLED START #
# PROTECTED REGION END #    //  CspSearchBeamsMonitor.additionnal_import

__all__ = ["CspSearchBeamsMonitor", "main"]


class CspSearchBeamsMonitor(with_metaclass(DeviceMeta, CspCapabilityMonitor)):
    """
    CSP.LMC Capability monitor for SearchBeams Capabilty devices

    **Properties:**

    - Device Property
    """
    # PROTECTED REGION ID(CspSearchBeamsMonitor.class_variable) ENABLED START #
    # PROTECTED REGION END #    //  CspSearchBeamsMonitor.class_variable

    # -----------------
    # Device Properties
    # -----------------

    # ----------
    # Attributes
    # ----------

    numOfReservedIDs = attribute(
        dtype='DevUShort',
        label="Number of reserved IDs",
        doc="The number of all sub-arrays reserved IDs.",
    )

    reservedIDs = attribute(
        dtype=('DevString',),
        max_dim_x=16,
        label="Number of reserved IDs",
        doc="The number of SearchBeam IDs reserved to each sub-array",
    )

    # ---------------
    # General methods
    # ---------------

    def init_device(self):
        """Initialises the attributes and properties of the CspSearchBeamsMonitor."""
        CspCapabilityMonitor.init_device(self)
        # PROTECTED REGION ID(CspSearchBeamsMonitor.init_device) ENABLED START #
        # self._reserved_ids: the number of reserved searchBeams for each subarray
        # dictionary:
        # keys: subarray ID
        # value list of SearchBeams IDs
        self._reserved_ids = {}
        self._num_of_reserved_ids = 0
        # PROTECTED REGION END #    //  CspSearchBeamsMonitor.init_device

    def always_executed_hook(self):
        """Method always executed before any TANGO command is executed."""
        # PROTECTED REGION ID(CspSearchBeamsMonitor.always_executed_hook) ENABLED START #
        # PROTECTED REGION END #    //  CspSearchBeamsMonitor.always_executed_hook

    def delete_device(self):
        """Hook to delete resources allocated in init_device.

        This method allows for any memory or other resources allocated in the
        init_device method to be released.  This method is called by the device
        destructor and by the device Init command.
        """
        # PROTECTED REGION ID(CspSearchBeamsMonitor.delete_device) ENABLED START #
        # PROTECTED REGION END #    //  CspSearchBeamsMonitor.delete_device
    # ------------------
    # Attributes methods
    # ------------------

    def read_numOfReservedIDs(self):
        # PROTECTED REGION ID(CspSearchBeamsMonitor.numOfReservedIDs_read) ENABLED START #
        """Return the numOfReservedIDs attribute."""
        return self._num_of_reserved_ids
        # PROTECTED REGION END #    //  CspSearchBeamsMonitor.numOfReservedIDs_read

    def read_reservedIDs(self):
        # PROTECTED REGION ID(CspSearchBeamsMonitor.reservedIDs_read) ENABLED START #
        """Return the reservedIDs attribute."""
        return ('',)
        # PROTECTED REGION END #    //  CspSearchBeamsMonitor.reservedIDs_read


    # --------
    # Commands
    # --------

# ----------
# Run server
# ----------


def main(args=None, **kwargs):
    # PROTECTED REGION ID(CspSearchBeamsMonitor.main) ENABLED START #
    return run((CspSearchBeamsMonitor,), args=args, **kwargs)
    # PROTECTED REGION END #    //  CspSearchBeamsMonitor.main

if __name__ == '__main__':
    main()
+19 −14
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="CspMaster" pogoRevision="9.6">
    <description description="CSP.LMC Common Class for the CSPMaster TANGO Device." title="CSP.LMC Common CspMaster" 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.LMC Common Class for the CSPMaster TANGO Device." title="CSP.LMC Common CspMaster" 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="SKABaseDevice" sourcePath="../../../lmc-base-classes/skabase/SKABaseDevice"/>
      <inheritances classname="SKAMaster" sourcePath="../../../lmc-base-classes/skabase/SKAMaster"/>
@@ -65,7 +65,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>
    <commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="none">
@@ -470,14 +469,6 @@
      <properties description="" label="PST administrative mode" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
      <eventCriteria relChange="" absChange="1" period=""/>
    </attributes>
    <attributes name="unassignedSearchBeamsNum" attType="Scalar" rwType="READ" 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"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="Report the number of unassigned SearchBeam Capabilities.&#xA;This number does not take in account the number of reserved SearchBeams." label="Number of unassigned SearchBeam Capabilities" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="numOfDevCompletedTask" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:UShortType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
@@ -578,6 +569,14 @@
      <status abstract="false" inherited="true" concrete="true"/>
      <properties description="Current logging targets for this device - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="reservedSearchBeamIDs" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="16" maxY="" allocReadMember="true" isDynamic="false">
      <dataType xsi:type="pogoDsl:StringType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="For each sub-array idm reports the list of the reserved SearchBeam IDs" label="SearchBeams reserved IDS" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <forwardedAttributes name="reportSearchBeamState" label="SearchBeam Capabilities State">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
@@ -623,9 +622,6 @@
    <forwardedAttributes name="vlbiBeamAddresses" label="VlbiBeams Capability devices addresses">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
    <forwardedAttributes name="reservedSearchBeamIDs" label="IDs of reserved SeachBeam Capabilities">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
    <forwardedAttributes name="unassignedVlbiBeamIDs" label="Unassigned VlbiBeam Capabilities IDs">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
@@ -635,7 +631,16 @@
    <forwardedAttributes name="unassignedSearchBeamIDs" label="Unassigned SeachBeam Capabilities IDs">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
    <forwardedAttributes name="reservedSearchBeamNum" label="Number of reserved SeachBeam Capabilities">
    <forwardedAttributes name="numOfUnassignedVlbiBeams" label="Num of onassigned VlbiBeam Capabilities IDs">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
    <forwardedAttributes name="numOfUnassignedTimingBeams" label="Num of unassigned TimingBeam Capabilities IDs">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
    <forwardedAttributes name="numOfUnassignedSearchBeams" label="Num of unassigned SeachBeam Capabilities IDs">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
    <forwardedAttributes name="numOfReservedSearchBeams" label="Number of reserved SeachBeam Capabilities">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>
    <forwardedAttributes name="searchBeamMembership" label="SearchBeam Membership">
+4 −91
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
#
# This file is part of the MidCspSubarrayProcModePss project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.

""" MID CSP Subarray Processing Mode PSS Capability

The class exposes parameters and commands required for monitor and
control of the Processing PSS Mode for a single MID Csp Subarray.
"""

from future.utils import with_metaclass
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from csp_lmc_common.CspCapabilityMonitor import CspCapabilityMonitor
# Additional import
# PROTECTED REGION ID(MidCspSubarrayProcModePss.additionnal_import) ENABLED START #
# PROTECTED REGION END #    //  MidCspSubarrayProcModePss.additionnal_import

__all__ = ["MidCspSubarrayProcModePss", "main"]


class MidCspCapabilityMonitor(with_metaclass(DeviceMeta, CspCapabilityMonitor)):
    """
    The class exposes parameters and commands required for monitor and
    control of the Processing PSS Mode for a single MID Csp Subarray.

    **Properties:**

    - Device Property
    """
    # PROTECTED REGION ID(MidCspSubarrayProcModePss.class_variable) ENABLED START #
    # PROTECTED REGION END #    //  MidCspSubarrayProcModePss.class_variable

    # -----------------
    # Device Properties
    # -----------------


    # Attributes
    # ----------

    # ---------------
    # General methods
    # ---------------

    def init_device(self):
        """Initialises the attributes and properties of the MidCspSubarrayProcModePss."""
        CspCapabilityMonitor.init_device(self)
        # PROTECTED REGION ID(MidCspSubarrayProcModePss.init_device) ENABLED START #
        # PROTECTED REGION END #    //  MidCspSubarrayProcModePss.init_device

    def always_executed_hook(self):
        """Method always executed before any TANGO command is executed."""
        # PROTECTED REGION ID(MidCspSubarrayProcModePss.always_executed_hook) ENABLED START #
        # PROTECTED REGION END #    //  MidCspSubarrayProcModePss.always_executed_hook

    def delete_device(self):
        """Hook to delete resources allocated in init_device.

        This method allows for any memory or other resources allocated in the
        init_device method to be released.  This method is called by the device
        destructor and by the device Init command.
        """
        # PROTECTED REGION ID(MidCspSubarrayProcModePss.delete_device) ENABLED START #
        # PROTECTED REGION END #    //  MidCspSubarrayProcModePss.delete_device
    # ------------------
    # Attributes methods
    # ------------------


    # --------
    # Commands
    # --------

# ----------
# Run server
# ----------

from csp_lmc_common.CspCapabilityMonitor import CspCapabilityMonitor
from csp_lmc_common.CspSearchBeamsMonitor import CspSearchBeamsMonitor

def main(args=None, **kwargs):
    # PROTECTED REGION ID(MidCspSubarrayProcModePss.main) ENABLED START #
    return run((MidCspCapabilityMonitor,), args=args, **kwargs)
    # PROTECTED REGION END #    //  MidCspSubarrayProcModePss.main
    return run(classes=(CspCapabilityMonitor, CspSearchBeamsMonitor), args=args, **kwargs)


if __name__ == '__main__':
    main()
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ import sys
#sys.path.insert(0, pkg_path)

from MidCspMasterBase import MidCspMasterBase
from MidCspCapabilityMonitor import MidCspCapabilityMonitor

def main(args=None, **kwargs):
    return run(classes=(MidCspMasterBase,), args=args, **kwargs)
Loading