BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
AutomaticDataLoader1D.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Loaders/AutomaticDataLoader1D.h
6 //! @brief Defines class AutomaticDataLoader1D
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_LOADERS_AUTOMATICDATALOADER1D_H
16 #define BORNAGAIN_GUI_VIEW_LOADERS_AUTOMATICDATALOADER1D_H
17 
18 #include "Device/Data/Datafield.h"
20 
21 //! The legacy importer for reflectometry, with no user interaction.
22 
24 public:
25  QString name() const override;
26  QString persistentClassName() const override;
27  AbstractDataLoader* clone() const override;
28  QByteArray serialize() const override;
29  void deserialize(const QByteArray& data) override;
30  void setFileContents(const QByteArray& fileContent) override;
31  QByteArray fileContent() const override;
32  void processContents() override;
34  int numErrors() const override;
35  QStringList lineUnrelatedErrors() const override;
36 
37 private:
38  QByteArray m_fileContent;
39  QString m_error;
40 };
41 
42 #endif // BORNAGAIN_GUI_VIEW_LOADERS_AUTOMATICDATALOADER1D_H
Defines class AbstractDataLoader1D.
Abstract base class for reflectometry data loaders.
Base class for result tables of data loaders. Derive from this class and return an instance in YourDa...
Abstract base class for all data loaders (classes to import real data).
The legacy importer for reflectometry, with no user interaction.
QString persistentClassName() const override
A name which can be used for save/load purposes (which will not change ever more)
void processContents() override
Process the file contents. Can be called more than once, e.g. if the import settings have changed....
void deserialize(const QByteArray &data) override
Initialize from serialization data. If any error occurred, then a DeserializationException has to be ...
int numErrors() const override
Number of errors found while processing the content. An error means that either a particular content ...
AbstractDataLoader * clone() const override
Create a complete clone, including all internal states.
QByteArray serialize() const override
Returns every internal setting so it can be restored completely.
QString name() const override
The name shown in the format selection combo.
AbstractDataLoaderResultModel * createResultModel() const override
Create a table model which contains the import information like original file content,...
QStringList lineUnrelatedErrors() const override
Errors not related to a particular line.
QByteArray fileContent() const override
Returns the original file content. If not available any more (like for legacy project file import),...
void setFileContents(const QByteArray &fileContent) override
Sets the file contents to be imported. If the file was a compressed file, then the decompressed conte...