예제 #1
0
    def readFolder(self, folder):
        if len(folder) != 0:
            currentIndex = self.receiverList.currentIndex()
            self.model.clear()

            files = [
                f for f in os.listdir(folder)
                if os.path.isfile(os.path.join(folder, f))
            ]
            files.sort()
            numValidFiles = 0
            for f in files:
                if f.endswith('dat'):
                    wf = Tecplot.read(os.path.join(folder, f))
                    if wf:
                        item = QStandardItem(f)
                        item.setData(wf)
                        self.model.appendRow(item)
                        numValidFiles = numValidFiles + 1

            if currentIndex.row() >= 0 and numValidFiles > currentIndex.row():
                newIndex = self.model.index(currentIndex.row(),
                                            currentIndex.column())
                self.receiverList.setCurrentIndex(newIndex)
                self.activeItemChanged.emit()
예제 #2
0
 def readFolder(self, folder):
   if len(folder) != 0:
     self.model.clear()
     files = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder,f))]
     files.sort()
     for f in files:
       wf = Tecplot.read(os.path.join(folder,f))
       item = QStandardItem(f)
       item.setData(wf)
       self.model.appendRow(item)
예제 #3
0
파일: Navigation.py 프로젝트: xyuan/SeisSol
 def readFolder(self, folder):
     if len(folder) != 0:
         self.model.clear()
         files = [
             f for f in os.listdir(folder)
             if os.path.isfile(os.path.join(folder, f))
         ]
         files.sort()
         for f in files:
             wf = Tecplot.read(os.path.join(folder, f))
             item = QStandardItem(f)
             item.setData(wf)
             self.model.appendRow(item)
예제 #4
0
 def readFolder(self, folder):
   if len(folder) != 0:
     currentIndex = self.receiverList.currentIndex()
     self.model.clear()
     
     files = [f for f in os.listdir(folder) if os.path.isfile(os.path.join(folder,f))]
     files.sort()
     for f in files:
       wf = Tecplot.read(os.path.join(folder,f))
       item = QStandardItem(f)
       item.setData(wf)
       self.model.appendRow(item)
       
     if currentIndex.row() >= 0 and len(files) > currentIndex.row():
       newIndex = self.model.index(currentIndex.row(), currentIndex.column())
       self.receiverList.setCurrentIndex(newIndex)
       self.activeItemChanged.emit()