Commit 3ec75997 authored by Renne Thomas's avatar Renne Thomas
Browse files

Add working status for ms id thread

parent cd237cfe
......@@ -184,7 +184,8 @@ SET(XTPCPP_SRCS
./gui/lists/ms_identification_run_list_view/msidentificationlistwindow.cpp
./gui/lists/ms_identification_run_list_view/msidentificationtablemodel.cpp
./gui/lists/ms_identification_run_list_view/msidentificationtableproxymodel.cpp
./gui/lists/ms_identification_run_list_view/msidlistworkerthread.cpp
./gui/lists/ms_identification_run_list_view/ms_identification_worker/msidlistworkerthread.cpp
./gui/lists/ms_identification_run_list_view/ms_identification_worker/msidlistworkerstatus.cpp
./gui/lists/ms_identification_run_list_view/engine_detail_view/enginedetailwindow.cpp
./gui/mainwindow.cpp
./gui/peptide_detail_view/peptidewindow.cpp
......
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/
#include <tuple>
#include "msidlistworkerstatus.h"
#include <pappsomspp/pappsoexception.h>
#include <pappsomspp/exception/exceptionnotfound.h>
#include <unistd.h>
MsIdListWorkerStatus::MsIdListWorkerStatus()
{
}
MsIdListWorkerStatus::~MsIdListWorkerStatus()
{
}
bool
MsIdListWorkerStatus::isWorking(
IdentificationDataSourceSp identificationDataSource)
{
if(std::find(list_idSources.begin(),
list_idSources.end(),
identificationDataSource) != list_idSources.end())
{
return true;
}
else
{
return false;
}
}
void
MsIdListWorkerStatus::setWorking(
IdentificationDataSourceSp identificationDataSource)
{
list_idSources.push_back(identificationDataSource);
}
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
*implementation
******************************************************************************/
#pragma once
#include <QObject>
#include "core/msrun.h"
#include "../msidentificationtablemodel.h"
class MsIdListWorkerStatus : public QObject
{
Q_OBJECT
public:
MsIdListWorkerStatus();
virtual ~MsIdListWorkerStatus();
bool isWorking(IdentificationDataSourceSp identificationDataSource);
void setWorking(IdentificationDataSourceSp identificationDataSource);
private:
std::vector<IdentificationDataSourceSp> list_idSources;
};
......@@ -60,5 +60,5 @@ MsIdListWorkerThread::doComputeMsNumber(
}
identificationDataSource->getMsRunSp()->freeMsRunReaderSp();
}
emit MsNumberComputed();
emit MsNumberComputed();
}
/**
* \file src/gui/xic_view/xicworkerthread.h
* \date 12/1/2018
* \author Olivier Langella
* \brief XIC worker
*/
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
*
......@@ -27,26 +22,26 @@
*implementation
******************************************************************************/
# pragma once
#pragma once
#include <QObject>
#include "../../../core/msrun.h"
#include "msidentificationtablemodel.h"
#include "core/msrun.h"
#include "../msidentificationtablemodel.h"
class MsIdListWorkerThread : public QObject
{
Q_OBJECT
public:
MsIdListWorkerThread(MsIdentificationTableModel *parent);
virtual ~MsIdListWorkerThread();
public slots:
void doComputeMsNumber(IdentificationDataSourceSp identificationDataSource);
signals:
void MsNumberComputed();
void MsNumberComputed();
private:
std::vector<IdentificationDataSource*> m_vectorWorking;
std::vector<IdentificationDataSource *> m_vectorWorking;
};
......@@ -27,7 +27,7 @@
#include <QDebug>
#include <pappsomspp/pappsoexception.h>
#include "msidentificationlistwindow.h"
#include "msidlistworkerthread.h"
#include "ms_identification_worker/msidlistworkerthread.h"
#include "../../../utils/identificationdatasourcestore.h"
MsIdentificationTableModel::MsIdentificationTableModel(
......@@ -40,7 +40,6 @@ MsIdentificationTableModel::MsIdentificationTableModel(
p_worker->moveToThread(&m_ms_id_list_thread);
m_ms_id_list_thread.start();
connect(this,
&MsIdentificationTableModel::computeMsNumber,
p_worker,
......@@ -342,8 +341,7 @@ MsIdentificationTableModel::data(const QModelIndex &index, int role) const
->getMsRunStatistics(MsRunStatistics::total_spectra_ms1);
if(nb_ms1.isNull())
{
emit computeMsNumber(
m_identificationDataSourceSpList.at(row));
emit computeMsNumber(m_identificationDataSourceSpList.at(row));
}
else
{
......@@ -351,7 +349,7 @@ MsIdentificationTableModel::data(const QModelIndex &index, int role) const
}
return QVariant("Wait");
}
if(col == (std::int8_t)msIdentificationListColumn::nb_ms_2)
if(col == (std::int8_t)msIdentificationListColumn::nb_ms_2)
{
QVariant nb_ms2 =
m_identificationDataSourceSpList.at(row)
......@@ -359,8 +357,9 @@ MsIdentificationTableModel::data(const QModelIndex &index, int role) const
->getMsRunStatistics(MsRunStatistics::total_spectra_ms2);
if(nb_ms2.isNull())
{
emit computeMsNumber(
m_identificationDataSourceSpList.at(row));
msp_workerStatus.get()->isworking(
m_identificationDataSourceSpList.at(row));
emit computeMsNumber(m_identificationDataSourceSpList.at(row));
}
else
{
......
......@@ -21,12 +21,13 @@
* Thomas Renne <thomas.renne@u-psud.fr>. - initial API and
*implementation
******************************************************************************/
#pragma once
#include <QAbstractTableModel>
#include "../../../core/project.h"
#include <QThread>
#include <memory>
#include <gui/lists/ms_identification_run_list_view/ms_identification_worker/msidlistworkerstatus.h>
/** \def msIdentificationListColumn list of available fields to display in ms
......@@ -36,16 +37,16 @@
enum class msIdentificationListColumn : std::int8_t
{
run_id = 0, ///< msRun ID
id_file = 1, ///< file ID
mzML = 2, ///< accession
engine_name = 3, ///< engine name
nbr_spectrum = 4, ///< number of spectrum
nbr_peptide = 5, ///< number of peptide identified
nbr_unique = 6, ///< number of unique spectra
percent_assign = 7, ///< percent of assignation
id_msrun_id = 8, ///< identification of MsRunId
nb_ms_1 = 9, ///< number of ms1
run_id = 0, ///< msRun ID
id_file = 1, ///< file ID
mzML = 2, ///< accession
engine_name = 3, ///< engine name
nbr_spectrum = 4, ///< number of spectrum
nbr_peptide = 5, ///< number of peptide identified
nbr_unique = 6, ///< number of unique spectra
percent_assign = 7, ///< percent of assignation
id_msrun_id = 8, ///< identification of MsRunId
nb_ms_1 = 9, ///< number of ms1
nb_ms_2 = 10, ///< number of ms1
last = 11, ///< get list size
};
......@@ -65,7 +66,7 @@ class MsIdentificationTableModel : public QAbstractTableModel
virtual QVariant
headerData(int section, Qt::Orientation orientation, int role) const override;
virtual QVariant data(const QModelIndex &index,
int role = Qt::DisplayRole)const override;
int role = Qt::DisplayRole) const override;
static const QString getTitle(msIdentificationListColumn column);
static const QString getDescription(msIdentificationListColumn column);
......@@ -85,8 +86,9 @@ class MsIdentificationTableModel : public QAbstractTableModel
void onMsIdentificationDataChanged();
signals:
void computeMsNumber(IdentificationDataSourceSp identificationDataSource) const;
void
computeMsNumber(IdentificationDataSourceSp identificationDataSource) const;
private:
static int getColumnWidth(int column);
......@@ -94,5 +96,6 @@ class MsIdentificationTableModel : public QAbstractTableModel
std::vector<IdentificationDataSourceSp> m_identificationDataSourceSpList;
MsIdentificationListWindow *m_ms_id_list_window;
QThread m_ms_id_list_thread;
std::vector<bool> m_list_done;
std::vector<bool> m_list_done;
std::shared_ptr<MsIdListWorkerStatus> msp_workerStatus;
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment