예제 #1
0
파일: fcalc.py 프로젝트: RedhawkSDR/fcalc
 def initialize(self):
     """
     This is called by the framework immediately after your component registers with the NameService.
     
     In general, you should add customization here and not in the __init__ constructor.  If you have 
     a custom port implementation you can override the specific implementation here with a statement
     similar to the following:
       self.some_port = MyPortImplementation()
     """
     Resource.initialize(self)
     self.port_a = CxPortBULKIODataFloatIn_i("a", maxsize=self.DEFAULT_QUEUE_SIZE)
     self.port_b = CxPortBULKIODataFloatIn_i("b", maxsize=self.DEFAULT_QUEUE_SIZE)
     self.port_out = CxPortBULKIODataFloatOut_i("out")       
     
     #take care of the requested imports    
     #we are supporting both syntax for imports
     #IE - "import x" and "from x import *"
     #this allows users to use either math.cos or just cos 
     #and they will both work
     self.globals = {}
     self.oldA = []
     self.oldB = []
     self.useA = False
     self.useB = False    
     #call this in case we already have a good equation 
     self.sri = None
     self.streamID = None
     self.firsttime = True
     
     self.addPropertyChangeListener("import", self.propChange_import)
     self.addPropertyChangeListener("equation", self.propChange_equation)
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component
            self.port_dataDouble = PortBULKIODataDoubleIn_i(self, "dataDouble", self.DEFAULT_QUEUE_SIZE)

            self.port_dataFloat = PortBULKIODataFloatOut_i(self, "dataFloat")
    def initialize(self):
        Resource.initialize(self)

        self.port_dataCharIn = bulkio.InCharPort("dataCharIn")
        self.port_dataOctetIn = bulkio.InOctetPort("dataOctetIn")
        self.port_dataShortIn = bulkio.InShortPort("dataShortIn")
        self.port_dataUShortIn = bulkio.InUShortPort("dataUShortIn")
        self.port_dataLongIn = bulkio.InLongPort("dataLongIn")
        self.port_dataULongIn = bulkio.InULongPort("dataULongIn")
        self.port_dataLongLongIn = bulkio.InLongLongPort("dataLongLongIn")
        self.port_dataULongLongIn = bulkio.InULongLongPort("dataULongLongIn")
        self.port_dataFloatIn = bulkio.InFloatPort("dataFloatIn")
        self.port_dataDoubleIn = bulkio.InDoublePort("dataDoubleIn")
        self.port_dataFileIn = bulkio.InFilePort("dataFileIn")
        self.port_dataXMLIn = bulkio.InXMLPort("dataXMLIn")
        self.port_dataSDDSIn = bulkio.InSDDSPort("dataSDDSIn")

        self.port_dataCharOut = bulkio.OutCharPort("dataCharOut")
        self.port_dataOctetOut = bulkio.OutOctetPort("dataOctetOut")
        self.port_dataShortOut = bulkio.OutShortPort("dataShortOut")
        self.port_dataUShortOut = bulkio.OutUShortPort("dataUShortOut")
        self.port_dataLongOut = bulkio.OutLongPort("dataLongOut")
        self.port_dataULongOut = bulkio.OutULongPort("dataULongOut")
        self.port_dataLongLongOut = bulkio.OutLongLongPort("dataLongLongOut")
        self.port_dataULongLongOut = bulkio.OutULongLongPort(
            "dataULongLongOut")
        self.port_dataFloatOut = bulkio.OutFloatPort("dataFloatOut")
        self.port_dataDoubleOut = bulkio.OutDoublePort("dataDoubleOut")
        self.port_dataFileOut = bulkio.OutFilePort("dataFileOut")
        self.port_dataXMLOut = bulkio.OutXMLPort("dataXMLOut")
        self.port_dataSDDSOut = bulkio.OutSDDSPort("dataSDDSOut")

        self.port_propEvent = PropertyEventSupplier(self)
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component
            self.port_comp_resource_in = PortCFResourceIn_i(self, "comp_resource_in")

            self.port_comp_resource_out = PortCFResourceOut_i(self, "comp_resource_out")
예제 #5
0
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component
            self.port_inputPort = PortBULKIODataFloatIn_i(self, "inputPort", self.DEFAULT_QUEUE_SIZE)

            self.port_outputPort = PortBULKIODataFloatOut_i(self, "outputPort")
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component
            self.port_dataShort_in = PortBULKIODataShortIn_i(self, "dataShort_in", self.DEFAULT_QUEUE_SIZE)

            self.port_dataShort_out = PortBULKIODataShortOut_i(self, "dataShort_out")
