BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularDataImportWidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Import/SpecularDataImportWidget.h
6 //! @brief Defines class SpecularDataImportWidget
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_VIEW_IMPORT_SPECULARDATAIMPORTWIDGET_H
16 #define BORNAGAIN_GUI_VIEW_IMPORT_SPECULARDATAIMPORTWIDGET_H
17 
20 #include "qcustomplot.h"
21 #include <memory>
22 
23 class SpecularDataItem;
24 class AbstractDataLoader;
25 class RealDataItem;
26 
27 namespace Ui {
28 
30 }
31 
32 //! Widget to define and show 1D (specular) imports by data loaders, e.g. CSV file import
33 //! Contains space for the loader-defined import properties, a table for the raw and the imported
34 //! data and a graph to show the plot of the imported data.
35 //! The UI is defined via QtDesigner (.ui file)
36 
38  Q_OBJECT
39 
40 public:
41  SpecularDataImportWidget(QWidget* parent = nullptr);
42 
43  void setItem(SessionItem* realDataItem) override;
44 
45  QList<QAction*> actionList() override;
46 
47 private slots:
48  void onContextMenuRequest(const QPoint& point);
49  void onPlotAxisClicked(QCPAxis* axis, QCPAxis::SelectablePart part, QMouseEvent* event);
50 
51 private:
53  const RealDataItem* realDataItem() const;
55 
56  void fillLoaderCombo();
57  void updatePropertiesEdits();
60  void updatePreview();
62  void onPropertiesChanged();
63  QString currentFileName() const;
64 
65  Ui::SpecularDataImportWidget* m_ui;
66  AbstractDataLoader1D* m_loader; // only borrowed from realDataItem. Do not delete!
67 };
68 
69 #endif // BORNAGAIN_GUI_VIEW_IMPORT_SPECULARDATAIMPORTWIDGET_H
Defines class AbstractDataLoader1D.
Defines class ItemComboWidget.
Abstract base class for reflectometry data loaders.
Abstract base class for all data loaders (classes to import real data).
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
Definition: RealDataItem.h:33
The SessionItemWidget class is a base for all widgets representing the content of SessionItem....
Base class for a GUI data item.
Definition: SessionItem.h:204
Widget to define and show 1D (specular) imports by data loaders, e.g. CSV file import Contains space ...
Ui::SpecularDataImportWidget * m_ui
AbstractDataLoader1D * m_loader
QList< QAction * > actionList() override
void onPlotAxisClicked(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
AbstractDataLoader * selectedLoader()
SpecularDataImportWidget(QWidget *parent=nullptr)
void setItem(SessionItem *realDataItem) override
void onContextMenuRequest(const QPoint &point)
const RealDataItem * realDataItem() const