Results 1 to 6 of 6

Thread: How to avoid linking both ends of a Curve Plot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2015
    Posts
    3
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Android

    Default Re: How to avoid linking both ends of a Curve Plot

    Quote Originally Posted by d_stranz View Post
    Then I'd suggest you start looking for a memory leak. It could also be that even if you don't have a leak, the constant modification of the curve data (and array length) is causing memory fragmentation. In that case, I would look at using fixed-length arrays where instead of adding or removing points, you simply give a different starting position and number of points by manipulating the pointers you send to the curve plot.
    okay, I'll keep it in mind, I'll test again first removing and adding points and if I notice something odd I'll fallback to using a pointer, thanks !!!

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

    Default Re: How to avoid linking both ends of a Curve Plot

    You could inherit from QwtSeriesData. Inside you would have an array of points and a start index. When a new point arrives you simply replace the point at the index and increment the index.
    Then all you have to do is to reimplement the sample method in a way, that the start index is taken into count.

    Or something similar along this idea

    HTH,
    Uwe

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

    d_stranz (6th October 2021)

Similar Threads

  1. Replies: 1
    Last Post: 5th May 2014, 07:49
  2. Replies: 6
    Last Post: 7th January 2013, 16:30
  3. Plot x^2 curve
    By qt_developer in forum Qwt
    Replies: 4
    Last Post: 14th June 2012, 08:17
  4. How to plot tan(x) curve?
    By Name in forum Qwt
    Replies: 1
    Last Post: 17th September 2010, 13:20
  5. Replies: 4
    Last Post: 7th September 2010, 11:52

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.