BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FitLog Class Reference
Collaboration diagram for FitLog:
[legend]

Classes

struct  Record
 

Public Member Functions

 FitLog ()
 
void append (const std::string &text, FitLogFlags::MessageType type)
 
void clearLog ()
 
void setMessagePanel (JobMessagePanel *messagePanel)
 

Private Attributes

JobMessagePanelm_messagePanel
 
std::vector< Recordm_records
 

Detailed Description

Definition at line 24 of file FitLog.h.

Constructor & Destructor Documentation

◆ FitLog()

FitLog::FitLog ( )

Definition at line 18 of file FitLog.cpp.

18 : m_messagePanel(nullptr) {}
JobMessagePanel * m_messagePanel
Definition: FitLog.h:39

Member Function Documentation

◆ append()

void FitLog::append ( const std::string &  text,
FitLogFlags::MessageType  type 
)

Definition at line 34 of file FitLog.cpp.

35 {
36  m_records.push_back({text, type});
37 
38  if (m_messagePanel)
39  m_messagePanel->onMessage(QString::fromStdString(text), QColor(FitLogFlags::color(type)));
40 }
static Qt::GlobalColor color(MessageType messageType)
Definition: FitLogFlags.cpp:33
std::vector< Record > m_records
Definition: FitLog.h:38
void onMessage(const QString &message, const QColor &color=QColor(Qt::black))

References FitLogFlags::color(), m_messagePanel, m_records, and JobMessagePanel::onMessage().

Here is the call graph for this function:

◆ clearLog()

void FitLog::clearLog ( )

Definition at line 42 of file FitLog.cpp.

43 {
44  m_records.clear();
45  if (m_messagePanel)
47 }

References m_messagePanel, m_records, and JobMessagePanel::onClearLog().

Here is the call graph for this function:

◆ setMessagePanel()

void FitLog::setMessagePanel ( JobMessagePanel messagePanel)

Definition at line 20 of file FitLog.cpp.

21 {
22  m_messagePanel = messagePanel;
23  if (!m_messagePanel)
24  return;
25 
27 
28  for (auto& record : m_records) {
29  m_messagePanel->onMessage(QString::fromStdString(record.m_text),
30  QColor(FitLogFlags::color(record.m_type)));
31  }
32 }

References FitLogFlags::color(), m_messagePanel, m_records, JobMessagePanel::onClearLog(), and JobMessagePanel::onMessage().

Referenced by FitSessionManager::disableLogging(), and FitSessionManager::sessionController().

Here is the call graph for this function:

Member Data Documentation

◆ m_messagePanel

JobMessagePanel* FitLog::m_messagePanel
private

Definition at line 39 of file FitLog.h.

Referenced by append(), clearLog(), and setMessagePanel().

◆ m_records

std::vector<Record> FitLog::m_records
private

Definition at line 38 of file FitLog.h.

Referenced by append(), clearLog(), and setMessagePanel().


The documentation for this class was generated from the following files: