BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FitSessionWidget.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Fit/FitSessionWidget.cpp
6 //! @brief Implements class FitSessionWidget
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 
16 #include "GUI/Model/Job/JobItem.h"
22 #include <QTabWidget>
23 #include <QVBoxLayout>
24 
26  : QWidget(parent)
27 
28  , m_controlWidget(new RunFitControlWidget)
29  , m_fitParametersWidget(new FitParameterWidget)
30  , m_minimizerSettingsWidget(new MinimizerSettingsWidget)
31  , m_sessionController(nullptr)
32 {
33  auto* layout = new QVBoxLayout(this);
34  layout->setContentsMargins(0, 0, 0, 0);
35  layout->setMargin(0);
36  layout->setSpacing(0);
37  auto* tabWidget = new QTabWidget(this);
38  tabWidget->addTab(m_fitParametersWidget, "Fit Parameters");
39  tabWidget->addTab(m_minimizerSettingsWidget, "Minimizer");
40 
41  layout->addWidget(tabWidget);
42  layout->addWidget(m_controlWidget);
43 }
44 
46 {
47  ASSERT(jobItem);
50  m_controlWidget->setItem(jobItem);
51 }
52 
54 {
55  ASSERT(m_fitParametersWidget);
56  ASSERT(tuningWidget);
58 }
59 
61 {
62  if (m_sessionController) {
63  disconnect(m_sessionController, nullptr, this, nullptr);
64  disconnect(m_controlWidget, nullptr, m_sessionController, nullptr);
65  }
66 
67  m_sessionController = sessionController;
68 
69  if (m_sessionController) {
72  connect(m_sessionController, &QObject::destroyed,
73  [this] { m_sessionController = nullptr; });
78  }
79 }
80 
81 void FitSessionWidget::onFittingError(const QString& text)
82 {
84 }
Defines class FitParameterWidget.
Defines class FitSessionController.
Defines class FitSessionWidget.
Defines class JobItem.
Defines class MinimizerSettingsWidget.
Defines class RunFitControlWidget.
The FitParametersWidget class contains a tree view to set fit parameters (fix/release,...
void setParameterTuningWidget(ParameterTuningWidget *tuningWidget)
Sets ParameterTuningWidget to be able to provide it with context menu and steer its behaviour in the ...
Controls all activity related to the single fitting task for JobItem. Provides interaction between Fi...
void fittingError(const QString &message)
FitSessionWidget(QWidget *parent=nullptr)
void setModelTuningWidget(ParameterTuningWidget *tuningWidget)
FitSessionController * m_sessionController
MinimizerSettingsWidget * m_minimizerSettingsWidget
RunFitControlWidget * m_controlWidget
FitParameterWidget * m_fitParametersWidget
void setItem(JobItem *jobItem)
void onFittingError(const QString &text)
void setSessionController(FitSessionController *sessionController)
The MinimizerSettingsWidget contains editor for all minimizer settings and related fit options....
void setItem(JobItem *jobItem)
Main widget for real time parameter tuning. Contains a tree for parameter tuning and the model to pro...
The RunFitControlWidget contains elements to start/stop fitting and to provide minimal diagnostic....
void onFittingError(const QString &what)
virtual void setItem(SessionItem *item)
Defines namespace GUI::Constants.