libpappsomspp
Library for mass spectrometry
uimonitortext.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/processing/uimonitor/uimonitortext.h
3  * \date 14/5/2021
4  * \author Olivier Langella
5  * \brief simle text monitor implementation of the User Interface Monitor
6  **/
7 
8 /*******************************************************************************
9  * Copyright (c) 2021 Olivier Langella
10  *<Olivier.Langella@universite-paris-saclay.fr>.
11  *
12  * This file is part of the PAPPSOms++ library.
13  *
14  * PAPPSOms++ is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * PAPPSOms++ is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26  *
27  ******************************************************************************/
28 
29 #pragma once
30 
31 #include "uimonitorinterface.h"
32 #include <QTextStream>
33 
34 namespace pappso
35 {
36 
37 
38 /**
39  * @todo simple text monitor using text stream
40  */
42 {
43  public:
44  /**
45  * Default constructor
46  */
47  UiMonitorText(QTextStream &output_stream);
48 
49  /**
50  * Destructor
51  */
52  ~UiMonitorText();
53 
54  virtual bool shouldIstop() override;
55 
56  /** @brief count steps
57  * report when a step is computed in an algorithm
58  */
59  virtual void count() override;
60 
61  /** @brief current kind of process running
62  * @param title process title
63  */
64  virtual void setTitle(const QString &title) override;
65 
66  /** @brief current status of the process
67  * @param status status message
68  */
69  virtual void setStatus(const QString &status) override;
70 
71  /** @brief append a text to a long report
72  * @param text string to append in a long report
73  */
74  virtual void appendText(const QString &text) override;
75 
76  virtual void setTotalSteps(std::size_t total_number_of_steps);
77 
78 
79  protected:
80  QTextStream &m_outputStream;
81  std::size_t m_count = 0;
82 };
83 } // namespace pappso
QTextStream & m_outputStream
Definition: uimonitortext.h:80
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
generic interface to monitor any long process A long process needs to be interrupted by the user and ...