PDA

View Full Version : How add new point to QwtPlotCurve



dqrest
13th July 2012, 10:12
Yesterday I installed qwt and qt to make programms. I use qwt 6.0.1 and qt 4.8.1. I have QwtPlot which draw the graph and QwtPlotCurve consisted of points. For beginning I setSamples into QwtPlotCurve, then I attach it into the QwtPlot. Then my program will get the online datas from the server. So I couldn't find the methods of QwtPlotCurve in the manuals which add this online datas without the repainting every last points. How should I do it??? If it is not possible, can I create a lot of (about millions) QwtPlotCurves and add they into QwtPLot. Does QwtPlot let me do it??? And the third question, how can I bind several QwtPlotCurves. For example, I have QwtPlotCurve c1,c2, then I set datas into c1 and c2, and at the end I'd like to bind c1(last point) and c2(the first point) with the line. Thank you for your attentions.Please, help me)))

Added after 1 2 minutes:

I see that this is a very weak point of qwt. I asked this questions in the a lot of forums(((

sonulohani
13th July 2012, 11:23
why you're binding all these. Make the vector of all the points.If the points are coming from different ports the create three vectors and concatenate them. Then, store all these value to the curve. And yes, you can create as many curves as you want. These is no as such weak point in qwt. And please if you already posted the same question earlier, then why you're posting it again and again.

dqrest
13th July 2012, 11:40
Thank you!!!))))I posted it , because i hadn't hear the answear

dqrest
13th July 2012, 15:02
You are not right!!!I think that it's weak point. For example, your program take 100 points each 1 second and your QwtPlotCurve consist of 999999999 points. And what???according to QwtPlotCurve method you delete last points,then you bind last and new points, then set they into the curve. Is it ok???No!!!In other hand, you create new QwtPlotCurve for new points, and you have 2 curves.....this is awful too!!!Why should I create 2 objects(curve) to draw they in the plot!!!According a doog sense, curve is created for continuous datas, because this datas interconnect each other.For instance,would you create many curves to draw 1 functions(y=sinx), where 1 curve draws between [0,Pi], the second curve draws between [Pi,10Pi] and so on!!!A good using 2 curves to draw difference functions(y=sinx , y=cosx),in other words, the 1th curve draws y=sinx and the 2th curve draws y=cosx!!!Am I right???

d_stranz
13th July 2012, 19:49
Have you looked at the real-time examples in the Qwt distribution? Instead of criticizing Qwt after one day of experience with it, maybe it would be better to sit down with the documentation and examples and study them in detail before running off at the keyboard about how bad Qwt is.

And in any event, what is the point of making curves with millions of points when you can only plot maybe 1000 points as unique pixels on the screen? And what is the point of trying to update the plot at the rate of 100 Hz when the human eye can't track anything faster than about 20 Hz or so?

If you don't like Qwt, then don't use it. Maybe you should ask for your money back. :D

sonulohani
16th July 2012, 09:43
Why should he ask for money? It is for free. There is no defect in qwt. It is already tested. You should have to look into the examples.