BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FitActivityPanel Class Reference

Description

The FitActivityPanel class is a main widget to run the fitting. Occupies bottom right corner of JobView, contains stack of FitSuiteWidgets for every JobItem which is suitable for fitting.

Definition at line 33 of file FitActivityPanel.h.

Inheritance diagram for FitActivityPanel:
[legend]
Collaboration diagram for FitActivityPanel:
[legend]

Public Slots

void setItem (JobItem *item)
 

Signals

void showLog (FitLog *log)
 

Public Member Functions

 FitActivityPanel (QWidget *parent=nullptr)
 
QSize minimumSizeHint () const override
 
void setRealTimeWidget (JobRealTimeWidget *realTimeWidget)
 
QSize sizeHint () const override
 

Private Member Functions

FitSessionWidgetcurrentFitSuiteWidget ()
 
bool isValidJobItem (JobItem *item)
 

Private Attributes

QWidget * m_blankWidget
 
FitSessionManagerm_fitSessionManager
 
FitSessionWidgetm_fitSessionWidget
 
QLabel * m_nofitLabel
 
JobRealTimeWidgetm_realTimeWidget
 
QStackedWidget * m_stack
 

Constructor & Destructor Documentation

◆ FitActivityPanel()

FitActivityPanel::FitActivityPanel ( QWidget *  parent = nullptr)

Definition at line 29 of file FitActivityPanel.cpp.

30  : QWidget(parent)
31  , m_realTimeWidget(nullptr)
33 {
34  setWindowTitle(GUI::Constants::JobFitPanelName);
35  setObjectName("FitActivityPanel");
36  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
37 
38  auto* layout = new QVBoxLayout(this);
39  layout->setMargin(0);
40  layout->setSpacing(0);
41  m_stack = new QStackedWidget(this);
42  layout->addWidget(m_stack);
43 
44  m_blankWidget = new QWidget(m_stack);
45  m_stack->addWidget(m_blankWidget);
46 
47  m_nofitLabel = new QLabel("Job has no real data linked to it for fitting.", m_stack);
48  m_nofitLabel->setAlignment(Qt::AlignCenter);
49  m_stack->addWidget(m_nofitLabel);
50 
52  m_stack->addWidget(m_fitSessionWidget);
53 }
FitSessionWidget * m_fitSessionWidget
QWidget * m_blankWidget
QStackedWidget * m_stack
JobRealTimeWidget * m_realTimeWidget
FitSessionManager * m_fitSessionManager
Handles all activity related to the simultaneous running of fitting jobs.
Contains all fit settings for given JobItem (fit parameters, minimizer settings). Controlled by FitAc...
const QString JobFitPanelName

References GUI::Constants::JobFitPanelName, m_blankWidget, m_fitSessionWidget, m_nofitLabel, and m_stack.

Member Function Documentation

◆ currentFitSuiteWidget()

FitSessionWidget * FitActivityPanel::currentFitSuiteWidget ( )
private

Definition at line 96 of file FitActivityPanel.cpp.

97 {
98  return m_fitSessionWidget;
99 }

References m_fitSessionWidget.

◆ isValidJobItem()

bool FitActivityPanel::isValidJobItem ( JobItem item)
private

Definition at line 91 of file FitActivityPanel.cpp.

92 {
93  return item ? item->isValidForFitting() : false;
94 }
bool isValidForFitting()
Definition: JobItem.cpp:154

References JobItem::isValidForFitting().

Referenced by setItem().

Here is the call graph for this function:

◆ minimumSizeHint()

QSize FitActivityPanel::minimumSizeHint ( ) const
override

Definition at line 67 of file FitActivityPanel.cpp.

68 {
69  return QSize(80, 80);
70 }

◆ setItem

void FitActivityPanel::setItem ( JobItem item)
slot

Definition at line 72 of file FitActivityPanel.cpp.

73 {
74  if (!isValidJobItem(item)) {
75  if (!item)
76  m_stack->setCurrentWidget(m_blankWidget);
77  else
78  m_stack->setCurrentWidget(m_nofitLabel);
79  emit showLog(nullptr);
80  return;
81  }
82 
83  m_stack->setCurrentWidget(m_fitSessionWidget);
88  emit showLog(controller->fitLog());
89 }
bool isValidJobItem(JobItem *item)
void showLog(FitLog *log)
Controls all activity related to the single fitting task for JobItem. Provides interaction between Fi...
FitSessionController * sessionController(JobItem *jobItem)
void setModelTuningWidget(ParameterTuningWidget *tuningWidget)
void setItem(JobItem *jobItem)
void setSessionController(FitSessionController *sessionController)
ParameterTuningWidget * parameterTuningWidget(JobItem *jobItem)

References FitSessionController::fitLog(), isValidJobItem(), m_blankWidget, m_fitSessionManager, m_fitSessionWidget, m_nofitLabel, m_realTimeWidget, m_stack, JobRealTimeWidget::parameterTuningWidget(), FitSessionManager::sessionController(), FitSessionWidget::setItem(), FitSessionWidget::setModelTuningWidget(), FitSessionWidget::setSessionController(), and showLog().

Referenced by JobView::onSelectionChanged().

Here is the call graph for this function:

◆ setRealTimeWidget()

void FitActivityPanel::setRealTimeWidget ( JobRealTimeWidget realTimeWidget)

Definition at line 55 of file FitActivityPanel.cpp.

56 {
57  ASSERT(realTimeWidget);
58  m_realTimeWidget = realTimeWidget;
59 }

References m_realTimeWidget.

Referenced by JobView::createSubWindows().

◆ showLog

void FitActivityPanel::showLog ( FitLog log)
signal

◆ sizeHint()

QSize FitActivityPanel::sizeHint ( ) const
override

Member Data Documentation

◆ m_blankWidget

QWidget* FitActivityPanel::m_blankWidget
private

Definition at line 54 of file FitActivityPanel.h.

Referenced by FitActivityPanel(), and setItem().

◆ m_fitSessionManager

FitSessionManager* FitActivityPanel::m_fitSessionManager
private

Definition at line 58 of file FitActivityPanel.h.

Referenced by setItem().

◆ m_fitSessionWidget

FitSessionWidget* FitActivityPanel::m_fitSessionWidget
private

Definition at line 55 of file FitActivityPanel.h.

Referenced by FitActivityPanel(), currentFitSuiteWidget(), and setItem().

◆ m_nofitLabel

QLabel* FitActivityPanel::m_nofitLabel
private

Definition at line 56 of file FitActivityPanel.h.

Referenced by FitActivityPanel(), and setItem().

◆ m_realTimeWidget

JobRealTimeWidget* FitActivityPanel::m_realTimeWidget
private

Definition at line 57 of file FitActivityPanel.h.

Referenced by setItem(), and setRealTimeWidget().

◆ m_stack

QStackedWidget* FitActivityPanel::m_stack
private

Definition at line 53 of file FitActivityPanel.h.

Referenced by FitActivityPanel(), and setItem().


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