Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)