Results 1 to 20 of 20

Thread: Regarding plotting using .csv file in QWT

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Regarding plotting using .csv file in QWT

    Hi Uwe,

    I am using qwt library to draw a graph of Time Vs Temperature in my project
    where the data is fed to curve by reading from a csv file as a text.

    However I am able to read the values of the csv file when I qdebug in my code,
    but am not able to draw those on to the plot.

    The QwtPlotCurve class takes parameters only in double and converting the string
    info from .csv file to double and feeding it by still it is not drawing those
    values.The csv file contains Time and temperature and this data set/pair comes
    for every 5 secs.
    setRawSamples() function i am using.

    Do you have any examples which read csv file and plot accordingly?

    Does qwt supports Embedded Linux as well? also does it support touch events such
    as thumb and fore finger zooming, panning right now they are happening from
    classes QwtPlotPanner and QwtPlotMagnifier through mouse events.

    These are versions that I am using currently
    QtCreator: 2.0.1
    Qt Version : 4.7
    QWT Version: 6.0.1

    Awating your reply.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,341
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Regarding plotting using .csv file in QWT

    Hello Ravikiran,

    Many of the people who subscribe to the Qwt mailing list also watch this forum.

    You didn't like the answer you got in the mailing list, so you thought reposting the exact same question here would get you a different answer? That is a little bit insulting to people who are polite enough to give you an answer, don't you think?

    David

  3. #3
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    Hi David,

    Its not so.I am not insulting any one. I did not find QWT mailing list that much friendly and was also not able get clearly see responses to my questions as I have registered to it recently.
    The day I posted my question on QWT mailing list , I also posted in QtCentre as well.So no question of insulting, as I was even not knowing that many people are registered with QWT mailiing list.

    BR,
    Ravikiran

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Regarding plotting using .csv file in QWT

    Back to your CSV files I recommend to organize your question like you would organize your code:


    • How to load a CSV files into a QPolygonF
    • How to display a QPolygonF on a QwtPlot


    The first question is completely unrelated to Qwt and I'm pretty sure that you can solve this problem easily. If not ask in the newbie section of this forum or google for "csv file qt".

    The second question is simply:

    Qt Code:
    1. curve->setSamples( polygon );
    To copy to clipboard, switch view to plain text mode 
    Uwe

  5. The following user says thank you to Uwe for this useful post:

    Aster036 (23rd April 2012)

  6. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,341
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Regarding plotting using .csv file in QWT

    Its not so.I am not insulting any one. I did not find QWT mailing list that much friendly and was also not able get clearly see responses to my questions as I have registered to it recently.
    The day I posted my question on QWT mailing list , I also posted in QtCentre as well.So no question of insulting, as I was even not knowing that many people are registered with QWT mailiing list.
    OK, my mistake for jumping to a conclusion. I apologize. In case you did not get the answer I posted to the Qwt mailing list, here it is:

    > Do you have any examples which read csv file and plot accordingly?

    Posting a question with no example code means that we have to guess what
    you might be doing wrong. We can make up answers all day long and never
    know if we've told you the real answer. It is like asking "How long is
    a piece of string?"

    Reading data points from *anywhere* and plotting them using QwtPlot are
    completely unrelated problems.

    - Have you looked at the arrays of data you are sending to QwtPlot to
    see if they actually contain the numbers you see in your CSV file? How
    do you know the reading is successful? How do you know the parsing from
    string to number is successful?

    - If the arrays *do* contain the numbers you expect, how do you allocate
    these arrays? The setRawData() method *requires* that the array
    pointers be valid for the lifetime of the QwtPlotCurve that is using
    them. If your arrays go out of scope before the curve does, then the
    curve is trying to use invalid pointers to draw.

    - Did you set the axis ranges to match the data ranges? If the data is
    outside the range of the plot, then the curve might be drawn, but
    nothing is visible because it is outside the axes.

    - Did you set the curve style to be "Lines" and the pen to be something
    visible? If the style is set to "NoCurve", then it will be invisible.

    > also does it support touch events

    David

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

    Aster036 (23rd April 2012)

  8. #6
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    > Do you have any examples which read csv file and plot accordingly?

    Posting a question with no example code means that we have to guess what
    you might be doing wrong. We can make up answers all day long and never
    know if we've told you the real answer. It is like asking "How long is
    a piece of string?"

    Reading data points from *anywhere* and plotting them using QwtPlot are
    completely unrelated problems.

    - Have you looked at the arrays of data you are sending to QwtPlot to
    see if they actually contain the numbers you see in your CSV file? How
    do you know the reading is successful? How do you know the parsing from
    string to number is successful?

    -- I am able to see the read csv values in the command prompt when I print them on the screen using qDebug() macro.

    - If the arrays *do* contain the numbers you expect, how do you allocate
    these arrays? The setRawData() method *requires* that the array
    pointers be valid for the lifetime of the QwtPlotCurve that is using
    them. If your arrays go out of scope before the curve does, then the
    curve is trying to use invalid pointers to draw.

    --- What class should I use I am not getting QwtSeriesData or QwtArraySeriesData?
    ---- I have not allocated anything as of now.

    - Did you set the axis ranges to match the data ranges? If the data is
    outside the range of the plot, then the curve might be drawn, but
    nothing is visible because it is outside the axes.

    --- I have set the axis ranges according to my data.
    ----

    - Did you set the curve style to be "Lines" and the pen to be something
    visible? If the style is set to "NoCurve", then it will be invisible

    ---I have not set any style to the curve.

  9. #7
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    Hi ,

    I am trying to create graph which is attachedtemplog_spec_qwt_post.jpg.
    (templog_spec_qwt_post.png)
    But as of now the status is like the one attached myapp.png.

    Please suggest how to get the scales like the one specified(templog_spec), also I want to plot graph dynamically
    where the data is coming for every 5 seconds, the data is Time and its corresponding temperature in a csv format.

    It may not be smooth sinusoidal curve as the templog_spec is showing.

    Thanks in advance.

    Aster

  10. #8
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    Hi

    I am now using latest build of qwt-6.0.1 on Ubuntu 10.04, but when tried to install qwt am getting below error:


    qmake is /usr/local/Trolltech/Qt-4.7.0/bin/qmake
    root@ubuntu:/home/ravi/Desktop/qwt-6.0.1# qmake qwt.pro
    root@ubuntu:/home/ravi/Desktop/qwt-6.0.1# make
    cd src/ && make -f Makefile
    make[1]: Entering directory `/home/ravi/Desktop/qwt-6.0.1/src'
    g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/qt3 -Imoc/ -o obj/qwt_abstract_scale_draw.o qwt_abstract_scale_draw.cpp
    In file included from qwt_scale_div.h:14,
    from qwt_abstract_scale_draw.h:14,
    from qwt_abstract_scale_draw.cpp:10:
    qwt_interval.h:15: fatal error: qdebug.h: No such file or directory
    compilation terminated.
    make[1]: *** [obj/qwt_abstract_scale_draw.o] Error 1
    make[1]: Leaving directory `/home/ravi/Desktop/qwt-6.0.1/src'
    make: *** [sub-src-make_default-ordered] Error 2

    I think its a well known problem , I did not get any where work around for this. Please help on this.

    Thanks in advance.

    Aster.

  11. #9
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Regarding plotting using .csv file in QWT

    Quote Originally Posted by Aster036 View Post
    ...-I/usr/share/qt3/mkspecs/default -I. -I/usr/include/qt3 ...
    Obviously you are trying to build Qwt 6.x with Qt3.

    Uwe

  12. #10
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    Hi Uwe,

    Can you please reply on my post which has two images attached.

    Thanks in advance.

  13. #11
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    Hi ,

    I tried to download qt csv file from below site:

    http://qcsv.svn.sourceforge.net/

    but when unzipped the file contains nothing, if you have csv file reader in Qt app download link please share.

    Thanks and Regards

  14. #12
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    Hi Uwe,

    Thanks for the earlier answer.

    My other concern is does Qwt support embedded Linux? because my project is very much based on Qt Embedded Linux 4.7 running on Free scale's IMX 233 H/W board with ARM 11 Compiler which also need to support plot zoom and panning.

    Is it straight forward process or do we have do put some effort?Please revert back to this.

    BR,
    Aster

  15. #13
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Regarding plotting using .csv file in QWT

    Quote Originally Posted by Aster036 View Post
    My other concern is does Qwt support embedded Linux?
    I never heard of a platform. where someone was running Qt and Qwt didn't work - Qwt depends on Qt and the C-library only, no other libraries ( boost, STL ) are used.

    I know many applications running QWS on embedded Linux ( see youtube ) and wrote large applications in this environment myself - but of course you always have to check your environment yourself.

    Uwe

  16. #14
    Join Date
    Apr 2010
    Location
    Bangalore
    Posts
    24
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: Regarding plotting using .csv file in QWT

    Hi ,

    When installing qwt-6.0.0-rc5 on Ubuntu 10.04 I am getting below error :

    1) qmake qwt.pro works fine
    2) when ran command "make" it is giving below error:

    /Desktop/qwt-6.0.0-rc5$ make
    cd src && make -f Makefile
    make[1]: Entering directory `/home/ravi/Desktop/qwt-6.0.0-rc5/src'
    compiling qwt_interval.cpp
    In file included from qwt_interval.cpp:10:
    qwt_interval.h:24: error: variable ‘QWT_EXPORT QwtInterval’ has initializer but incomplete type
    qwt_interval.h:24: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x
    qwt_interval.h:26: error: expected primary-expression before ‘public’
    qwt_interval.h:26: error: expected ‘}’ before ‘public’
    qwt_interval.h:26: error: expected ‘,’ or ‘;’ before ‘public’
    qwt_interval.h:51: error: expected constructor, destructor, or type conversion before ‘;’ token
    qwt_interval.h:53: error: ‘IncludeBorders’ was not declared in this scope
    qwt_interval.h:53: error: expected constructor, destructor, or type conversion before ‘;’ token
    qwt_interval.h:56: error: ‘IncludeBorders’ was not declared in this scope
    qwt_interval.h:58: error: ‘QwtInterval’ does not name a type
    qwt_interval.h:59: error: ‘QwtInterval’ does not name a type
    qwt_interval.h:60: error: ‘QwtInterval’ does not name a type
    qwt_interval.h:62: error: ISO C++ forbids declaration of ‘QwtInterval’ with no type
    qwt_interval.h:62: error: expected ‘,’ or ‘...’ before ‘&’ token
    qwt_interval.h:62: error: non-member function ‘bool operator==(int)’ cannot have cv-qualifier
    qwt_interval.h:62: error: ‘bool operator==(int)’ must have an argument of class or enumerated type
    qwt_interval.h:63: error: ISO C++ forbids declaration of ‘QwtInterval’ with no type
    qwt_interval.h:63: error: expected ‘,’ or ‘...’ before ‘&’ token
    qwt_interval.h:63: error: non-member function ‘bool operator!=(int)’ cannot have cv-qualifier
    qwt_interval.h:63: error: ‘bool operator!=(int)’ must have an argument of class or enumerated type
    qwt_interval.h:66: error: non-member function ‘int borderFlags()’ cannot have cv-qualifier
    qwt_interval.h:68: error: non-member function ‘double minValue()’ cannot have cv-qualifier
    qwt_interval.h:69: error: non-member function ‘double maxValue()’ cannot have cv-qualifier
    qwt_interval.h:71: error: non-member function ‘double width()’ cannot have cv-qualifier
    qwt_interval.h:76: error: non-member function ‘bool contains(double)’ cannot have cv-qualifier
    qwt_interval.h:78: error: ISO C++ forbids declaration of ‘QwtInterval’ with no type
    qwt_interval.h:78: error: expected ‘,’ or ‘...’ before ‘&’ token
    qwt_interval.h:78: error: non-member function ‘bool intersects(int)’ cannot have cv-qualifier
    qwt_interval.h:79: error: ‘QwtInterval’ does not name a type
    qwt_interval.h:80: error: ‘QwtInterval’ does not name a type
    qwt_interval.h:82: error: expected constructor, destructor, or type conversion before ‘operator’
    qwt_interval.h:83: error: expected constructor, destructor, or type conversion before ‘operator’
    qwt_interval.h:85: error: expected constructor, destructor, or type conversion before ‘&’ token
    qwt_interval.h:86: error: expected constructor, destructor, or type conversion before ‘&’ token
    qwt_interval.h:88: error: ‘QwtInterval’ does not name a type
    qwt_interval.h:89: error: expected constructor, destructor, or type conversion before ‘operator’
    qwt_interval.h:90: error: expected constructor, destructor, or type conversion before ‘&’ token
    qwt_interval.h:92: error: non-member function ‘bool isValid()’ cannot have cv-qualifier
    qwt_interval.h:93: error: non-member function ‘bool isNull()’ cannot have cv-qualifier
    qwt_interval.h:96: error: ‘QwtInterval’ does not name a type
    qwt_interval.h:98: error: expected unqualified-id before ‘private’
    qwt_interval.h:102: error: expected declaration before ‘}’ token
    make[1]: *** [obj/qwt_interval.o] Error 1
    make[1]: Leaving directory `/home/ravi/Desktop/qwt-6.0.0-rc5/src'
    make: *** [sub-src] Error 2

    what could be the problem? what is the work around?

    Thanks in advance.
    Aster


    Added after 6 minutes:


    Hi Uwe,

    I did not find csv file qt reader code, i found found tar file when googled, but it was empty.

    So if you have any link or code please let me know.

    Thanks in advance.

    BR,
    Aster
    Last edited by Aster036; 24th April 2012 at 11:54.

  17. #15
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Regarding plotting using .csv file in QWT

    Even if I would expect that it is unrelated: nobody will answer for qwt-6.0.0-rc5, when there are official Qwt 6.0.x releases for a long time.
    Back to your problem: try "type qmake" to see if your qmake is from a Qt version that is compatible with Qwt 6.x.

    Uwe

Similar Threads

  1. Plotting in 3D
    By FelixB in forum Qwt
    Replies: 1
    Last Post: 1st October 2010, 17:26
  2. Using QGLWidget for plotting
    By llemes4011 in forum Qt Programming
    Replies: 4
    Last Post: 28th July 2010, 15:40
  3. Replies: 0
    Last Post: 4th August 2009, 16:24
  4. Plotting graph of 1/x
    By Persoontje in forum Qwt
    Replies: 1
    Last Post: 20th March 2009, 15:26
  5. Plotting from Left to Right ??
    By dheeraj in forum Qwt
    Replies: 3
    Last Post: 3rd June 2008, 08:09

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.