##// END OF EJS Templates
Creates enum that represents the value types that can be read in AMDA...
Alexandre Leroux -
r563:a08e6992e146
parent child
Show More
@@ -12,8 +12,10 class IDataSeries;
12 12 Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaResultParser)
13 13
14 14 struct SCIQLOP_AMDA_EXPORT AmdaResultParser {
15 enum class ValueType { SCALAR, VECTOR, UNKNOWN };
15 16
16 static std::shared_ptr<IDataSeries> readTxt(const QString &filePath) noexcept;
17 static std::shared_ptr<IDataSeries> readTxt(const QString &filePath,
18 ValueType valueType) noexcept;
17 19 };
18 20
19 21 #endif // SCIQLOP_AMDARESULTPARSER_H
@@ -125,8 +125,15 QPair<QVector<double>, QVector<double> > readResults(QTextStream &stream)
125 125
126 126 } // namespace
127 127
128 std::shared_ptr<IDataSeries> AmdaResultParser::readTxt(const QString &filePath) noexcept
128 std::shared_ptr<IDataSeries> AmdaResultParser::readTxt(const QString &filePath,
129 ValueType valueType) noexcept
129 130 {
131 if (valueType == ValueType::UNKNOWN) {
132 qCCritical(LOG_AmdaResultParser())
133 << QObject::tr("Can't retrieve AMDA data: the type of values to be read is unknown");
134 return nullptr;
135 }
136
130 137 QFile file{filePath};
131 138
132 139 if (!file.open(QFile::ReadOnly | QIODevice::Text)) {
General Comments 0
You need to be logged in to leave comments. Login now