BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FitLog.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Fit/FitLog.cpp
6 //! @brief Implements class FitLog
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #include "GUI/View/Fit/FitLog.h"
16 
17 FitLog::FitLog(QObject* parent)
18  : QObject(parent)
19 {
20 }
21 
22 void FitLog::append(const std::string& text, FitLogLevel level)
23 {
24  Message m{text, level};
25  m_messages.push_back(m);
26  emit messageAppended(m);
27 }
28 
30 {
31  m_messages.clear();
32  emit cleared();
33 }
34 
35 const std::vector<FitLog::Message>& FitLog::messages() const
36 {
37  return m_messages;
38 }
Defines class FitLog.
FitLogLevel
enum class describing the log level of a message
Definition: FitLog.h:24
void clearLog()
Definition: FitLog.cpp:29
std::vector< Message > m_messages
Definition: FitLog.h:46
const std::vector< Message > & messages() const
Definition: FitLog.cpp:35
FitLog(QObject *parent=nullptr)
Definition: FitLog.cpp:17
void cleared()
void messageAppended(const Message &message)
void append(const std::string &text, FitLogLevel level)
Definition: FitLog.cpp:22