BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FitLog.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Fit/FitLog.h
6 //! @brief Defines 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 #ifndef BORNAGAIN_GUI_VIEW_FIT_FITLOG_H
16 #define BORNAGAIN_GUI_VIEW_FIT_FITLOG_H
17 
18 #include <QObject>
19 
20 #include <string>
21 #include <vector>
22 
23 //! enum class describing the log level of a message
25 
26 //! the collected messages of a fitting session
27 class FitLog : public QObject {
28  Q_OBJECT
29 public:
30  struct Message {
31  std::string text;
33  };
34 
35  FitLog(QObject* parent = nullptr);
36 
37  void append(const std::string& text, FitLogLevel level);
38  void clearLog();
39  const std::vector<Message>& messages() const;
40 
41 signals:
42  void cleared();
43  void messageAppended(const Message& message);
44 
45 private:
46  std::vector<Message> m_messages;
47 };
48 
49 #endif // BORNAGAIN_GUI_VIEW_FIT_FITLOG_H
FitLogLevel
enum class describing the log level of a message
Definition: FitLog.h:24
Definition: Error.h:21
the collected messages of a fitting session
Definition: FitLog.h:27
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
std::string text
Definition: FitLog.h:31
FitLogLevel level
Definition: FitLog.h:32