Have a look at Cpu plot example or refreshtest..... in the qwt example folder.
Have a look at Cpu plot example or refreshtest..... in the qwt example folder.
santoshpradeep (27th June 2012)
but sir those examples doesn't fulfill my requirement is there any other way to do so please help me out
OOkkk wait for 1 min.
Added after 15 minutes:
Okkk see this----->
I think you will understand.
realTime.zip
Last edited by sonulohani; 27th June 2012 at 11:24.
santoshpradeep (27th June 2012)
Thanks a lot sir actually i cant use a timer in my code as per the requirements as such.right now i am trying with Qwtplotcurve function setRawsamples to plot the data on the plot.i will get the data in an incremental manner from the target computer which has to be captured and have to be plotted.i am storing the data in an array and using a count and incrementing the count such that the data will be stored in a buffer. this setrawsamples is plotting the data at one instance from the buffer.in my case the buffer will be filled when ever the data comes.so if i use same function will it work.
the sample code is
double a[1000];
double b[1000];
static int count ;
i will assign the data to the buffer and will use
qwtplotcurve *curve =new Qwtplotcurve()
curve->setrawsamples(a,b,count);
the code resembles the above.so can i achieve the requirement with this way.doubting about the performance in real time
Ok, use signal and slot to do this. First, take the value that is coming and plot it and then wait for other data to come. If the data will arrive then update it to the plot. In this, use signal and slot for that particular object from which you're getting the data.
santoshpradeep (28th June 2012)
Check the oscilloscope example - it might be pretty close to your requirements ( or the realtime example what also shows how to plot a curve incrementally - but has nothing to do with "realtime" ).
The oscilloscope example shows an implementation how to plot incrementally without having to replot the complete scene for each new sample. Such an implementation is very, very fast - but you can't implement every type of plot this way. F.e. a plot like the cpuplot example - where the scales are shifted continuously - needs a replot for every point.
If you want to have an idea what refresh rate is possible for full replots on your box try the refreshtest example and play with its options. There is no good reason why your application would have worse results - beside what you do in your code.
Note that the version in SVN trunk re-introduces several optimizations that were removed in Qwt 6 + it offers a way to render to an OpenGL canvas.
Uwe
Added after 6 minutes:
Maybe use an extra thread for collecting the samples. For high sample rates better decouple the sample and refresh rate - like it is done in the oscilloscope example.
Uwe
Last edited by Uwe; 27th June 2012 at 14:39.
santoshpradeep (28th June 2012)
Sir i will get the data with some delay. after collecting entire data i am able to plot it using setrawsamples function.and plotting correctly.now i have to plot the data which comes continuously with some delay.so my doubt is this setrawsamples function is plotting all the data once again.ie.,instead of appending the existing one it is plotting whole data again on the plot.so if this happens it will degrade the performance of plotting.so any other function can i use instead of the above mentioned one
Read my advices and try to understand them - using setRawData or not has nothing to do with your problem. Start with reading the implementation of IncrementalPlot in the realtime example.
Uwe
santoshpradeep (2nd July 2012)
Bookmarks