Results 1 to 12 of 12

Thread: Incremental Spectrogram...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: Incremental Spectrogram...

    Quote Originally Posted by AndiTheCoder View Post
    All right. this is possible with a "normal" QwtPlotCurve. There I can draw() data from and to. But how to do this with a spectrogram?
    Derive from QwtPlotSpectrogram and introduce a QImage, where you collect your increasing values. Whenever you want to add new values call QwtPlotSpectrogram::renderImage with a painter initialized with your image and for the new area only.

    Then overload YourPlotSpectrogram::renderImage returning parts of your image instead of rendering it ( don't call this one for the image composition above ).

    When you want to paint new parts of your spectrogram on screen do something like this:

    Qt Code:
    1. QRectF newArea = ...; //
    2. QRectF rect = QwtScaleMap::transform(
    3. spectrogram->canvasMap( QwtPlot::xBottom),
    4. spectrogram->canvasMap( QwtPlot::yLeft ),
    5. newArea );
    6. plot->canvas()->repaint( rect );
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by AndiTheCoder View Post
    When will the qwt6 be finished? Or is the rc5 stable enough?
    Use SVN trunk - this is planned to be the final version of Qwt 6.

    Uwe

  2. #2
    Join Date
    Apr 2011
    Location
    Munich, Germany
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Incremental Spectrogram...

    Hello Uwe,

    good news! I have separated sampling (with threading!) from refreshing the plot(s) and it runs very good!

    I have not to draw only parts of a curve because the sampling data are saved in the yData of the QwtPlotCurve directly. So every replot() (by now only with 25Hz) all sampled data will be displayed at once. So there is also enough time to update the (whole) spectrogram with 25Hz.

    The step updating to Qwt6 is not easy for me. Many functions I use aren't available any more (e. g. QwtPlot:rint(); also the QwtPlotSpectrogram class has changed).

    But thank you very much for helping me! And if I will have another problem I will post it in this forum.

    Thanks and Servus

    Andreas

Similar Threads

  1. Replies: 2
    Last Post: 12th October 2009, 21:17
  2. incremental 2d plotter with QGraphicsView
    By bingofuel in forum Qt Programming
    Replies: 1
    Last Post: 25th August 2009, 06:03
  3. Spectrogram Plot Hints
    By shargath in forum Qwt
    Replies: 2
    Last Post: 25th February 2009, 11:11
  4. Spectrogram too slow
    By a_kaa in forum Qwt
    Replies: 2
    Last Post: 9th January 2009, 16:57
  5. Replies: 6
    Last Post: 17th June 2008, 07:28

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