Results 1 to 4 of 4

Thread: RealTime plotting implementation using qwtplot

  1. #1
    Join Date
    Jan 2014
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default RealTime plotting implementation using qwtplot

    Hi…I am new to qwt. I need some suggestions regarding real time plotting using qwtplot.I am using qwt 6.0.1. I am acquiring data from an ADC card at every 10ms and receiving max 200 samples per second for each sensor..I need to plot data of around 150 sensors, each having a separate qwtplot widget.I am attaching separate curve for each of these plot widgets.I want to update each of my plots every 1 second.The time I need to do online plotting can be around 2 hours.For suppose if the data acquisition started at T hrs and ended at T+2 hours,I need to plot the whole data online starting from T hrs and should be able to see the data at any point of time for example say at T+10 minutes or so in the same qwtplot widget window.My x axis i.e. time will be incrementing continuously with initial starting time fixed and y-axis range is fixed..Here the x-axis i.e. the time axis will be of compressing type as the time progresses..I am using setSamples function for assigning x and y arrays to the curve.As the array size keeps on increasing with time and memory consumption is more,I cant store all the data points in the x and y arrays continuously.I need to clear the arrays at certain point of time..but what should I do to see the old samples on qwtplot widget starting from T hrs if i cant store whole set of points in an array for plotting?..Do I need to paint the old samples or Do I need to use some curve fitting algorithm to compress data samples? What is the best method to implement this type of plotting?Thank you…

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: RealTime plotting implementation using qwtplot

    I am using setSamples function for assigning x and y arrays to the curve.
    Better derive from QwtPointSeriesData so that you have complete control over the memory management of your curve points.

    Do I need to use some curve fitting algorithm to compress data samples?
    Maybe the Douglas Peucker algo, that is offered by QwtCurveWeedingFitter.

    You could have 2 buffers inside your series data object: the first one for the weeded points and the second one for incoming points. After every - let's say - 1000 points you run the fitter on this buffer and append the result to the first buffer. The second buffer can be emptied then.

    Uwe

  3. #3
    Join Date
    Jan 2014
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: RealTime plotting implementation using qwtplot

    Thanks for the quick response..But my doubt is when should i start using this weeding fitter?Because if i use this algorithm at the beginning interval of time let's say from start of acquisition i.e.,from 0 to 100 seconds where the canvas is wide enough,we can observe even the small changes in the plotted curve as scale is very large..so if the weeded points are plotted there are chances that we may miss some spikes or changes in the data points due to compressed points..But as the time keeps on incrementing,axis gets compressed and if i plot the weeded points at this stage,small misses may not be visible..is this the right approach?One more doubt.. is it better to paint the older points using qwtdirectpainter as shown in the qwt examples i.e., using incremental painting?or compress whole set of data points and attach all points to the curve?

  4. #4
    Join Date
    Jan 2014
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: RealTime plotting implementation using qwtplot

    Hi...After reading some of the posts in this forum, i understood that you need to use different sets of data for different scale ranges..i.e., for a smaller range more number of points as small details can also be seen and vice-versa..But i am receiving large number of samples per second for each sensor..If i keep on storing different data sets for each scale range for each sensor(say around 150 sensors)..that means i need to maintain many vectors .assuming 5 data sets per sensor,i have around 750 sets of data each having number of samples at any point of time..is it really feasible without any memory issues?one more doubt which i want to ask is i want to plot for around 2 hours during which period i need to see all my old points as well right from starting time in the same plot window.So even though the points are compressed,still the vector size keeps on increasing as the time passes..assuming max 200 samples per second,at the end of 1 hr i get around 3600*200=7,20,000 samples...which after compression using weeding fitter may come down to a comparatively lesser number for each sensor.Even then i need to plot all these weeded points continuously as i want a continuous graph with old points to be seen in the window..i.e., i need to store the weeded points right from 0 seconds in the vector and new incoming weeded points keep on getting appended to the vector,which may keep on increasing the vector size continuously with time for each sensor..supposing i may have ten's of thousands of points after 2 hrs in the vector for each sensor all of which i need to plot at once,which may increase the memory consumption drastically.Is this the way to be implemented? or should i take a set of weeded points,plot it say over a range from 0 to 100 seconds and when i get a new set of data points for 100 to 200 seconds, paint the 0-100 sec range using qwtdirectpainter method and delete the points for 0-100 sec range from the vector,paint again 100-200 sec range as new points come and so on...Can you suggest which of these is a better procedure?Thank you..

Similar Threads

  1. Cyclical realtime QWT plotting
    By Gim6626 in forum Qwt
    Replies: 1
    Last Post: 16th July 2013, 06:44
  2. Qwt Realtime plotting
    By krsree in forum Qwt
    Replies: 1
    Last Post: 5th April 2013, 06:20
  3. Replies: 3
    Last Post: 15th March 2013, 11:45
  4. Replies: 10
    Last Post: 1st April 2012, 09:55
  5. RealTime Images
    By shiranraviv in forum Qt Programming
    Replies: 8
    Last Post: 31st December 2009, 01:41

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
  •  
Qt is a trademark of The Qt Company.