diff --git a/src/core/msrun.cpp b/src/core/msrun.cpp index 6093a1309ec82739eb612f723ecc158d49a23268..b4ca0879c7618352a7a82b2a19eaa34ec5eac377 100644 --- a/src/core/msrun.cpp +++ b/src/core/msrun.cpp @@ -39,6 +39,8 @@ #include <pappsomspp/exception/exceptionnotfound.h> #include <pappsomspp/xicextractor/msrunxicextractorfactory.h> #include "../utils/msrunstatisticshandler.h" +#include <pappsomspp/msfile/msfileaccessor.h> +#include <pappsomspp/exception/exceptionnotimplemented.h> MsRun::MsRun(const QString &location) : pappso::MsRunId(location) { @@ -62,9 +64,24 @@ MsRun::getMsRunReaderSp() { try { - _msrun_reader_sp = - pappso::MsRunReaderFactory::getInstance().buildPwizMsRunReaderSp( - *this); + + pappso::MsFileAccessor accessor(getFilename(), 0); + qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << "()"; + auto msrunid_list = accessor.getMsRunIds(); + if(msrunid_list.size() == 1) + { + _msrun_reader_sp = accessor.msRunReaderSp(msrunid_list.front()); + } + else + { + throw(pappso::ExceptionNotImplemented(QObject::tr( + "multiple msruns inside mz data file not yet implemented"))); + } + /* + _msrun_reader_sp = + pappso::MsRunReaderFactory::getInstance().buildPwizMsRunReaderSp( + *this); + */ } catch(pappso::PappsoException &error) { @@ -142,7 +159,7 @@ MsRun::findMsRunFile() qDebug() << "FILE: " << file.fileName(); if(onlyfilename == file.fileName()) { - this->setFilename(file.absoluteFilePath()); + this->setFileName(file.absoluteFilePath()); try { if(_msrun_reader_sp == nullptr)