Results 1 to 17 of 17

Thread: Plotting of QProcess output taking about 5 minutes to plot single value.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Plotting of QProcess output taking about 5 minutes to plot single value.

    I still think you need to break the problem down into the smallest piece possible, than add more features. I would start by writing a Qt program that simply starts the listener process, reads the output from your sensor and prints it using qDebug(). No printing it to a text edit, no logging to files, no plotting. At this point, you have no idea which step in this chain is going wrong, so eliminate everything except the first one: getting data successfully from the QProcess into your program. Once that seems to be working in the same way as your C program, then you know the communication works, so add the graphics and other features.

    You might also try using QProcess:readAllStandardOutput() to get all of the available data at once instead of using readLine(). Use QByteArray::data() or QByteArray::constData() to get the NULL-terminated C string it contains. This way you do not have to worry about the buffer size or whether you have read it all.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. The following user says thank you to d_stranz for this useful post:

    suhairkp (23rd February 2017)

  3. #2
    Join Date
    Jan 2017
    Posts
    13
    Thanks
    4
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Android

    Default Re: Plotting of QProcess output taking about 5 minutes to plot single value.

    k . sir. I am testing it without plot . in my above code , it displaying "process error code : 2 " in Application output area of Qt Creator , when output gui display open and saying " Qprocess : Destroyed while process is still running ". when i changed process->waitForStarted from process->waitForFinished , it show that "process error code : 5 "
    Last edited by suhairkp; 23rd February 2017 at 11:10.

  4. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plotting of QProcess output taking about 5 minutes to plot single value.

    Once again : why You use external program to read data from serial port ? Why You don't do it in Qt program ?

Similar Threads

  1. How to Plot from QProcess output
    By suhairkp in forum Newbie
    Replies: 0
    Last Post: 31st January 2017, 14:12
  2. Can I read output of a single with the help of Mingw Compiler?
    By parulkalra14 in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2014, 10:03
  3. Replies: 2
    Last Post: 28th January 2014, 09:02
  4. Problem in plotting 3D plot using QWT
    By johnMick in forum Newbie
    Replies: 1
    Last Post: 15th July 2011, 11:19
  5. Replies: 1
    Last Post: 9th September 2010, 10:22

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.