Skip to content

Commit

Permalink
Improve speed for reading column labels
Browse files Browse the repository at this point in the history
  • Loading branch information
foerg committed Dec 27, 2022
1 parent 7e376dc commit ea26212
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions h5plotserie/h5plotserie/dataselection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "dataselection.h"

#include <hdf5serie/vectorserie.h>
#include <hdf5serie/simpleattribute.h>

#include "treewidgetitem.h"
#include "plotdata.h"
Expand Down Expand Up @@ -213,9 +214,10 @@ void DataSelection::selectFromFileBrowser(QTreeWidgetItem* item, int col) {
int j = getTopLevelIndex(item);
std::shared_ptr<H5::File> h5f=getH5File(file[j].toStdString());
auto *vs=h5f->openChildObject<H5::VectorSerie<double> >(path.toStdString());
vector<string> ret=vs->openChildAttribute<H5::SimpleAttribute<vector<string> > >("Column Label")->read();
QStringList sl;
for(unsigned int i=0; i<vs->getColumns(); i++)
sl << vs->getColumnLabel()[i].c_str();
for(size_t i=0; i<ret.size(); i++)
sl << ret[i].c_str();
currentData->addItems(sl);
}
}
Expand Down

0 comments on commit ea26212

Please sign in to comment.