BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
LinkInstrumentManager.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/Project/LinkInstrumentManager.h
6 //! @brief Defines class LinkInstrumentManager
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 
15 #ifndef BORNAGAIN_GUI_MODEL_PROJECT_LINKINSTRUMENTMANAGER_H
16 #define BORNAGAIN_GUI_MODEL_PROJECT_LINKINSTRUMENTMANAGER_H
17 
18 #include <QList>
19 #include <QObject>
20 #include <QStringList>
21 #include <QVector>
22 
23 class InstrumentItem;
24 class RealDataItem;
25 class ProjectDocument;
26 
27 //! The LinkInstrumentManager class provides communication between InstrumentCollection and
28 //! RealDataModel. Particularly, it notifies RealDataItem about changes in linked instruments
29 //! to adjust axes of IntensityDataItem.
30 
31 class LinkInstrumentManager : public QObject {
32  Q_OBJECT
33 
34 public:
36 
37  //! Returns true if RealDataItem can be linked to the instrument (same number of bins).
38  //! Also offers dialog to adjust instrument to match shape of real data.
39  //! quiet defines whether a "not possible" message box is shown if link is not possible. Use
40  //! this e.g. for unit tests. The question for adjusting the instrument is not suppressed by
41  //! this flag.
42  bool canLinkDataToInstrument(const RealDataItem* realDataItem, const QString& identifier,
43  QWidget* parent);
44 
45 signals:
46  void linkToInstrumentChanged(const RealDataItem* realDataItem);
47 
48 private:
49  void onInstrumentChanged(const InstrumentItem* instrument);
51 
52 private:
54 };
55 
56 #endif // BORNAGAIN_GUI_MODEL_PROJECT_LINKINSTRUMENTMANAGER_H
Abstract base class for instrument-specific item classes.
The LinkInstrumentManager class provides communication between InstrumentCollection and RealDataModel...
LinkInstrumentManager(ProjectDocument *document)
ProjectDocument * m_document
void linkToInstrumentChanged(const RealDataItem *realDataItem)
void onInstrumentChanged(const InstrumentItem *instrument)
bool canLinkDataToInstrument(const RealDataItem *realDataItem, const QString &identifier, QWidget *parent)
Returns true if RealDataItem can be linked to the instrument (same number of bins)....
Project document class handles all data related to the opened project (sample, job,...
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
Definition: RealDataItem.h:33