##// END OF EJS Templates
Creates enum that represents the value types that can be read in AMDA...
Creates enum that represents the value types that can be read in AMDA This enum is passed in parameter of the reading method to parse the result file according to it

File last commit:

r561:df3e79308ca8
r563:a08e6992e146
Show More
ScalarSeries.cpp
31 lines | 1.1 KiB | text/x-c | CppLexer
#include <Data/ScalarSeries.h>
ScalarSeries::ScalarSeries(QVector<double> xAxisData, QVector<double> valuesData,
const Unit &xAxisUnit, const Unit &valuesUnit)
: DataSeries{std::make_shared<ArrayData<1> >(std::move(xAxisData)), xAxisUnit,
std::make_shared<ArrayData<1> >(std::move(valuesData)), valuesUnit}
{
}
std::unique_ptr<IDataSeries> ScalarSeries::clone() const
{
return std::make_unique<ScalarSeries>(*this);
}
std::shared_ptr<IDataSeries> ScalarSeries::subDataSeries(const SqpRange &range)
{
auto subXAxisData = QVector<double>();
auto subValuesData = QVector<double>();
this->lockRead();
{
auto bounds = subData(range.m_TStart, range.m_TEnd);
for (auto it = bounds.first; it != bounds.second; ++it) {
subXAxisData.append(it->x());
subValuesData.append(it->value());
}
}
this->unlock();
return std::make_shared<ScalarSeries>(subXAxisData, subValuesData, this->xAxisUnit(),
this->valuesUnit());
}