##// END OF EJS Templates
rmap source target set to 1 by default
rmap source target set to 1 by default

File last commit:

r22:797a76985124 default
r22:797a76985124 default
Show More
wfplot.cpp
48 lines | 927 B | text/x-c | CppLexer
#include "wfplot.h"
#include <QFontInfo>
WFPlot::WFPlot(QWidget *parent) :
QWidget(parent)
{
// Create Fonts
QFont font;
font = QFont(this->fontInfo().family(), FONT_SIZE_WAVEFORM_TITLE, QFont::Light);
customPlot = new LppMonPlot();
mainLayout = new QVBoxLayout();
customPlot->setXaxisRange(0, XMAX);
customPlot->setYaxisRange(-YMAX, YMAX);
//customPlot->setTitleFont(font);
customPlot->addGraph();
mainLayout->addWidget(customPlot);
this->setLayout(mainLayout);
}
void WFPlot::displayOnPlot(short *data, unsigned int size)
{
QList<QVariant> qListX;
QList<QVariant> qListY;
qListX.clear();
qListY.clear();
for (unsigned int i=0; i<size; ++i)
{
qListX.append(i);
qListY.append( (double) data[i] );
}
customPlot->setGraphData(0, qListX, qListY);
customPlot->rescaleAxis();
customPlot->setGraphName(0, "v");
}