def saveDataFile(self,fname): if 0 == len(fname): return history = self.getHistory() records = [] records.append(history) #np.savetxt(fname, history, fmt='%-12g', delimiter=' ') _docEngine = DocEngine(fname, self.comment) _docEngine.commentVar(self.variables) _docEngine.saveBlockRecords(records)
def onLoadClicked(self): ''' :when load-button clicked,the slot function will open the data file ''' homepath = QDir.homePath() path = str( QFileDialog.getOpenFileName(self, self.tr("Open File"),\ homepath, self.tr("Data file(*.dat)")) ) _docEngine = DocEngine(fname=path) data = _docEngine.getRecords() if not data: return self.updateDataTable(data)