BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ImportDataUtils.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Import/ImportDataUtils.h
6 //! @brief Defines ImportDataUtils namespace
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_VIEW_IMPORT_IMPORTDATAUTILS_H
16 #define BORNAGAIN_GUI_VIEW_IMPORT_IMPORTDATAUTILS_H
17 
18 #include "Device/IO/IOFactory.h"
19 #include <QString>
20 #include <memory>
21 
22 class Datafield;
23 class RealDataItem;
24 class InstrumentItem;
25 class AbstractDataLoader;
26 
27 //! Provides utility methods to import data files.
28 
30 
31 //! Imports 2D data, stores them as Datafield, and returns owning pointer.
32 std::unique_ptr<Datafield> Import2dData(const QString& fileName, IOFactory::LoaderSelector loader);
33 
34 //! Imports 1D data into the given item.
35 
36 //! Returns an error text if a fatal error occurred (discard item).
37 //! "Empty string" means "no fatal error" => imported item should be kept.
38 //! The imported item still can have errors, but they might be solvable
39 //! by different import settings or by using a different data loader.
40 //! Argument selectedLoader is the one which was selected in the open-file-dialog
41 //! (or null if none selected).
42 QString Import1dData(RealDataItem* realDataItem, const AbstractDataLoader* selectedLoader);
43 
44 } // namespace GUI::View::ImportDataUtils
45 
46 #endif // BORNAGAIN_GUI_VIEW_IMPORT_IMPORTDATAUTILS_H
Abstract base class for all data loaders (classes to import real data).
Abstract base class for instrument-specific item classes.
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
Definition: RealDataItem.h:33
Provides utility methods to import data files.
QString Import1dData(RealDataItem *realDataItem, const AbstractDataLoader *selectedLoader)
Imports 1D data into the given item.
std::unique_ptr< Datafield > Import2dData(const QString &fileName, IOFactory::LoaderSelector loader)
Imports 2D data, stores them as Datafield, and returns owning pointer.