Results 1 to 3 of 3

Thread: How implement real time history plot with data samples having varying timestamps?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    14
    Thanked 2 Times in 2 Posts

    Default Re: How implement real time history plot with data samples having varying timestamps?

    Solved. ( Sorry, bad arithmetic calculating elapsed time - it should have been working all along )

    The cpuplot source was used pretty much as is, simply replacing the timer event handler with my own code that I called when I received the updated time-stamped data sample:

    Qt Code:
    1. // Update X-axis time series labels for the amount of time that has passed since last update
    2. double elapsedTimeIntervalSeconds = (structDataSample.timeStampMs - m_structDataSampleLast.timeStampMs) / 1000.0;
    3. m_structDataSampleLast = structDataSample;
    4. qDebug() << "Dbg: elapsedTimeIntervalSeconds = " << elapsedTimeIntervalSeconds << endl;
    5. for ( int j = 0; j < HISTORY_BUFFER_LENGTH; j++ )
    6. {
    7. timeDataSeries[j] = timeDataSeries[j] + elapsedTimeIntervalSeconds;
    8. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Apr 2013
    Posts
    9
    Qt products
    Qt4 Qt5

    Default Re: How implement real time history plot with data samples having varying timestamps?

    I'm also doing the same kind of application. I'm new to QWT and QT. Can u please upload the full code?

Similar Threads

  1. How to plot real time x/y graph in Qtopia
    By desperado_43 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 18th May 2012, 08:00
  2. real time graph plot
    By robotics in forum Qt Programming
    Replies: 5
    Last Post: 24th May 2011, 05:04
  3. Replies: 1
    Last Post: 27th April 2011, 10:35
  4. QFileSystemWatcher with a Qwt Real-time plot
    By gen_mass in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2010, 21:28
  5. Best way in Qt to plot curve per real-time reading?
    By Sheng in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2009, 22:33

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.