How do I generate output from a C ++ Win32 console application?
I have a small Win32 console application that is essentially a test harness. I am reading data, doing some processing on it and currently just outputting some numbers to the console. This is not a huge problem - I can figure out what the data looks like, but it would be much easier to analyze if there was a way to get this information in a graph for every run of the software.
I recently ran into GNUPlot but cannot find an easy way to get the data sent to it. Has anyone tried this? .. or is there another graphical application I should try?
Excel and OO Calc are great tools and I have loaded .csv data into them to display the data graphically many times. However, I was hoping that you would be able to dynamically pass data to a graphing application to avoid having to close / reopen Excel and build a graph every time I want to view some data.
I think you can pipe data to GNUPlot (which is why I mentioned it), but the details on how to do this are rather scarce.
a source to share
You don't really need to touch VBA to do this
In Excel, you can set up a data connection to a file, it supports many file types, but CSV works fine.
- Go to list item
- Data tab
- Click "Connections"
- Click "Add"
- select File
- go to connection properties - cancel ticket for filename
- set the required period.
- close the connections dialog
- select start cell to import data cell 1a in sheet 2
- click existing connections
- select your data connection
- flip to workheet1 add your chart and connect data.
the chart will now automatically update
it's Excel 2007 - but I think the older version had it and I think OO can do it.
a source to share
A simple approach is to output the data from CSV and then import it into a spreadsheet such as Excel or OpenOffice to draw a graph.
Edit: Following your question, I got interested in GNUPlot myself - this is the simplest description of using it from the command line I've found: http://www.goldb.org/goldblog/CommentView,guid,f378e279-eaa5-4d85-b7d2-0339a7c72864 .aspx
Never underestimate the power of Excel and the .csv data dump.
Writing data to a CSV file of a C ++ form is not very difficult and there are many articles on the topic out there, for example: here or just Google.
Excel can download the .csv easily and then you can simply use it to plot whatever graphs you need. This is especially useful if you just need a quick visual health check, etc.
a source to share
I just found an example of piping data in gnuplot on the Cardiff University website. Haven't tried it yet but looks promising!
[edit] .. and another one that contains some notes for windows .
a source to share