Results 1 to 6 of 6

Thread: Creating software to plot real-time 2D basic graphs

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Creating software to plot real-time 2D basic graphs

    Hello!

    I'm a engeneering student working in a project that, in the current moment, need to create a software that is capable of recieving real time data from a wireless module (such as Cinterion TC65i or u-Blox Leon) and plot it in a basic 2D real time graphic (exactly the same that we see in a cardiac monitor), where the X array will be time.

    A professor here in the university suggested Qt to create the software, so I'm now in the part of learning how to use it.

    But (and correct me if I'm wrong) I found that even using Qt I would still have to choose a graphic library (such as matplotlib, Cairo, Qwt and so on) to create the software. And I'm having difficulties in the issue of finding a graphic library or even software capable of displaying 2D graphics in real time (most of them plot just one figure at the end of the software, and that is useless for me) and, of course, it must be one that can be used with Qt. Gnuplot, for example, was capable of doing something like this, but I had problems in calling the software from my C software (not Qt), that means, when I was trying to call it to plot the graphic.

    The second problem, though, is that even if I do find a graphic library capable of ploting real time graphics, I still don't know how to use it in Qt (yes, I'm a 0 level Qt user).

    For example, searching in this Forum about the same problem, I found three other posts that deals with similar cases:

    http://www.qtcentre.org/threads/4181...ime-graph-plot

    http://www.qtcentre.org/threads/3191...Real-time-plot

    http://www.qtcentre.org/threads/1866...l-time-reading

    But nether of them show how do I call Qwt or other graphic library in the Qt environment. In fact, the most close that I found in explaining how to do something like what I need was in this post:

    http://stackoverflow.com/questions/1...th-2d-graphics

    So, essentialy, what I would ask is:

    1. Which library should I use for my real time 2D graph software?
    2. How do I implement it in Qt?
    3. How do I call it to create the graph?

    I would really apreciate if somebody decide to be very nice and give me a code-example already able to plot a real time graph (of course, the part of connecting to the wireless module and recieving data is the minimal that I should do).


    Thanks very much.

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Creating software to plot real-time 2D basic graphs

    Qwt does dynamic plotting; one of their demo programs shows a nice example of it.

    There is no such thing as "real time" plotting, however. There is always some lag between data generation and display. A display showing what floor an elevator is on only needs to refresh once ever few seconds to meet a "real time" requirement; a display showing the amplitude of an audio signal might have to refresh several thousand times per second if it is "displaying" to various input devices, although updates as long as 1/100 second would probably be fine for visual display purposes, given that display devices and the human visual system can't handle faster speeds. You haven't provided any sort of refresh information, so it isn't possible to say what might be an appropriate solution, although Qwt can certainly handle many dozens, probably hundreds, of points per second.

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Creating software to plot real-time 2D basic graphs

    Qwt does dynamic plotting; one of their demo programs shows a nice example of it.
    Which example, exactly? And where can I find it and execute it to see?


    There is no such thing as "real time" plotting, however. There is always some lag between data generation and display. A display showing what floor an elevator is on only needs to refresh once ever few seconds to meet a "real time" requirement; a display showing the amplitude of an audio signal might have to refresh several thousand times per second if it is "displaying" to various input devices, although updates as long as 1/100 second would probably be fine for visual display purposes, given that display devices and the human visual system can't handle faster speeds. You haven't provided any sort of refresh information, so it isn't possible to say what might be an appropriate solution, although Qwt can certainly handle many dozens, probably hundreds, of points per second.
    Well, I imagine you got the idea when I sad "real time" plotting. Naturally there will be a time difference between recieving the information and ploting the graphic, but the idea is to plot a base of 150 points per second (or something of the like) while having a recieving speed about that or maybe higher, but ploting the graphic at the same time while recieving the data (note that the majority of aplications using 2D graphs first recieve the data, and than configure the plotting commands and than plot the graphic ready with one function. The idea is not to do that, but plot the graphic point by point in a constant speed "at the same time" as data arises).

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Creating software to plot real-time 2D basic graphs

    Which example, exactly? And where can I find it and execute it to see?
    Beats me; it was part of the Qwt package. Download it and install it, and have a look at the demos.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Creating software to plot real-time 2D basic graphs

    Examples: data_plot, cpu_plot, and to a lesser extent realtime_plot

  6. #6
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Creating software to plot real-time 2D basic graphs

    Thank you all for everything. I did managed to install Qwt and I'm already studing the examples.

Similar Threads

  1. real time graph plot
    By robotics in forum Qt Programming
    Replies: 5
    Last Post: 24th May 2011, 05:04
  2. Replies: 1
    Last Post: 27th April 2011, 10:35
  3. QFileSystemWatcher with a Qwt Real-time plot
    By gen_mass in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2010, 21:28
  4. Basic 2D Graphs with QGraphicsView
    By Astronomy in forum The GraphicsView Framework
    Replies: 3
    Last Post: 3rd August 2009, 21:07
  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

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.