PDA

View Full Version : QwtPlotDirectPainter wents crazy after replot()



Alistannen
2nd May 2014, 22:18
Hey,

I am writing on an application which outputs up to 12 Signals in realtime over an National Instruments PCI-6703.

For this application I use Qt 5.2.1 and Qwt 6.1.0 on an Ubuntu 12.04 32bit server machine with rtai 4.0 for realtime support.

While giving out this 12 signals I want to show them on screen. So I added 12 QwtPlots with one curve to my MainWindow.

After I did replots every 100ms for each of these Plots my application crashes after nearly 30 seconds. :(

Yes, by now I know this is to much for my CPU. :rolleyes:

After this experience I found some tips in the www to use the QwtPlotDirectPainter which is used in the Realtime example.

So I included the IncrementalPlot class to my application and got the QwtPlotDirectPainter to paint some points on my curves.

Then I showed a whole curve of one signal at an plot with replot() and cleared this plot with replot(), too. Up to this point, everything works fine.

But now, when I already use the QwtPlotDirectPainter at the same plot to paint some points , all points have the same y-value, which is the last y-value from the curve plot before.

Do you have an idea what goes wrong with my app?

Is there any buffer or memory which I oversighted?

Thanks for your help and best regards from Germany!

Uwe
5th May 2014, 07:53
Is there any buffer or memory which I oversighted?
I bet you find a bug in your code dealing with the buffer of the curve points.

You might also have a look at the oscilloscope example, what is also using the QwtPlotDirectPainter but probably closer to your use case.

Uwe