Results 1 to 9 of 9

Thread: Qwt real time plotting

  1. #1
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Qwt real time plotting

    HI

    i am trying for a real time plotting using qwt.my requirement is i will get a data from target system and i have to update the data on the graph.i have seen a function setrawsamples which plots the data at one instance.can i use the same function in my program . i have to plot the data continuously in an incremental mannar ie.., have to plot the data from the point where it has stopped earlier.can any one please suggest on this matter.


    thanks

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qwt real time plotting

    Have a look at Cpu plot example or refreshtest..... in the qwt example folder.

  3. The following user says thank you to sonulohani for this useful post:

    santoshpradeep (27th June 2012)

  4. #3
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qwt real time plotting

    but sir those examples doesn't fulfill my requirement is there any other way to do so please help me out

  5. #4
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Cool Re: Qwt real time plotting

    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.

  6. The following user says thank you to sonulohani for this useful post:

    santoshpradeep (27th June 2012)

  7. #5
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qwt real time plotting

    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

  8. #6
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qwt real time plotting

    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.

  9. The following user says thank you to sonulohani for this useful post:

    santoshpradeep (28th June 2012)

  10. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt real time plotting

    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:


    Quote Originally Posted by sonulohani View Post
    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.
    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.

  11. The following user says thank you to Uwe for this useful post:

    santoshpradeep (28th June 2012)

  12. #8
    Join Date
    Jun 2012
    Posts
    5
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qwt real time plotting

    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

  13. #9
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt real time plotting

    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

  14. The following user says thank you to Uwe for this useful post:

    santoshpradeep (2nd July 2012)

Similar Threads

  1. Real time data plotting using Qwt
    By nagabathula in forum Qwt
    Replies: 8
    Last Post: 7th July 2011, 17:47
  2. Replies: 2
    Last Post: 24th June 2011, 06:31
  3. Replies: 1
    Last Post: 3rd December 2009, 15:23
  4. real time plotting
    By agostain in forum Qwt
    Replies: 0
    Last Post: 10th August 2009, 11:47
  5. real time plotting
    By gyre in forum Qwt
    Replies: 4
    Last Post: 11th December 2007, 17:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.