def matchAllocationIdToStreamId(self,allocation_id, stream_id, port_name):
            if port_name != "":
                for entry in list(self.connectionTable):
                    if entry.port_name != port_name:
                        continue
                    if entry.stream_id != stream_id:
                        continue
                    if entry.connection_id != allocation_id:
                        continue
                    # all three match. This is a repeat
                    return

                old_table = self.connectionTable;
                tmp = bulkio.connection_descriptor_struct()
                tmp.connection_id = allocation_id
                tmp.port_name = port_name
                tmp.stream_id = stream_id
                self.connectionTable.append(tmp)
                self.connectionTableChanged(old_table, self.connectionTable)
                return

            old_table = self.connectionTable;
            tmp = bulkio.connection_descriptor_struct()
            tmp.connection_id = allocation_id
            tmp.port_name = "port_dataShort_out"
            tmp.stream_id = stream_id
            self.connectionTable.append(tmp)
            self.connectionTableChanged(old_table, self.connectionTable)
Ejemplo n.º 2
0
    def matchAllocationIdToStreamId(self, allocation_id, stream_id, port_name):
        if port_name != "":
            for entry in list(self.connectionTable):
                if entry.port_name != port_name:
                    continue
                if entry.stream_id != stream_id:
                    continue
                if entry.connection_id != allocation_id:
                    continue
                # all three match. This is a repeat
                return

            old_table = self.connectionTable
            tmp = bulkio.connection_descriptor_struct()
            tmp.connection_id = allocation_id
            tmp.port_name = port_name
            tmp.stream_id = stream_id
            self.connectionTable.append(tmp)
            self.connectionTableChanged(old_table, self.connectionTable)
            return

        old_table = self.connectionTable
        tmp = bulkio.connection_descriptor_struct()
        tmp.connection_id = allocation_id
        tmp.port_name = "port_dataDouble_out"
        tmp.stream_id = stream_id
        self.connectionTable.append(tmp)
        self.connectionTableChanged(old_table, self.connectionTable)
        def assignListener(self,listen_alloc_id, allocation_id):
            # find control allocation_id
            existing_alloc_id = allocation_id
            if self.listeners.has_key(existing_alloc_id):
                existing_alloc_id = self.listeners[existing_alloc_id]
            self.listeners[listen_alloc_id] = existing_alloc_id

            old_table = self.connectionTable
            new_entries = []
            for entry in self.connectionTable:
                if entry.connection_id == existing_alloc_id:
                    tmp = bulkio.connection_descriptor_struct()
                    tmp.connection_id = listen_alloc_id
                    tmp.stream_id = entry.stream_id
                    tmp.port_name = entry.port_name
                    new_entries.append(tmp)

            for new_entry in new_entries:
                foundEntry = False
                for entry in self.connectionTable:
                    if entry.connection_id == new_entry.connection_id and \
                       entry.stream_id == entry.stream_id and \
                       entry.port_name == entry.port_name:
                        foundEntry = True
                        break

                if not foundEntry:
                    self.connectionTable.append(new_entry)

            self.connectionTableChanged(old_table, self.connectionTable)
Ejemplo n.º 4
0
    def assignListener(self, listen_alloc_id, allocation_id):
        # find control allocation_id
        existing_alloc_id = allocation_id
        if self.listeners.has_key(existing_alloc_id):
            existing_alloc_id = self.listeners[existing_alloc_id]
        self.listeners[listen_alloc_id] = existing_alloc_id

        old_table = self.connectionTable
        new_entries = []
        for entry in self.connectionTable:
            if entry.connection_id == existing_alloc_id:
                tmp = bulkio.connection_descriptor_struct()
                tmp.connection_id = listen_alloc_id
                tmp.stream_id = entry.stream_id
                tmp.port_name = entry.port_name
                new_entries.append(tmp)

        for new_entry in new_entries:
            foundEntry = False
            for entry in self.connectionTable:
                if entry.connection_id == new_entry.connection_id and \
                   entry.stream_id == entry.stream_id and \
                   entry.port_name == entry.port_name:
                    foundEntry = True
                    break

            if not foundEntry:
                self.connectionTable.append(new_entry)

        self.connectionTableChanged(old_table, self.connectionTable)
Ejemplo n.º 5
0
 def _addStreamFilter(self, streamId, connectionId):
     desc = bulkio.connection_descriptor_struct(connectionId, streamId,
                                                self.port.name)
     self.connectionTable.append(desc)
     self.port.updateConnectionFilter(self.connectionTable)