PDA

View Full Version : curve draw while curve not visible fails



sun
21st January 2010, 17:15
Hi,

I am successfully drawing a curve in realtime and I'm showing some values.
This can be changes with a scrollbar.

But if I don't look at the latest incoming values and scroll back while still retrieving data the new values are not painted correctly.
See problem in the jpg.


The run function of my plotter: (important lines)


for(int d=0;d<intervals;d++)
{
int id = values[d*step];
qint64 value = values[(d*step)+a+1];
dataList[a].append(id, value);
}
curveList[a]->setRawData(dataList[a].x(), dataList[a].y(), dataList[a].size());

finally the curve is plotted with replot() every 50 ms.

Thanks in advance for any help you may give.

sun
22nd January 2010, 14:34
Well the solution was quite easy.
My values are stored in a ring buffer and this buffer was to small when the program was busy doing other things and lost some values.