Commit 76fd13a3 authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

AT5-259: TANGO Devices for CSP.LMC Subarray inherent Capabilities and CSP.LMC Beams.

MID specific implementation og Inherent Capability and Beam devices.
parent 6c66ac54
Loading
Loading
Loading
Loading
+154 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
#
# This file is part of the CspBeamCapabilityBaseClass project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.

""" CSP Beam Capability Base Class

Parent class of the CSP Beams Capability
"""

# 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 SKACapability import SKACapability
# Additional import
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.additionnal_import) ENABLED START #
# PROTECTED REGION END #    //  CspBeamCapabilityBaseClass.additionnal_import

__all__ = ["CspBeamCapabilityBaseClass", "main"]


class CspBeamCapabilityBaseClass(SKACapability):
    """
    Parent class of the CSP Beams Capability

    **Properties:**

    - Device Property
    
    
    
    
    
    
    
    """
    __metaclass__ = DeviceMeta
    # PROTECTED REGION ID(CspBeamCapabilityBaseClass.class_variable) ENABLED START #
    # PROTECTED REGION END #    //  CspBeamCapabilityBaseClass.class_variable

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








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















    subarrayMembership = attribute(
        dtype='DevUShort',
        label="The Beam Capability subarray affiliation.",
        doc="The subarray ID the CSP Beam Capability belongs to.",
    )



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

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

    def always_executed_hook(self):
        """Method always executed before any TANGO command is executed."""
        # PROTECTED REGION ID(CspBeamCapabilityBaseClass.always_executed_hook) ENABLED START #
        # PROTECTED REGION END #    //  CspBeamCapabilityBaseClass.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(CspBeamCapabilityBaseClass.delete_device) ENABLED START #
        # PROTECTED REGION END #    //  CspBeamCapabilityBaseClass.delete_device
    # ------------------
    # Attributes methods
    # ------------------

    def read_subarrayMembership(self):
        # PROTECTED REGION ID(CspBeamCapabilityBaseClass.subarrayMembership_read) ENABLED START #
        """Return the subarrayMembership attribute."""
        return 0
        # PROTECTED REGION END #    //  CspBeamCapabilityBaseClass.subarrayMembership_read


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

    @command(
        dtype_out='ConstDevString',
        doc_out="Observation state",
    )
    @DebugIt()
    def ObsState(self):
        # PROTECTED REGION ID(CspBeamCapabilityBaseClass.ObsState) ENABLED START #
        """
        Set the observation state

        :return:'ConstDevString'
        Observation state
        """
        return ""
        # PROTECTED REGION END #    //  CspBeamCapabilityBaseClass.ObsState

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


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

if __name__ == '__main__':
    main()
+228 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
#
# This file is part of the CspSearchBeamCapability project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.

""" CSP  SearchBeam Capability

The class models the Capability Search Beam exsposing
 the attributes and commands used to monitor and control beamforming
and PSS pulsar search in a single beam.
In particular it maps components used for beamforming with those
that perform PSS processing (pulsar search and transients).
Used for development of LOW and MID specific devices.
"""

# 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 CspBeamCapabilityBaseClass import CspBeamCapabilityBaseClass
# Additional import
# PROTECTED REGION ID(CspSearchBeamCapability.additionnal_import) ENABLED START #
# PROTECTED REGION END #    //  CspSearchBeamCapability.additionnal_import

__all__ = ["CspSearchBeamCapability", "main"]


