Skip to content
Snippets Groups Projects
Select Git revision
  • 454745b27335dfb03d1832a140efbfd1c46e101a
  • master default protected
  • L2SS-1957-remove-pcon-control
  • control-single-hba-and-lba
  • stabilise-landing-page
  • all-stations-lofar2
  • L2SS-2357-fix-ruff
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • L2SS-2129-Add-Subrack-Routine
  • Also-listen-internal-to-rpc
  • fix-build-dind
  • L2SS-2153--Improve-Error-Handling
  • L2SS-2153-Add-Grpc-Gateway-support
  • L2SS-1970-apsct-lol
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
  • v0.52.1-rc1 protected
  • v0.51.9-6 protected
  • v0.51.9-5 protected
  • v0.51.9-4 protected
  • v0.51.9-3 protected
  • v0.51.9-2 protected
  • v0.51.9-1 protected
  • v0.51.9 protected
  • v0.51.8 protected
  • v0.39.15-wsrttwo protected
  • v0.39.15-wsrt protected
  • v0.39.14-wsrt protected
  • v0.51.6 protected
  • v0.51.5-1 protected
  • v0.51.5 protected
41 results

digitalbeam.rst

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    HW_device_template.py 2.17 KiB
    # -*- coding: utf-8 -*-
    #
    # This file is part of the PCC project
    #
    #
    #
    # Distributed under the terms of the APACHE license.
    # See LICENSE.txt for more info.
    
    """ Hardware Device Server for LOFAR2.0
    
    """
    
    # PyTango imports
    from tango.server import run
    # Additional import
    
    from src.hardware_device import *
    
    
    __all__ = ["HW_dev"]
    
    class HW_dev(hardware_device):
        """
        This class is the minimal (read empty) implementation of a class using 'hardware_device'
        """
    
        # ----------
        # Attributes
        # ----------
        """
        attribute wrapper objects can be declared here. All attribute wrapper objects will get automatically put in a ist (attr_list) for easy access
    
        example = attribute_wrapper(comms_annotation="this is an example", datatype=numpy.double, dims=(8, 2), access=AttrWriteType.READ_WRITE)
        ...
    
        """
    
        def always_executed_hook(self):
            """Method always executed before any TANGO command is executed."""
            pass
    
        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 (a Tango built-in).
            """
            self.debug_stream("Shutting down...")
    
            self.Off()
            self.debug_stream("Shut down.  Good bye.")
    
        # --------
        # overloaded functions
        # --------
        def fault(self):
            """ user code here. is called when the state is set to FAULT """
            pass
    
        def off(self):
            """ user code here. is called when the state is set to OFF """
            pass
    
        def on(self):
            """ user code here. is called when the state is set to ON """
    
            pass
    
        def standby(self):
            """ user code here. is called when the state is set to STANDBY """
            pass
    
        def initialise(self):
            """ user code here. is called when the sate is set to INIT """
            pass
    
    # ----------
    # Run server
    # ----------
    def main(args=None, **kwargs):
        """Main function of the hardware device module."""
        return run((HW_dev,), args=args, **kwargs)
    
    
    if __name__ == '__main__':
        main()