##// END OF EJS Templates
Fix the close button on the graphs and multi selection in the same graph
Fix the close button on the graphs and multi selection in the same graph

File last commit:

r694:c050c224f3de
r1054:f391b1d9fb19
Show More
ScalarSeries.cpp
31 lines | 1.1 KiB | text/x-c | CppLexer
#include <Data/ScalarSeries.h>
ScalarSeries::ScalarSeries(std::vector<double> xAxisData, std::vector<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 = std::vector<double>();
auto subValuesData = std::vector<double>();
this->lockRead();
{
auto bounds = xAxisRange(range.m_TStart, range.m_TEnd);
for (auto it = bounds.first; it != bounds.second; ++it) {
subXAxisData.push_back(it->x());
subValuesData.push_back(it->value());
}
}
this->unlock();
return std::make_shared<ScalarSeries>(std::move(subXAxisData), std::move(subValuesData),
this->xAxisUnit(), this->valuesUnit());
}