class CspSearchBeamCapability(CspBeamCapabilityBaseClass):
    """
    The class models the Capability Search Beam exsposing
     the attributes and commands used to monitor and control beamforming
    and PSS pulsar search in a single beam.
    In particular it maps components used for beamforming with those
    that perform PSS processing (pulsar search and transients).
    Used for development of LOW and MID specific devices.

    **Properties:**

    - Device Property
    
    
    
    
    
    
    
    """
    __metaclass__ = DeviceMeta
    # PROTECTED REGION ID(CspSearchBeamCapability.class_variable) ENABLED START #
    # PROTECTED REGION END #    //  CspSearchBeamCapability.class_variable

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








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















    pssPipelineTangoAddr = attribute(
        dtype='DevString',
        label="The PSS pipeline name",
        doc="The PssPipeline TANGO Device FQDN.",
    )

    pssPipelineIPAddr = attribute(
        dtype='DevString',
        label="PSS Node IP address",
        doc="The IP address of the PSS node hosting the PssPipeline TANGO Device and running the\ndata reduction pipeline.",
    )

    pssPipelineIPPort = attribute(
        dtype='DevUShort',
        label="The PSS data pipeline IP port",
        doc="The IP port the data reduction processing pipeline is listening to receive commands and\ninput parameters.",
    )

    pssPipelineState = attribute(
        dtype='DevState',
        label="The PssPipeline State",
        doc="The STate of the PssPipeline TANGO Device. It represents the operational state of the\nPSS data reduction pipeline.",
    )

    pssPipelineAdminMode = attribute(
        dtype='DevEnum',
        access=AttrWriteType.READ_WRITE,
        label="The PssPipeline adminMode",
        doc="The adminMode of the PssPipeline TANGO Device.",
    )

    pssPipelineObsState = attribute(
        dtype='DevEnum',
        label="The PssPipeline obsState",
        doc="The obsState of the PssPipeline TANGO Device.",
    )

    pssPipelineObsMode = attribute(
        dtype='DevEnum',
        label="The PssPipeline obsMode",
        doc="The obsMode of the PSsPipeline TANGO Device.",
    )




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

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

    def always_executed_hook(self):
        """Method always executed before any TANGO command is executed."""
        # PROTECTED REGION ID(CspSearchBeamCapability.always_executed_hook) ENABLED START #
        # PROTECTED REGION END #    //  CspSearchBeamCapability.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(CspSearchBeamCapability.delete_device) ENABLED START #
        # PROTECTED REGION END #    //  CspSearchBeamCapability.delete_device
    # ------------------
    # Attributes methods
    # ------------------

    def read_pssPipelineTangoAddr(self):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineTangoAddr_read) ENABLED START #
        """Return the pssPipelineTangoAddr attribute."""
        return ''
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineTangoAddr_read

    def read_pssPipelineIPAddr(self):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineIPAddr_read) ENABLED START #
        """Return the pssPipelineIPAddr attribute."""
        return ''
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineIPAddr_read

    def read_pssPipelineIPPort(self):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineIPPort_read) ENABLED START #
        """Return the pssPipelineIPPort attribute."""
        return 0
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineIPPort_read

    def read_pssPipelineState(self):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineState_read) ENABLED START #
        """Return the pssPipelineState attribute."""
        return PyTango.DevState.UNKNOWN
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineState_read

    def read_pssPipelineAdminMode(self):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineAdminMode_read) ENABLED START #
        """Return the pssPipelineAdminMode attribute."""
        return 0
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineAdminMode_read

    def write_pssPipelineAdminMode(self, value):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineAdminMode_write) ENABLED START #
        """Set the pssPipelineAdminMode attribute."""
        pass
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineAdminMode_write

    def read_pssPipelineObsState(self):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineObsState_read) ENABLED START #
        """Return the pssPipelineObsState attribute."""
        return 0
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineObsState_read

    def read_pssPipelineObsMode(self):
        # PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineObsMode_read) ENABLED START #
        """Return the pssPipelineObsMode attribute."""
        return 0
        # PROTECTED REGION END #    //  CspSearchBeamCapability.pssPipelineObsMode_read


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

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


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

if __name__ == '__main__':
    main()
+154 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayInherentCapability project
#
# INAF, SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.

""" CSP Subarray Inherent Capability Base Class

Parent class for the CSP Subarray Processing Mode Capability devices.
Used as a base for developement of CSP Inherent Capabilities.
"""
# PROTECTED REGION ID (CspSubarrayInherentCapability.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
from future.utils import with_metaclass
# PROTECTED REGION END# //CspSubarrayInherentCapability.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 
# Additional import
# PROTECTED REGION ID(CspSubarrayInherentCapability.additionnal_import) ENABLED START #
#
from skabase.SKACapability import SKACapability
from skabase.auxiliary import utils

#
# PROTECTED REGION END #    //  CspSubarrayInherentCapability.additionnal_import

__all__ = ["CspSubarrayInherentCapability", "main"]


