How do I plot the output from a C++ Win32 console app? - c++

I have a small Win32 console application which is essentially a test harness. I read data in, do some processing on it and currently just output some of the numbers to the console. This isn't a huge problem - I can get an idea of what the data looks like, but it would be much easier to analyse if there was a way of getting that information into a graph for each run of the software.
I've been getting to grips with GNUPlot recently, but can't work out a simple way to get the data sent to it. Has anyone tried this? ..or is there another graphing application I should try?
Excel and OO Calc are great tools and I've loaded .csv data into them for graphing data plenty of times myself. I was, however, hoping for a way to dynamically pipe data into a graphing application to avoid having to close/reopen excel and plot a graph each time I want to look at some data.
I think you can pipe data into GNUPlot (which is why I mentioned it) but the details of how to do so are rather scant.

A simple approach is to wtite the data out as CSV and then import it into a spreadsheet like Excel or OpenOffice to do the graph drawing.
Edit: Following your question, I got interested in GNUPlot myself - this is the simplest description of using it from the command line that I found: http://www.goldb.org/goldblog/CommentView,guid,f378e279-eaa5-4d85-b7d2-0339a7c72864.aspx

Never underestimate the power of Excel and a .csv data dump.
Writing data to a .csv file form C++ is not very difficult and there's lots of articles out there regarding the subject, for example: here, or just google.
Excel can easily load .csv's and then you can just use that to plot whatever graphs you require. THis is particularly useful if you just want a quick visual sanity check of results etc.

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 files type but CSV does work fine.
Go to List item
Data Tab
Click Connections
Click Add
select the file
go to the connection properties - un-tick prompt for file name
set the required period.
close the connections dialog
select the start cell for importing the data - cell 1a on worksheet 2
click existing connections
select you data connection
flip to worksheet1 add your chart and hookup the data.
the chart will now update automatically
this is Excel 2007 - but think older version had this and I think OO can do it to.

You might also want to look into XMGrace which allows you to launch it and drive it dircetly from C/Fortran programs as shown here

Excel is completely script-able. Use the macro recorder to figure out the steps. Create the chart in its own sheet. Then save the chart using the GIF filter.
The actual import is something like:
ActiveChart.Export FileName:=something_dot_gif, FilterName:="GIF"

I just found an example of piping data into gnuplot on Cardiff University's website. Not tried it yet, but it looks promising!
[edit] ..and another which includes some notes for windows.

You can use MathGL - it can create a window (FLTK, GLUT or Qt) and display plot inside. Also it have large set of plot types and can work in console.

Related

C++ Reading data from excel file and treating them as variables

I am using C++ & CLR to create a GUI in Visual studio. The whole app is like a calculator for the price of transport and the costs associated with it for my work. At work, we are using Helios and we are able to export certain data to Excel. Specifically, the prices of transport, packaging materials, etc. And what I need is for my program to be able to read certain cells in Excel where prices and other variables are recorded and calculate with it so that I don't have to rewrite all the values manually in the source code.
I spent a lot of time looking for a solution but couldn't find anything that referred to my problem. Is it even possible to build such a program? I don't want anyone to solve it for me. Maybe I just missed some banality and just need some direction. And as far as I understand, the CSV format is irrelevant for me, because I need to work with a few specific cells that Helios pre-fills for me in the Excel sheet.

Can snmpreceiver or pysnmp module be used to collect data for a printer monitoring system using django?

i am trying to generate SNMP data for printers for later analysis using a prediction algorithm to be able to fortell emanating faults in printers before they actually occur. I seek advice on how best i could collect the data and prepare it in a dataset format like .csv so as to feed it into my classifier.
Would really appreciate any help rendered
Cheers!
My approach might not be the most efficient one but it is possible to start with and later improve it.
What I would do in your case would be the following:
1) Create a python script that polls every printer, you need to poll. This using Pysnmp.
2) What I don't understand is where you want to collect your data from but anyways, you can import csv in your poller script and create a csv file if that is what you want. Or if you want that data inserted into a sql database eg MySQL you can push the data as well from your script.
Hope this helps:)

How to generate Data Matrix Barcode from Nav 2015?

I searched a lot regarding the Data Matrix Code generation from Nav 2015 but could not get any proper solution for that though, i got some code from below link but still, some of the automation variables is not there in Navision, so I need you guys help on this, is there any Code Unit or any object or any other way in Nav..
http://www.barcode-soft.com/dynamics-nav-barcode.aspx
It depends on how much time you have to get the barcode.
If it's a back end job, like a report, you can call a command line tool to create the barcode and import the generated image file into a BLOB of a table variable. This table field is then printable within the report.
Another way I use in production is running a web service that creates the barcode and then let Navision create a web page that is opened in a browser window..
I suggest using a dll (written in C# with ZXING.NET) to generate it and then importing it in NAV.

Graph plotting in Excel from C++ application

My C++ application generates a .csv file containing 10000 floats.
Now the requirement is that there should be a graph in the same file depicting those floats.
I understand that csv files cannot have graphs. So I have to switch to Excel
Assuming I can write data into columns in excel sheet can anybody tell me if there is any function that I can call in my C++ program which will plot the data in excel sheet?
I have seen some solutions based on Python, but I am exploring if it is possible from C++ only.
www.google.com/search?q=C%2B%2B+Excel+OLE
The MSDN documentation is also often useful.
Try this library SimpleXlsxWriter. It is possible to plot basic graphs on the separate sheet in the excel book. There are also some examples of using on the wiki page of the project
The library provides no external dependencies
This might be of use, especially the last chapter:
www.maths.manchester.ac.uk/~ahazel/EXCEL_C++.pdf
CSV is a graph format.
It stands for Comma Separated Value.
You can load this file into Excel.
It will also import into SQL, MYSQL use (PHPMyadmin for this).
SQL stands for Structured Query Language. MYSQL is web based.
Best wishes to you.
http://www.whatisacnc.com

excel in django

How can i make user to downlaoad a excel from the django app.i HAVE A MODEL WHICH gives the report.Now i want a option from user can download the file in excel form.ANy Solution
You can output the data as .csv which is easily imported into MS Excel.
http://docs.djangoproject.com/en/dev/howto/outputting-csv/
EDIT
After I wrote that I got curious if there actually was some way to do it directly to excel format and found:
http://www.python-excel.org/
That made me wonder why you didn't google your question before posted it here.....
I'm not sure quite what you're asking. If you're asking how can you generate output that's able to be read into Excel, IMO your best bet is using a CSV (see amoeba's response) as that's pretty generic. There are ways of using true Excel formats as well.
I'm thinking though that perhaps you're asking how you can have a user click a link (or whatever) and have Excel pop up with your data in it? (IOW, you've already generated the output).
I suppose I'd say a few things:
1) It shouldn't be specific to Excel, many users use things like OO.o (thus my CSV suggestion)
2) It's going to vary depending on their browser and how they have it set up. Personally, I don't like pages opening up the "proper application" so I turn all of that off - other people enable it.