23 #include "qcustomplot.h"
27 return "Legacy from BornAgain 1.18";
32 return "AutomaticDataLoader1D";
45 QDataStream s(&a, QIODevice::WriteOnly);
46 s.setVersion(QDataStream::Qt_5_12);
61 s.setVersion(QDataStream::Qt_5_12);
72 if (s.status() != QDataStream::Ok)
98 }
catch (std::runtime_error& ex) {
101 m_error = QString::fromStdString(ex.what());
116 return m_error.isEmpty() ? 0 : 1;
#define ASSERT(condition)
Defines class AutomaticDataLoader1DResultModel.
Defines class AutomaticDataLoader1D.
Defines class DeserializationException.
Defines ImportDataInfo helper struct.
Defines OutputDataReadReflectometry.
Defines and implements templated class OutputData.
Defines class RealDataItem.
Defines class SpecularDataItem.
Base class for result tables of data loaders.
Base class for all data loaders (classes which can import real data)
void contentsProcessed()
Emitted whenever contents have been processed.
The result model of a AutomaticDataLoader1D (for showing the import results in a table view).
Implements the legacy importer from BornAgain with no user interaction.
virtual QString persistentClassName() const override
A name which can be used for save/load purposes (which will not change ever more)
virtual void processContents() override
Process the file contents.
virtual void deserialize(const QByteArray &data) override
Initialize from serialization data.
virtual int numErrors() const override
Number of errors found while processing the content.
virtual AbstractDataLoader * clone() const override
Create a complete clone, including all internal states.
virtual QByteArray serialize() const override
Returns every internal setting so it can be restored completely.
virtual QString name() const override
The name shown in the format selection combo.
virtual AbstractDataLoaderResultModel * createResultModel() const override
Create a table model which contains the import information like original file content,...
virtual QStringList lineUnrelatedErrors() const override
Errors not related to a particular line.
virtual QByteArray fileContent() const override
Returns the original file content.
virtual void setFileContents(const QByteArray &fileContent) override
Sets the file contents to be imported.
static DeserializationException streamError()
static DeserializationException tooNew()
Carries information about loaded data.
Class for reading reflectometry data from ASCII file.
OutputData< double > * readOutputData(std::istream &input_stream)
void setImportData(ImportDataInfo data)
Sets imported data to underlying item.
bool isSpecularData() const
SpecularDataItem * specularDataItem()
void setOutputData(OutputData< double > *data) override
The given pointer becomes owned by this class!!