PDA

View Full Version : Best way to do continuos plotting in real time using qwt



aprado88
10th April 2013, 12:08
Hello i am new to QT and QWT and i am doing an application that must plot and do some calculus in phasors data coming from ADs.

At first i am using a QTimer to simulate the IRQ from the device driver, the QTimer calls a funcion from 200ms to 200ms.
Inside the function i am doing this


curve1->setSamples(buff_x,buff_sin_results[tosqueira],1000);
curve1->attach(this->ui->qwtPlot);

curve2->setSamples(buff_x_2,buff_sin_results_2[tosqueira],1000);
curve2->attach(this->ui->qwtPlot);

curve3->setSamples(buff_x_3,buff_sin_results_3[tosqueira],1000);
curve3->attach(this->ui->qwtPlot);

curve4->setSamples(buff_x_4,buff_sin_results_4[tosqueira],1000);
curve4->attach(this->ui->qwtPlot);

ui->qwtPlot->replot();
These are 4 buffers that i pre-calculated in some other function and i am just plotting them.
It works but is it the best way to do it performance wise?

Thank you very much

aprado
10th April 2013, 13:12
Oh just remembered my last account password hehe.
I saw that i don't need to do an attachment everytime, just when the curve is created.

aprado
10th April 2013, 20:17
Can i have memory leak problems by using setsample instead of setrawsample?
Forgive me for my dumb questions but qwt really lack basic tutorials and etc. Isnt enough just to throw big example codes in the zip and expect the code to be the documentation, all you have is a doxygen to the classes and source code examples.

moutinho
28th June 2013, 16:04
Hi, I have a similar problem. Did you find a good solution to solve this problem?

Best
Andre