msidlistworkerstatus.h 2.51 KB
Newer Older
1

Renne Thomas's avatar
Renne Thomas committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*******************************************************************************
 * 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
 ******************************************************************************/

25
#pragma once
Renne Thomas's avatar
Renne Thomas committed
26
27

#include <QObject>
28
29
#include <pappsomspp/msrun/msrunreader.h>
#include "../../../../utils/msrunstatisticshandler.h"
30
#include "core/msrun.h"
31
#include "core/identification_sources/identificationdatasource.h"
Renne Thomas's avatar
Renne Thomas committed
32

33

34
class MsIdentificationTableMsRunStatisticsHandler :public MsRunStatisticsHandler
35
36
37
38
39
40
41
42
{
  public:
  unsigned long getMsLevelCount(unsigned int ms_level) const;
  pappso::pappso_double getMsLevelTic(unsigned int ms_level) const;


  unsigned long getTotalCount() const;

43
  bool shouldStop() override;
44

45
  void requireStop(bool stop);
46
47
48
49
50
51
52
53
54

  private:
  std::vector<unsigned long> _count_ms_level_spectrum;
  std::vector<pappso::pappso_double> _tic_ms_level_spectrum;
  QMutex m_mutex;

  bool m_stopRequired = true;
};

55
56
57
58
59
60
61
62
63
class MsIdentificationTableModel;

enum class WorkerStatus : std::int8_t
{
  Running = 0,
  Waiting = 1,
  Nothing = 2,
};
class MsIdListWorkerThread;
64
class MsIdListWorkerStatus : public QObject
Renne Thomas's avatar
Renne Thomas committed
65
66
{
  Q_OBJECT
67

Renne Thomas's avatar
Renne Thomas committed
68
  public:
69
70
  MsIdListWorkerStatus(MsIdListWorkerThread *worker);

71
  virtual ~MsIdListWorkerStatus();
Renne Thomas's avatar
Renne Thomas committed
72

73
74
75
76
77
78
79
80
81
82
83
84
  WorkerStatus getStatus(IdentificationDataSourceSp identificationDataSource);

  public slots:
  void setRunningIdData(IdentificationDataSourceSp identificationDataSource);


  signals:
  void
  computeMsNumber(IdentificationDataSourceSp identificationDataSource) const;

  protected:
  IdentificationDataSourceSp m_runningIdData;
Renne Thomas's avatar
Renne Thomas committed
85
86

  private:
87
  std::vector<IdentificationDataSourceSp> m_list_idSources;
88
  pappso::SpectrumCollectionHandlerInterface *mpa_currentHandler = nullptr;
Renne Thomas's avatar
Renne Thomas committed
89
};