libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
uimonitortext.cpp
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/uimonitor/uimonitortext.cpp
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
#include <QObject>
30
31
#include "
uimonitortext.h
"
32
33
using namespace
pappso
;
34
35
UiMonitorText::UiMonitorText
(QTextStream &output_stream) :
m_outputStream
(output_stream)
36
{
37
}
38
39
UiMonitorText::~UiMonitorText
()
40
{
41
}
42
43
bool
44
pappso::UiMonitorText::shouldIstop
()
45
{
46
// by defaut not interruptible
47
return
false
;
48
}
49
50
void
51
pappso::UiMonitorText::setTitle
(
const
QString &title)
52
{
53
m_outputStream
<< title << Qt::endl;
54
m_outputStream
.flush();
55
}
56
57
void
58
pappso::UiMonitorText::setStatus
(
const
QString &status)
59
{
60
m_outputStream
<< status << Qt::endl;
61
m_outputStream
.flush();
62
}
63
64
void
65
pappso::UiMonitorText::count
()
66
{
67
m_count
++;
68
if
(
m_count
<=
m_totalSteps
)
69
{
70
m_outputStream
<<
m_count
<<
" "
;
71
}
72
else
73
{
74
m_outputStream
<< QObject::tr(
"%1 on %2"
).arg(
m_count
).arg(
m_totalSteps
) <<
" "
;
75
}
76
m_outputStream
.flush();
77
}
78
79
void
80
pappso::UiMonitorText::appendText
(
const
QString &text)
81
{
82
m_outputStream
<< text << Qt::endl;
83
m_outputStream
.flush();
84
}
85
86
void
87
pappso::UiMonitorText::setTotalSteps
(std::size_t total_number_of_steps)
88
{
89
UiMonitorInterface::setTotalSteps
(total_number_of_steps);
90
m_count
= 0;
91
}
pappso::UiMonitorInterface::setTotalSteps
virtual void setTotalSteps(std::size_t total_number_of_steps)
use it if the number of steps is known in an algorithm the total number of steps is usefull to report...
Definition
uimonitorinterface.h:66
pappso::UiMonitorInterface::m_totalSteps
std::size_t m_totalSteps
Definition
uimonitorinterface.h:92
pappso::UiMonitorText::m_outputStream
QTextStream & m_outputStream
Definition
uimonitortext.h:80
pappso::UiMonitorText::count
virtual void count() override
count steps report when a step is computed in an algorithm
Definition
uimonitortext.cpp:65
pappso::UiMonitorText::setStatus
virtual void setStatus(const QString &status) override
current status of the process
Definition
uimonitortext.cpp:58
pappso::UiMonitorText::setTitle
virtual void setTitle(const QString &title) override
current kind of process running
Definition
uimonitortext.cpp:51
pappso::UiMonitorText::shouldIstop
virtual bool shouldIstop() override
should the procces be stopped ? If true, then cancel process Use this function at strategic point of ...
Definition
uimonitortext.cpp:44
pappso::UiMonitorText::~UiMonitorText
~UiMonitorText()
Definition
uimonitortext.cpp:39
pappso::UiMonitorText::setTotalSteps
virtual void setTotalSteps(std::size_t total_number_of_steps)
use it if the number of steps is known in an algorithm the total number of steps is usefull to report...
Definition
uimonitortext.cpp:87
pappso::UiMonitorText::appendText
virtual void appendText(const QString &text) override
append a text to a long report
Definition
uimonitortext.cpp:80
pappso::UiMonitorText::UiMonitorText
UiMonitorText(QTextStream &output_stream)
Definition
uimonitortext.cpp:35
pappso::UiMonitorText::m_count
std::size_t m_count
Definition
uimonitortext.h:81
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
uimonitortext.h
pappsomspp
core
processing
uimonitor
uimonitortext.cpp
Generated on
for libpappsomspp by
1.17.0