##// 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:

r987:2928e8449245
r1054:f391b1d9fb19
Show More
SpectrogramSeries.cpp
50 lines | 2.1 KiB | text/x-c | CppLexer
/ core / src / Data / SpectrogramSeries.cpp
Alexandre Leroux
Creates SpectrogramSeries...
r863 #include <Data/SpectrogramSeries.h>
SpectrogramSeries::SpectrogramSeries(std::vector<double> xAxisData, std::vector<double> yAxisData,
std::vector<double> valuesData, const Unit &xAxisUnit,
Alexandre Leroux
Updates spectrogram to hold time resolution...
r987 const Unit &yAxisUnit, const Unit &valuesUnit,
double resolution)
Alexandre Leroux
Creates SpectrogramSeries...
r863 : SpectrogramSeries{
Alexandre Leroux
Updates spectrogram to hold time resolution...
r987 std::make_shared<ArrayData<1> >(std::move(xAxisData)),
xAxisUnit,
std::make_shared<ArrayData<2> >(std::move(valuesData), yAxisData.size()),
valuesUnit,
OptionalAxis{std::make_shared<ArrayData<1> >(std::move(yAxisData)), yAxisUnit},
resolution}
Alexandre Leroux
Creates SpectrogramSeries...
r863 {
}
SpectrogramSeries::SpectrogramSeries(std::shared_ptr<ArrayData<1> > xAxisData,
const Unit &xAxisUnit,
std::shared_ptr<ArrayData<2> > valuesData,
Alexandre Leroux
Updates spectrogram to hold time resolution...
r987 const Unit &valuesUnit, OptionalAxis yAxis, double resolution)
Alexandre Leroux
Creates SpectrogramSeries...
r863 : DataSeries{std::move(xAxisData), xAxisUnit, std::move(valuesData), valuesUnit,
Alexandre Leroux
Updates spectrogram to hold time resolution...
r987 std::move(yAxis)},
m_XResolution{resolution}
Alexandre Leroux
Creates SpectrogramSeries...
r863 {
}
std::unique_ptr<IDataSeries> SpectrogramSeries::clone() const
{
return std::make_unique<SpectrogramSeries>(*this);
}
std::shared_ptr<IDataSeries> SpectrogramSeries::subDataSeries(const SqpRange &range)
{
auto subXAxisData = std::vector<double>();
auto subValuesData = QVector<double>(); // Uses QVector to append easily values to it
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.append(it->values());
}
auto yAxis = this->yAxis();
this->unlock();
return std::make_shared<SpectrogramSeries>(
std::make_shared<ArrayData<1> >(std::move(subXAxisData)), this->xAxisUnit(),
std::make_shared<ArrayData<2> >(subValuesData.toStdVector(), yAxis.size()),
this->valuesUnit(), std::move(yAxis));
}