BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
quicksimeditor.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/quicksimeditor/quicksimeditor.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
19 #include "gui2/model/jobmodel.h"
24 #include "mvvm/model/modelutils.h"
27 #include <QTabWidget>
28 #include <QVBoxLayout>
29 
30 using namespace ModelView;
31 
32 namespace gui2 {
33 
34 QuickSimEditor::QuickSimEditor(QWidget* parent)
35  : QWidget(parent)
36  , m_simController(new QuickSimController(this))
37  , m_plotController(new SimPlotController(this))
38  , m_plotWidget(new SimPlotWidget)
39  , m_toolBar(new QuickSimEditorToolBar)
40 {
41  setWindowTitle(QString("Reflectivity plot"));
42  auto layout = new QVBoxLayout(this);
43  layout->addWidget(m_toolBar);
44  layout->addWidget(m_plotWidget);
45  layout->setContentsMargins(0, 0, 0, 0);
46  layout->setSpacing(0);
47 
50 }
51 
53 
54 //! Set the mododel for the different items
56 {
57  m_appModels = models;
58  m_simController->setModels(models);
59  m_plotController->setModels(models);
60  m_plotWidget->setModels(models);
61 }
62 
64 {
65  return StyleUtils::DockSizeHint();
66 }
67 
69 {
71 }
72 
73 //! Connects signals from toolbar.
74 
76 {
77  // Request to reset plot is propagated from toolbar to viewports.
78  auto on_reset_view = [this]() { m_plotWidget->updateViewport(); };
79  connect(dynamic_cast<QuickSimEditorToolBar*>(m_toolBar),
81 
82  // Simulation interrupt request is propagated from toolbar to controller.
85 
86  // Request for real time mode is propagated from toobar to controller.
87  connect(dynamic_cast<QuickSimEditorToolBar*>(m_toolBar),
90 
91  // Run simulation is propagated from toobar to controller.
92  connect(dynamic_cast<QuickSimEditorToolBar*>(m_toolBar),
95 }
96 
97 //! Connects signals from controller.
98 
100 {
101  // Progress values propagated from controller to toolbar.
103  dynamic_cast<QuickSimEditorToolBar*>(m_toolBar),
105 }
106 
107 } // namespace gui2
Defines class CLASS?
Main class to holds all models of GUI session.
Provides quick reflectometry simulations on any change of SampleModel and MaterialModel.
void onRealTimeRequest(bool status)
void onRunSimulationRequest()
Processes multilayer on request. Doesn't work in real time mode.
void onInterruptRequest()
Requests interruption of running simulaitons.
void setModels(ApplicationModels *models)
void progressChanged(int value)
Toolbar for QuickSimEditor.
void onProgressChanged(int value)
Set progress bar to given value.
ApplicationModels * m_appModels
void setup_toolbar_connections()
Connects signals from toolbar.
QuickSimEditorToolBar * m_toolBar
void setModels(ApplicationModels *models)
Set the mododel for the different items.
SimPlotController * m_plotController
void setup_controller_connections()
Connects signals from controller.
QSize minimumSizeHint() const override
QuickSimController * m_simController
QSize sizeHint() const override
SimPlotWidget * m_plotWidget
Updates reference curve in JobItem when BeamItem is changed.
void setModels(ApplicationModels *models)
Presents simulation results together with reference experimental data on two canvas.
Definition: simplotwidget.h:32
void setModels(ApplicationModels *models)
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
DAREFLCORE_EXPORT QSize DockMinimumSizeHint()
Hint on minimum size of docks on main reflectometry window.
Definition: styleutils.cpp:34
DAREFLCORE_EXPORT QSize DockSizeHint()
Hint on size of docks on main reflectometry window.
Definition: styleutils.cpp:29
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?