class CspSubarrayInherentCapability(with_metaclass(DeviceMeta, SKACapability)):
    """
    Parent class for the CSP Subarray Processing Mode Capability devices.
    Used as a base for developement of CSP Inherent Capabilities.

    **Properties:**

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

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

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


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

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

    def always_executed_hook(self):
        """Method always executed before any TANGO command is executed."""
        # PROTECTED REGION ID(CspSubarrayInherentCapability.always_executed_hook) ENABLED START #
        # PROTECTED REGION END #    //  CspSubarrayInherentCapability.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(CspSubarrayInherentCapability.delete_device) ENABLED START #
        # PROTECTED REGION END #    //  CspSubarrayInherentCapability.delete_device
    # ------------------
    # Attributes methods
    # ------------------


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

    @command(
        dtype_out='ConstDevString',
        doc_out="Observation state",
    )
    @DebugIt()
    def ObsState(self):
        # PROTECTED REGION ID(CspSubarrayInherentCapability.ObsState) ENABLED START #
        """
        Set the observation state

        :return:'ConstDevString'
        Observation state
        """
        return ""
        # PROTECTED REGION END #    //  CspSubarrayInherentCapability.ObsState

    @command(
    )
    @DebugIt()
    def On(self):
        # PROTECTED REGION ID(CspSubarrayInherentCapability.On) ENABLED START #
        """
        
            Enable the CSP Subarray inherent Capability setting its State to ON.
            State at initialization is OFF

        :return:None
        """
        pass
        # PROTECTED REGION END #    //  CspSubarrayInherentCapability.On

    @command(
    )
    @DebugIt()
    def Off(self):
        # PROTECTED REGION ID(CspSubarrayInherentCapability.Off) ENABLED START #
        """
        
            Disable the CspSubarray inherent Capability
            setting the State to OFF.

        :return:None
        """
        pass
        # PROTECTED REGION END #    //  CspSubarrayInherentCapability.Off

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


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

if __name__ == '__main__':
    main()
+132 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayProcModeCorrelation project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.

""" CSP Subarray Processing Mode Correlation Capability

The class exposes parameters nd commands required for monitor and
control of the correlator functions for a single subarray.
It is used as a base for the development of LOW and MID specific
capabilities.
"""

# 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 CspSubarrayInherentCapability import CspSubarrayInherentCapability
# Additional import
# PROTECTED REGION ID(CspSubarrayProcModeCorrelation.additionnal_import) ENABLED START #
# PROTECTED REGION END #    //  CspSubarrayProcModeCorrelation.additionnal_import

__all__ = ["CspSubarrayProcModeCorrelation", "main"]


class CspSubarrayProcModeCorrelation(CspSubarrayInherentCapability):
    """
    The class exposes parameters nd commands required for monitor and
    control of the correlator functions for a single subarray.
    It is used as a base for the development of LOW and MID specific
    capabilities.

    **Properties:**

    - Device Property
    
    
    
    
    
    
    
    """
    __metaclass__ = DeviceMeta
    # PROTECTED REGION ID(CspSubarrayProcModeCorrelation.class_variable) ENABLED START #
    # PROTECTED REGION END #    //  CspSubarrayProcModeCorrelation.class_variable

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








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

















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

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

    def always_executed_hook(self):
        """Method always executed before any TANGO command is executed."""
        # PROTECTED REGION ID(CspSubarrayProcModeCorrelation.always_executed_hook) ENABLED START #
        # PROTECTED REGION END #    //  CspSubarrayProcModeCorrelation.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(CspSubarrayProcModeCorrelation.delete_device) ENABLED START #
        # PROTECTED REGION END #    //  CspSubarrayProcModeCorrelation.delete_device
    # ------------------
    # Attributes methods
    # ------------------


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

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


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

if __name__ == '__main__':
    main()
+134 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayProcModePss project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.

""" CSP Subarray PSS Capability

The class exposes parameters and commands required 
for monitor and control of the Procesing Mode PSS in a 
single subarray.
It is used as base for developement of LOW and MID 
specific capabilities.
"""

# 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 CspSubarrayInherentCapability import CspSubarrayInherentCapability
# Additional import
# PROTECTED REGION ID(CspSubarrayProcModePss.additionnal_import) ENABLED START #
# PROTECTED REGION END #    //  CspSubarrayProcModePss.additionnal_import

__all__ = ["CspSubarrayProcModePss", "main"]


class CspSubarrayProcModePss(CspSubarrayInherentCapability):
    """
    The class exposes parameters and commands required 
    for monitor and control of the Procesing Mode PSS in a 
    single subarray.
    It is used as base for developement of LOW and MID 
    specific capabilities.

    **Properties:**

    - Device Property
    
    
    
    
    
    
    
    """
    __metaclass__ = DeviceMeta
    # PROTECTED REGION ID(CspSubarrayProcModePss.class_variable) ENABLED START #
    # PROTECTED REGION END #    //  CspSubarrayProcModePss.class_variable

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








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

















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

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

    def always_executed_hook(self):
        """Method always executed before any TANGO command is executed."""
        # PROTECTED REGION ID(CspSubarrayProcModePss.always_executed_hook) ENABLED START #
        # PROTECTED REGION END #    //  CspSubarrayProcModePss.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(CspSubarrayProcModePss.delete_device) ENABLED START #
        # PROTECTED REGION END #    //  CspSubarrayProcModePss.delete_device
    # ------------------
    # Attributes methods
    # ------------------


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

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


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

if __name__ == '__main__':
    main()
Loading