Loading...
Searching...
No Matches
uimonitortext.h
Go to the documentation of this file.
/**
* \file pappsomspp/processing/uimonitor/uimonitortext.h
* \date 14/5/2021
* \author Olivier Langella
* \brief simle text monitor implementation of the User Interface Monitor
**/
/*******************************************************************************
* Copyright (c) 2021 Olivier Langella
*<Olivier.Langella@universite-paris-saclay.fr>.
*
* This file is part of the PAPPSOms++ library.
*
* PAPPSOms++ 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.
*
* PAPPSOms++ 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 PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "uimonitorinterface.h"
#include <QTextStream>
namespace pappso
{
/**
* @todo simple text monitor using text stream
*/
class PMSPP_LIB_DECL UiMonitorText : public UiMonitorInterface
{
public:
/**
* Default constructor
*/
UiMonitorText(QTextStream &output_stream);
/**
* Destructor
*/
~UiMonitorText();
virtual bool shouldIstop() override;
/** @brief count steps
* report when a step is computed in an algorithm
*/
virtual void count() override;
/** @brief current kind of process running
* @param title process title
*/
virtual void setTitle(const QString &title) override;
/** @brief current status of the process
* @param status status message
*/
virtual void setStatus(const QString &status) override;
/** @brief append a text to a long report
* @param text string to append in a long report
*/
virtual void appendText(const QString &text) override;
virtual void setTotalSteps(std::size_t total_number_of_steps);
protected:
QTextStream &m_outputStream;
std::size_t m_count = 0;
};
} // namespace pappso
pappso::UiMonitorInterface
Definition uimonitorinterface.h:50
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::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
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
uimonitorinterface.h