예제 #7
0
 def initialize(self):
     """
     This is called by the framework immediately after your component registers with the NameService.
     
     In general, you should add customization here and not in the __init__ constructor.  If you have 
     a custom port implementation you can override the specific implementation here with a statement
     similar to the following:
       self.some_port = MyPortImplementation()
     """
     Resource.initialize(self)
     self.port_a = CxPortBULKIODataFloatIn_i("a", maxsize=self.DEFAULT_QUEUE_SIZE)
     self.port_b = CxPortBULKIODataFloatIn_i("b", maxsize=self.DEFAULT_QUEUE_SIZE)
     self.port_out = CxPortBULKIODataFloatOut_i("out")       
     
     #take care of the requested imports    
     #we are supporting both syntax for imports
     #IE - "import x" and "from x import *"
     #this allows users to use either math.cos or just cos 
     #and they will both work
     self.globals = {}
     self.oldA = []
     self.oldB = []
     self.useA = False
     self.useB = False    
     #call this in case we already have a good equation 
     self.sri = None
     self.streamID = None
     self.firsttime = True
     
     self.addPropertyChangeListener("import", self.propChange_import)
     self.addPropertyChangeListener("equation", self.propChange_equation)
        def initialize(self):
            Resource.initialize(self)

            self.port_dataCharIn = bulkio.InCharPort( "dataCharIn")
            self.port_dataOctetIn = bulkio.InOctetPort( "dataOctetIn")
            self.port_dataShortIn = bulkio.InShortPort( "dataShortIn")
            self.port_dataUShortIn = bulkio.InUShortPort( "dataUShortIn")
            self.port_dataLongIn = bulkio.InLongPort( "dataLongIn")
            self.port_dataULongIn = bulkio.InULongPort( "dataULongIn")
            self.port_dataLongLongIn = bulkio.InLongLongPort( "dataLongLongIn")
            self.port_dataULongLongIn = bulkio.InULongLongPort( "dataULongLongIn")
            self.port_dataFloatIn = bulkio.InFloatPort( "dataFloatIn")
            self.port_dataDoubleIn = bulkio.InDoublePort( "dataDoubleIn")
            self.port_dataFileIn = bulkio.InFilePort( "dataFileIn")
            self.port_dataXMLIn = bulkio.InXMLPort( "dataXMLIn")
            self.port_dataSDDSIn = bulkio.InSDDSPort( "dataSDDSIn")


            self.port_dataCharOut = bulkio.OutCharPort( "dataCharOut")
            self.port_dataOctetOut = bulkio.OutOctetPort( "dataOctetOut")
            self.port_dataShortOut = bulkio.OutShortPort( "dataShortOut")
            self.port_dataUShortOut = bulkio.OutUShortPort( "dataUShortOut")
            self.port_dataLongOut = bulkio.OutLongPort( "dataLongOut")
            self.port_dataULongOut = bulkio.OutULongPort( "dataULongOut")
            self.port_dataLongLongOut = bulkio.OutLongLongPort( "dataLongLongOut")
            self.port_dataULongLongOut = bulkio.OutULongLongPort( "dataULongLongOut")
            self.port_dataFloatOut = bulkio.OutFloatPort( "dataFloatOut")
            self.port_dataDoubleOut = bulkio.OutDoublePort( "dataDoubleOut")
            self.port_dataFileOut = bulkio.OutFilePort( "dataFileOut")
            self.port_dataXMLOut = bulkio.OutXMLPort( "dataXMLOut")
            self.port_dataSDDSOut = bulkio.OutSDDSPort( "dataSDDSOut")

            self.port_propEvent = PropertyEventSupplier(self)
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component
            self.port_a = PortBULKIODataDoubleIn_i(self, "a", self.DEFAULT_QUEUE_SIZE)
            self.port_b = PortBULKIODataDoubleIn_i(self, "b", self.DEFAULT_QUEUE_SIZE)

            self.port_out = PortBULKIODataDoubleOut_i(self, "out")
    def initialize(self):
        Resource.initialize(self)

        # Instantiate the default implementations for all ports on this component
        self.port_comp_resource_in = PortCFResourceIn_i(
            self, "comp_resource_in")

        self.port_comp_resource_out = PortCFResourceOut_i(
            self, "comp_resource_out")
