diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp index c01fe266cea1e95310fa4a4ec08e1a871b2a32a1..bb72fbcc45a1415bc6e3081e7cedce689e57ece6 100644 --- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp +++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.cpp @@ -33,6 +33,7 @@ #include <QMessageBox> namespace { + const QString filter_string_ba = "Intensity File (*.int *.gz *.tif *.tiff *.txt *.csv);;" "Other (*.*)"; const QString filter_string_ascii = "Intensity File (*.int *.int.gz *.txt *.csv *.dat *.ascii);;" @@ -48,8 +49,6 @@ int rank(const InstrumentItem& item) return static_cast<int>(item.shape().size()); } -} // namespace - std::unique_ptr<OutputData<double>> ImportDataUtils::ImportKnownData(const QString& fileName, IntensityDataIOFactory::LoaderSelector loader) @@ -69,6 +68,9 @@ ImportDataUtils::ImportKnownData(const QString& fileName, return result; } +} // namespace + + std::unique_ptr<OutputData<double>> ImportDataUtils::ImportReflectometryData(const QString& fileName) { diff --git a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h index 88d97c95975de3b0e7308679a670ed24976196a2..060924abe99341794625b0561adc925c60c8e22b 100644 --- a/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h +++ b/GUI/coregui/Views/ImportDataWidgets/ImportDataUtils.h @@ -31,19 +31,19 @@ class AbstractDataLoader; namespace ImportDataUtils { +//! Imports 2D data, stores them as OutputData, and returns owning pointer. std::unique_ptr<OutputData<double>> Import2dData(const QString& fileName, IntensityDataIOFactory::LoaderSelector loader); -//! Import 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. -//! selectedLoader is the one which was selected in the open-file-dialog (or null if none selected). -QString Import1dData(RealDataItem* realDataItem, const AbstractDataLoader* selectedLoader); +//! Imports 1D data into the given item. -std::unique_ptr<OutputData<double>> -ImportKnownData(const QString& fileName, - IntensityDataIOFactory::LoaderSelector loader = IntensityDataIOFactory::automatic); +//! 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). +QString Import1dData(RealDataItem* realDataItem, const AbstractDataLoader* selectedLoader); std::unique_ptr<OutputData<double>> ImportReflectometryData(const QString& fileName);