mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
C++
48 lines
1.0 KiB
C++
#ifndef SCATTERPLOT_H
|
|
#define SCATTERPLOT_H
|
|
|
|
#include <string>
|
|
#include <complex>
|
|
#include "liblte/config.h"
|
|
|
|
class ScatterplotWrapper;
|
|
|
|
class LIBLTE_API Scatterplot
|
|
{
|
|
public:
|
|
Scatterplot();
|
|
~Scatterplot();
|
|
|
|
template<class Iterator>
|
|
void setNewData(Iterator begin, Iterator end);
|
|
void setNewData(std::complex<float>* data, int numPoints);
|
|
void setNewData(std::complex<double>* data, int numPoints);
|
|
void setTitle(std::string title);
|
|
void setXAxisScale(double xMin, double xMax);
|
|
void setYAxisScale(double yMin, double yMax);
|
|
void setXAxisAutoScale(bool on);
|
|
void setYAxisAutoScale(bool on);
|
|
void setAxisLabels(std::string xLabel, std::string yLabel);
|
|
|
|
private:
|
|
ScatterplotWrapper* plot_;
|
|
};
|
|
|
|
template<class Iterator>
|
|
LIBLTE_API void Scatterplot::setNewData(Iterator begin, Iterator end)
|
|
{
|
|
int numPoints = end-begin;
|
|
std::complex<double>* data = new std::complex<double>[numPoints];
|
|
|
|
for(int i=0;begin!=end;begin++,i++)
|
|
{
|
|
data[i] = *begin;
|
|
}
|
|
|
|
setNewData(data, numPoints);
|
|
|
|
delete[] data;
|
|
}
|
|
|
|
#endif // SCATTERPLOT_H
|