BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides utility methods to import data files.
Functions | |
QString | Import1dData (RealDataItem *realDataItem, const AbstractDataLoader *selectedLoader) |
Imports 1D data into the given item. More... | |
std::unique_ptr< Datafield > | Import2dData (const QString &fileName, IOFactory::LoaderSelector loader) |
Imports 2D data, stores them as Datafield, and returns owning pointer. More... | |
QString GUI::View::ImportDataUtils::Import1dData | ( | RealDataItem * | realDataItem, |
const AbstractDataLoader * | selectedLoader | ||
) |
Imports 1D data into the given item.
Returns an error text if a fatal error occurred (discard item). "Empty string" means "no fatal error" => imported item should be kept. The imported item still can have errors, but they might be solvable by different import settings or by using a different data loader. Argument selectedLoader is the one which was selected in the open-file-dialog (or null if none selected).
Definition at line 62 of file ImportDataUtils.cpp.
References AbstractDataLoader::clone(), AbstractDataLoader::guessSettings(), AbstractDataLoader::initWithDefaultImportSettings(), RealDataItem::nativeFileName(), AbstractDataLoader::processContents(), RealDataItem::setDataLoader(), AbstractDataLoader::setFileContents(), RealDataItem::setImportData(), and AbstractDataLoader::setRealDataItem().
Referenced by RealDataSelectorWidget::importData1D().
std::unique_ptr< Datafield > GUI::View::ImportDataUtils::Import2dData | ( | const QString & | fileName, |
IOFactory::LoaderSelector | loader | ||
) |
Imports 2D data, stores them as Datafield, and returns owning pointer.
Definition at line 57 of file ImportDataUtils.cpp.
Referenced by RealDataSelectorWidget::importData2D().