jaray
3rd November 2015, 15:01
In my current project I am needing to plot out time series data for 25-50 msec sampled at 62.5 Mhz. qwt handles it wonderfully when the samples are spaced further apart (as in not just baseline noise), however there are times when I do get baseline noise. When this happens the plotting interface really begins to struggle. I tracked down the issue to setStyle(QwtPlotCurve::Lines). By using setStyle(QwtPlotCurve::Dots) instead, the performance drastically improved. Any tips on improving performance using Lines? Data reduction will need to be implemented at some point, but for now I need the raw samples.
directPainter_m = new QwtPlotDirectPainter();
setAutoReplot( false );
setCanvas( new Canvas() );
zoom_m = new QwtPlotZoomer(canvas());
plotLayout()->setAlignCanvasToScales( true );
QwtPlotGrid *grid = new QwtPlotGrid();
grid->setPen(QPen(Qt::gray, 1, Qt::DotLine));
grid->setXAxis(0);
grid->setYAxis(0);
grid->enableX(true);
grid->enableXMin(false);
grid->enableY(true);
grid->enableYMin(false);
grid->attach(this);
plotOrigin_m = new QwtPlotMarker();
plotOrigin_m->setLineStyle( QwtPlotMarker::HLine );
plotOrigin_m->setValue(0.0,0.0);
plotOrigin_m->setLinePen( Qt::gray, 0.0, Qt::DashLine );
plotOrigin_m->attach( this );
plotCurve_m = new QwtPlotCurve();
//plotCurve_m->setRenderThreadCount(0);
plotCurve_m->setSymbol(NULL);
plotCurve_m->setStyle( QwtPlotCurve::Dots );
plotCurve_m->setPen( canvas()->palette().color( QPalette::WindowText ) );
plotCurve_m->setRenderHint( QwtPlotItem::RenderAntialiased, false );
plotCurve_m->setPaintAttribute( QwtPlotCurve::ClipPolygons, true );
plotCurve_m->setPaintAttribute( QwtPlotCurve::FilterPoints , false );
plotCurve_m->setPaintAttribute( QwtPlotCurve::MinimizeMemory , false );
setAxisTitle( QwtPlot::xBottom, xLabel_m);
setAxisTitle( QwtPlot::yLeft, yLabel_m);
connect(zoom_m, SIGNAL(selected(QRectF)), this, SIGNAL(selectedrect(QRectF)));
directPainter_m = new QwtPlotDirectPainter();
setAutoReplot( false );
setCanvas( new Canvas() );
zoom_m = new QwtPlotZoomer(canvas());
plotLayout()->setAlignCanvasToScales( true );
QwtPlotGrid *grid = new QwtPlotGrid();
grid->setPen(QPen(Qt::gray, 1, Qt::DotLine));
grid->setXAxis(0);
grid->setYAxis(0);
grid->enableX(true);
grid->enableXMin(false);
grid->enableY(true);
grid->enableYMin(false);
grid->attach(this);
plotOrigin_m = new QwtPlotMarker();
plotOrigin_m->setLineStyle( QwtPlotMarker::HLine );
plotOrigin_m->setValue(0.0,0.0);
plotOrigin_m->setLinePen( Qt::gray, 0.0, Qt::DashLine );
plotOrigin_m->attach( this );
plotCurve_m = new QwtPlotCurve();
//plotCurve_m->setRenderThreadCount(0);
plotCurve_m->setSymbol(NULL);
plotCurve_m->setStyle( QwtPlotCurve::Dots );
plotCurve_m->setPen( canvas()->palette().color( QPalette::WindowText ) );
plotCurve_m->setRenderHint( QwtPlotItem::RenderAntialiased, false );
plotCurve_m->setPaintAttribute( QwtPlotCurve::ClipPolygons, true );
plotCurve_m->setPaintAttribute( QwtPlotCurve::FilterPoints , false );
plotCurve_m->setPaintAttribute( QwtPlotCurve::MinimizeMemory , false );
setAxisTitle( QwtPlot::xBottom, xLabel_m);
setAxisTitle( QwtPlot::yLeft, yLabel_m);
connect(zoom_m, SIGNAL(selected(QRectF)), this, SIGNAL(selectedrect(QRectF)));