Results 1 to 6 of 6

Thread: Overloading QwtPlot replot() to replot every 100 msec

  1. #1
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Overloading QwtPlot replot() to replot every 100 msec

    Hi,

    I am using QwtPlot to display large amounts of data, that comes in fas (every 1 msec). I decided i will not be refreshing the plot every time data new data comes and will rather do it every 100 msec. So I'm using a QTimer that times out every 100msec. When that happens QwtPlot::replot() is called.

    Qt Code:
    1. void EWOSubPlot2D::replotTimerTimeout() {
    2. lock_guard<mutex> replotLock(replotMutex);
    3. if (replotFlag) {
    4. QwtPlot::replot();
    5. replotFlag = false;
    6. }
    7. }
    8.  
    9. void EWOSubPlot2D::replot() {
    10. lock_guard<mutex> replotLock(replotMutex);
    11. replotFlag = true;
    12. }
    To copy to clipboard, switch view to plain text mode 

    I am using a zoomer, magnifier and a panner.
    When I overload replot() method like shown above, zommer does not draw rectangles as i draw them and
    when i press keyboard combination for zoom out, axis labels are not displayed yet. It seems to me that QwtPlot::replot() does other things than just replotting, so it cant be "put in queue" and executed later?

    I'm using Qwt 6.1.2

    BR, f0orz4h
    Last edited by f0orz4h; 22nd January 2016 at 11:53.

  2. #2
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Overloading QwtPlot replot() to replot every 100 msec

    I see that no response to my question has been made yet, while some other questions have been responded to. Have I not been clear enough with the question or is there something else?
    I would really apreciate help for my problem.
    br, f0orz4h

  3. #3
    Join Date
    Jul 2015
    Posts
    87
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Overloading QwtPlot replot() to replot every 100 msec

    You can use QTimer to call QwtPlot::replot() every 100ms. See documentation of QTimer

  4. #4
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Overloading QwtPlot replot() to replot every 100 msec

    I am using QTimer to do that. But if im reploting only once per 100ms zoomer rectangle does not draw itself, nor zooming applies when mouse is released. And also axis labels are not displayed when zoomed out

  5. #5
    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: Overloading QwtPlot replot() to replot every 100 msec

    Zooming is nothing else, than selecting axes ranges interactively and then setting them with setAxisScale. When changing the axis at the same time every 100ms you probably revert it.

    Uwe

  6. #6
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Overloading QwtPlot replot() to replot every 100 msec

    Quote Originally Posted by Uwe View Post
    When changing the axis at the same time every 100ms you probably revert it.

    Uwe
    Im not sure I understand what you are saying. Basically the only modification from the working code is only that Qwt::replot() is called in callback function on timer timeout. I really don't understand the symptoms.

Similar Threads

  1. Replies: 1
    Last Post: 14th May 2014, 08:57
  2. the replot of a qwtPlot is too slow
    By gaia86 in forum Qwt
    Replies: 3
    Last Post: 4th April 2012, 09:33
  3. the replot of a qwtPlot is too slow
    By gaia86 in forum Qwt
    Replies: 1
    Last Post: 3rd April 2012, 17:54
  4. the replot of a qwtPlot is too slow
    By gaia86 in forum Qwt
    Replies: 0
    Last Post: 3rd April 2012, 16:19
  5. Replies: 1
    Last Post: 4th November 2009, 23:14

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.