예제 #11
0
 def initialize(self):
     Resource.initialize(self)
     self.toTest = TestUsesPort()
     self.fromOther = TestProvidesPort(self._get_identifier() + "/resource_in")
     self.toPropSet = PropSetUsesPort()
     self.eventSupplier = EventSupplierPort()
     self.eventConsumer = EventConsumerPort(self._onPush)
     self.toDomainManager = DomainManagerUsesPort()
     self.toDeviceManager = DeviceManagerUsesPort()
예제 #12
0
 def initialize(self):
     Resource.initialize(self)
     self.toTest = TestUsesPort()
     self.fromOther = TestProvidesPort(self._get_identifier() +
                                       "/resource_in")
     self.toPropSet = PropSetUsesPort()
     self.eventSupplier = EventSupplierPort()
     self.eventConsumer = EventConsumerPort(self._onPush)
     self.toDomainManager = DomainManagerUsesPort()
     self.toDeviceManager = DeviceManagerUsesPort()
예제 #13
0
    def initialize(self):
        Resource.initialize(self)
        self.prop1 = "MyDefault1"
        self.prop2.append("1")
        self.prop2.append("2")
        self.prop2.append("3")

        self.struct.field1 = "StructDefault"
        self.struct.field2 = 100
        self.struct.field3 = 1.0

        self.multicasts.append(TestPythonProps.MulticastAddress("127.0.0.1", 123))
        self.multicasts.append(TestPythonProps.MulticastAddress("127.0.0.1", 456))
    def initialize(self):
        Resource.initialize(self)

        # Instantiate the default implementations for all ports on this component
        self.port_dataChar = bulkio.OutCharPort("dataChar")
        self.port_dataFile = bulkio.OutFilePort("dataFile")
        self.port_dataShort = bulkio.OutShortPort("dataShort")
        self.port_dataUlong = bulkio.OutULongPort("dataUlong")
        self.port_dataUlongLong = bulkio.OutULongLongPort("dataUlongLong")
        self.port_dataUshort = bulkio.OutUShortPort("dataUshort")
        self.port_dataXML = bulkio.OutXMLPort("dataXML")
        self.port_dataLong = bulkio.OutLongPort("dataLong")
        self.port_dataLongLong = bulkio.OutLongLongPort("dataLongLong")
        self.port_dataOctet = bulkio.OutOctetPort("dataOctet")
        self.port_dataFloat = bulkio.OutFloatPort("dataFloat")
        self.port_dataSDDS = bulkio.OutSDDSPort("dataSDDS")
        self.port_dataDouble = bulkio.OutDoublePort("dataDouble")
예제 #15
0
 def initialize(self):
     Resource.initialize(self)
예제 #16
0
 def initialize(self):
     Resource.initialize(self)
     
     # Instantiate the default implementations for all ports on this component
     self.port_dataFloat_in = bulkio.InFloatPort("dataFloat_in", maxsize=self.DEFAULT_QUEUE_SIZE)
     self.port_dataFloat_out = bulkio.OutFloatPort("dataFloat_out")
예제 #17
0
 def initialize(self):
     Resource.initialize(self)
     
     # Instantiate the default implementations for all ports on this component
     self.port_out = bulkio.OutDoublePort("out")
 def initialize(self):
     Resource.initialize(self)
예제 #19
0
 def initialize(self):
     Resource.initialize(self)
     self.toTest = TestUsesPort()
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component

            self.port_propEvent = PropertyEventSupplier(self)
    def initialize(self):
        Resource.initialize(self)

        # Instantiate the default implementations for all ports on this component

        self.port_output = PortCFPropertySetOut_i(self, "output")
예제 #22
0
    def initialize(self):
        Resource.initialize(self)

        # Instantiate the default implementations for all ports on this component

        self.port_propEvent = PropertyEventSupplier(self)
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component

            self.port_output = PortCFPropertySetOut_i(self, "output")
 def initialize(self):
     Resource.initialize(self)
     self.toTest = TestUsesPort()
        def initialize(self):
            Resource.initialize(self)
            
            # Instantiate the default implementations for all ports on this component

            self.port_dataFloatOut = PortBULKIODataFloatOut_i(self, "dataFloatOut")
예제 #26
0
 def initialize(self):
     Resource.initialize(self)
     
     # Instantiate the default implementations for all ports on this component
     self.port_dataFloatOut = bulkio.OutFloatPort("dataFloatOut")