Signal Visualizer

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
exosyst
Knows some wx things
Knows some wx things
Posts: 25
Joined: Sun Aug 05, 2007 9:47 pm

Signal Visualizer

Post by exosyst » Fri Jun 06, 2008 2:12 pm

Hey guys - I wrote a signal visualizer tool for my final year project at uni. It has network comms, 2D graphics stuff and some other odds and ends

I posted a few times asking for help and it was greatly received so thought i'd return the favour and dump this code with you.

Apologies if it's not the best in the world but someone might have use for bits of it.
Enjoy :D
Attachments
SignalVisualizer.rar
Signal Visualizer
(187.58 KiB) Downloaded 306 times

francis33y
Experienced Solver
Experienced Solver
Posts: 61
Joined: Wed Feb 13, 2008 9:21 am
Location: Paris, France

can't compile the client

Post by francis33y » Wed Aug 20, 2008 7:42 am

Hello

This code looks interesting but I can't compile the client on my ubuntu pc:
gcc -c GraphFunctions.c -o GraphFunctions.o
In file included from GraphNetFunctions.h:69,
from GraphFunctions.c:41:
/usr/include/sys/socket.h:54: erreur: expected identifier before numeric constant

Could you help me ? And/or provide some screenshots of the graphics ?

Thanks

F

framepointer
Super wx Problem Solver
Super wx Problem Solver
Posts: 264
Joined: Mon Aug 07, 2006 3:25 pm
Location: Baia Mare, Romania
Contact:

Re: can't compile the client

Post by framepointer » Mon Sep 08, 2008 3:28 pm

francis33y wrote:Hello

This code looks interesting but I can't compile the client on my ubuntu pc:
gcc -c GraphFunctions.c -o GraphFunctions.o
In file included from GraphNetFunctions.h:69,
from GraphFunctions.c:41:
/usr/include/sys/socket.h:54: erreur: expected identifier before numeric constant

Could you help me ? And/or provide some screenshots of the graphics ?

Thanks

F
You should comment

Code: Select all

#ifndef SHUT_WR
	#define SHUT_WR 1
#endif
in the file GraphNetFunctions.h


Regards
Software is like sex,
It's better when it's free.
~Linus Torvalds

francis33y
Experienced Solver
Experienced Solver
Posts: 61
Joined: Wed Feb 13, 2008 9:21 am
Location: Paris, France

Post by francis33y » Tue Sep 09, 2008 6:55 am

ok, but now it complains about missing "conio.h"

Couldn't find it.

F

francis33y
Experienced Solver
Experienced Solver
Posts: 61
Joined: Wed Feb 13, 2008 9:21 am
Location: Paris, France

Post by francis33y » Tue Sep 09, 2008 7:06 am

And if I provide a conio.h, then it complains again:
[email protected]:~/Desktop/Client_Lib$ make
gcc main.c -lm GraphFunctions.o GraphNetFunctions.o [email protected]:~/Desktop/Client_Lib$ make
gcc main.c -lm GraphFunctions.o GraphNetFunctions.o GraphXMLFunctions.o GraphObject.o DSPGraph.o -o ClientApp
In file included from main.c:45:
GraphFunctions.h:271: erreur: expected identifier before numeric constant
make: *** [clientapp] Erreur 1
unctions.o GraphObject.o DSPGraph.o -o ClientApp
In file included from main.c:45:
GraphFunctions.h:271: erreur: expected identifier before numeric constant
make: *** [clientapp] Erreur 1

exosyst
Knows some wx things
Knows some wx things
Posts: 25
Joined: Sun Aug 05, 2007 9:47 pm

Post by exosyst » Fri Oct 24, 2008 9:30 pm

Here're some screenshots, I haven't tried building this project with later versions of Ubuntu, infact I haven't touched it since I completed it as part of my final university project. Attached are some pics, when I got on my Linux box I will see what if anything has changed.
Attachments
comparison.PNG
Matlab comparison
pz.PNG
ubuntu shot
pz.PNG (34.55 KiB) Viewed 3064 times
Remote Plot.PNG
Mac Shot
Remote Plot.PNG (29.44 KiB) Viewed 3064 times
Last edited by exosyst on Fri Oct 24, 2008 9:49 pm, edited 1 time in total.

exosyst
Knows some wx things
Knows some wx things
Posts: 25
Joined: Sun Aug 05, 2007 9:47 pm

Post by exosyst » Fri Oct 24, 2008 9:43 pm

Hmm, The main.c is pretty awful and was just an example. You can strip out the PI identifier and the other bits of junk left over from testing. See if that works. The only point of that example was just to show that it connects to the running server and generates a graph, the API is really basic (awful :P) so the following should serve as a template for a 2D graph:

Code: Select all

/* include required files*/
#include "GraphFunctions.h"

int main(void)
{
/* Create graphobject on server */
	GraphObject *testGraph = Create2DGraph(
		"Sine/Cosine Time Test", 
		"Sample", 
		"Amplitude", 
		SV_AUTO_SCALE, 
		SV_SIGNED,
		SV_GRAPH_LINE, 
		"localhost"
		);
/* Populate an array with values to graph here */
/* ... */

/* Display the graph on the server */
Display2DGraph(testGraph, "Cos", /* pointer to data */, /* Number of data points to plot */, SV_GRAPH_LINE, SV_BLUE, SV_HIDE_MARKERS, SV_GRAPH_NEW);

return 0;
}
Sorry I can't be more use, it's been a while and without a Linux machine to hand I won't be much use!
Feel free to just break it and take what you like (if anything!), it's under a permissive license.

Post Reply