示例#1
0
 def setSdrRoot(self, sdrroot):
     self.nodeListWidget.clear()
     nodepath = os.path.join(sdrroot, 'dev/nodes/*/DeviceManager.dcd.xml')
     for dcdfile in glob.glob(nodepath):
         try:
             node = dcd.parse(dcdfile)
             name = node.get_name()
             domain = node.get_domainmanager().get_namingservice().get_name()
             domain = domain.split('/')[-1]
             self._nodes[name] = {'dcd':dcdfile, 'domain':domain}
         except:
             pass
     for name in self._nodes.keys():
         QtGui.QListWidgetItem(name, self.nodeListWidget)
示例#2
0
 def setSdrRoot(self, sdrroot):
     self.nodeListWidget.clear()
     nodepath = os.path.join(sdrroot, 'dev/nodes/*/DeviceManager.dcd.xml')
     for dcdfile in glob.glob(nodepath):
         try:
             node = dcd.parse(dcdfile)
             name = node.get_name()
             domain = node.get_domainmanager().get_namingservice().get_name(
             )
             domain = domain.split('/')[-1]
             self._nodes[name] = {'dcd': dcdfile, 'domain': domain}
         except:
             pass
     for name in self._nodes.keys():
         QtGui.QListWidgetItem(name, self.nodeListWidget)
示例#3
0
    def setSdrRoot(self, sdrroot):
        self.nodeTreeWidget.clear()
        nodepath = os.path.join(sdrroot, 'dev/nodes/*/DeviceManager.dcd.xml')
        for dcdfile in glob.glob(nodepath):
            try:
                node = dcd.parse(dcdfile)
                name = node.get_name()
                domain = node.get_domainmanager().get_namingservice().get_name()
                domain = domain.split('/')[-1]
                dcdfile = dcdfile.replace(os.path.join(sdrroot,'dev'), '')
                # Add the node to the tree widget, including the default domain
                # as a hidden column
                QtGui.QTreeWidgetItem(self.nodeTreeWidget, [name, dcdfile, domain])
            except:
                pass
        # Readjust the column widths to ensure that the entire name is shown
        # and that the scollbar allows viewing the entire DCD filename
        self.nodeTreeWidget.resizeColumnToContents(0)
        self.nodeTreeWidget.resizeColumnToContents(1)

        # Sort alphabetically by name
        self.nodeTreeWidget.sortByColumn(0, 0)
示例#4
0
    def setSdrRoot(self, sdrroot):
        self.nodeTreeWidget.clear()
        nodepath = os.path.join(sdrroot, 'dev/nodes/*/DeviceManager.dcd.xml')
        for dcdfile in glob.glob(nodepath):
            try:
                node = dcd.parse(dcdfile)
                name = node.get_name()
                domain = node.get_domainmanager().get_namingservice().get_name(
                )
                domain = domain.split('/')[-1]
                dcdfile = dcdfile.replace(os.path.join(sdrroot, 'dev'), '')
                # Add the node to the tree widget, including the default domain
                # as a hidden column
                QtGui.QTreeWidgetItem(self.nodeTreeWidget,
                                      [name, dcdfile, domain])
            except:
                pass
        # Readjust the column widths to ensure that the entire name is shown
        # and that the scollbar allows viewing the entire DCD filename
        self.nodeTreeWidget.resizeColumnToContents(0)
        self.nodeTreeWidget.resizeColumnToContents(1)

        # Sort alphabetically by name
        self.nodeTreeWidget.sortByColumn(0, 0)