Maker Pro
Maker Pro

need data capture, stat analysis, graph display software for PC

C

colin

John Barrett said:
To create an event

1. create a "public delegate <method prototype>;" outside the class that
will have the event... inside the class -- add a "public event <delegate
method name> <event name>;"

2. any place in the class where you want to fire the event, add "if
(<event name> != null) <event name>(delegate params);"

3. in any class that you want to handle the event, add "object.<event
name> += handler;"... the IDE will create the handler stub for you if you
hit tab twice after the +=

the delegate defines the parameters that will be passed, the event
statement defines the variable that will contain the list of handlers to
be invoked when the event is fired. Since delegates are typed, you can
pass any number/type of parameters that you like -- no limitations :)

cool thanks, although my autoreset works ok but il def look at that too.
although I initialy forgot to reset the thing if I didnt have to wait
then i forgot to check to not reset it if there was more there,
id forget my head if .. oh wait ...
Re sccanf == ya -- that doesnt really fit into the java/c# paradigm --
you've probably already found this or something similar -- but here is a
regex based sccanf for c#

http://www.codeproject.com/csharp/CsScanf.asp

Yeah I saw that in a google search, scaned through about 10- pages of stuff
and thought geez
my brain is already starting to melt trying to take in new lang dev system
etc.
all i want to do is 1 line like sscanf(s,"%d:%s:%d,%d|%d,%d\n"...
I could porobably write a whole sscanf function in less time it takes to
read and digest all that.
I remember long ago it only took me a few hours to write a whole sprintf()
wich was reentrant friendly.

sscanf was realy out of place in c++ too, I gues its time it went, but not
in quite this way.

Instead I wrote a function wich just tryParse 1 variable at a time with
given delimter and skip chars,
and wich advances the string to the next unread point. I only need int and
string so no biggy.
works like a charm as the format can change depending on what %s is anyway.

Im sure regex is realy powerful though.

Its interesting that c# is an awkward name as # is an often an illegal char
eg in wikipedia as a title.
havnt got the hang of thinking csharp yet :s

Aso I couldnt find c# in any of the .lang newsgroups ?
This thread has become purly software now,
I hope its not trying the patience of those who like to make noises
about keeping this group on topic too much.

But im probably on my way to seeing it through now anyway so thanks for you
much appreciated help :)
Theres probably a lot il not know about c# even after ive finished.

Colin =^.^=
 
J

John Barrett

colin said:
cool thanks, although my autoreset works ok but il def look at that too.
although I initialy forgot to reset the thing if I didnt have to wait
then i forgot to check to not reset it if there was more there,
id forget my head if .. oh wait ...


Yeah I saw that in a google search, scaned through about 10- pages of
stuff and thought geez
my brain is already starting to melt trying to take in new lang dev system
etc.
all i want to do is 1 line like sscanf(s,"%d:%s:%d,%d|%d,%d\n"...
I could porobably write a whole sscanf function in less time it takes to
read and digest all that.
I remember long ago it only took me a few hours to write a whole sprintf()
wich was reentrant friendly.

sscanf was realy out of place in c++ too, I gues its time it went, but not
in quite this way.

Instead I wrote a function wich just tryParse 1 variable at a time with
given delimter and skip chars,
and wich advances the string to the next unread point. I only need int and
string so no biggy.
works like a charm as the format can change depending on what %s is
anyway.

Im sure regex is realy powerful though.

Its interesting that c# is an awkward name as # is an often an illegal
char eg in wikipedia as a title.
havnt got the hang of thinking csharp yet :s

Aso I couldnt find c# in any of the .lang newsgroups ?
This thread has become purly software now,
I hope its not trying the patience of those who like to make noises
about keeping this group on topic too much.

But im probably on my way to seeing it through now anyway so thanks for
you much appreciated help :)
Theres probably a lot il not know about c# even after ive finished.

Colin =^.^=

It took me about 2 years to become really proficient, and had C++ and java
background going in -- there will always be a learning curve !!

good luck with the rest of the project !!
 
J

joseph2k

Wim said:
If you can get some example code that will write the serial results into a
delimited ASCII file, you can do a lot of processing and graphing in
Excel. Not elegant, but it saves you from learning new packages or
languages

Wim
Maybe, maybe not. It was a while ago but i knew people that did word
processing, including typesetting, in Lotus 123. They did not understand
how anyone could not see the value of doing so. Nor is everyone skilled in
driving spreadsheets to do the the things that they do well. There are
many alternatives for numerical or statistical analysis of data.
 
J

joseph2k

Oh Joy, running in full 64-bit mode the FPU with SSE2 and SSE3 64 bit
extensions can make a kick butt FFT machine, embarrass a DSP it can. There
are limitations, and step and stride issues for large datasets. Plus if
the code is not carefully hand or otherwise well optimized for x86-64 you
do not get near the performance possible.
FPU based -- no on-board DSP :)

With the stated processor agreed.
for the data transfer -- look at the System.Collections.Generic namespace
-- create a class that represents a block of FFT ready data.. have the com
port thread assemble the block, and when ready.. push the block into a
typed queue (generics are like C++ templates.. let you create collections
of typed objects with full compile time type checking)

An interesting use of the concepts found in the C++ STL and some influence
from ADA generics.
use the "lock" statement to wrap your push and pull methods so that access
to the queue is serialiized, and optionally create an event to notify the
UI code that there is a block of data ready to process. (or use a timer to
poll for data -- whatever you are comfy with) Note that C# gets pissy when
you attempt to access UI elements from a thread other than the one that
created the UI -- look at delegates and the Invoke method to work around
the issue if you need the background thread to access the UI.

Interesting, kinda X-windows like.
You might want the FFT and any other data crunching on the com thread or
even a seperate cruncher thread so the UI just has to deal with displaying
ready-to-render data.

Separate thread definitely. Partition the thing into a tool chain, much
like Pre-IDE software development became.
 
P

przemek klosowski

Hi,
I got my PIC producing 10mb data/hr,
now I need something to receive the data via bluetooth store it and do
some statistical analysis on it and display the results etc.
How about a data analysis package? There are several free ones: Octave
(matlab-compatible), R, Scilab, all have excellent statistical
toolboxes, as well as FFT, and more. Available on Windows and of course
Linux.


http://www.gnu.org/software/octave/
 
J

John Barrett

joseph2k said:
Oh Joy, running in full 64-bit mode the FPU with SSE2 and SSE3 64 bit
extensions can make a kick butt FFT machine, embarrass a DSP it can.
There
are limitations, and step and stride issues for large datasets. Plus if
the code is not carefully hand or otherwise well optimized for x86-64 you
do not get near the performance possible.


With the stated processor agreed.

An interesting use of the concepts found in the C++ STL and some influence
from ADA generics.

Interesting, kinda X-windows like.

Separate thread definitely. Partition the thing into a tool chain, much
like Pre-IDE software development became.

Ohh I agree -- nothing particularly NEW -- but 1000% more ACCESSABLE -- dont
have to jump through near as many hoops to use all these neet things as you
did with C++/STL/PThreads/etc !! which is exactly how it should be, and why
I avoided C++ after years of using it when visual basic and java became
available... I got sick and tired of having my logic obfuscated by
over-complicated interfaces to basic functionality. It is a pure joy to be
able to concentrate on the flow of the application without the hassle of
obscure low level functionality getting in the way :)
 
C

colin

John Barrett said:
It took me about 2 years to become really proficient, and had C++ and java
background going in -- there will always be a learning curve !!

good luck with the rest of the project !!

Thanks, well its coming on quite well,
in fact its been running for a day or so now and collected quite a bit of
stats,

It captures the data and records it,
and also displays all the old data and updates it with any new data

I found a 2d windows component of that site you gave a link to,
its basic but it at least gives me an indication if the processing is going
horribly wrong or not.

It interesting language, its also interesting the memory usage climbs to
100mb then drops down to 2mb !

got to about 1000 lines of code before I rewrote it,
split it into files and used structs in place of classes for the primitive
data structures,
then had to explicitly reference the functions wich would otherwise be
global in c++.
keep trying to do things wich are possible in c++ but find i cant in c#,
like i wanted to overide += for a complex struct,
but couldnt wich meant it had to waste time creating a interim struct for
the return value in -.
but it runs fast enough.

as for the data it has a standard deviation of 1000ps,
but my stat maths is a little rusty,
does averaging reduce the uncertainty in proportion to the number of samples
or the root ?
im looking for 0.1ps resolution, but averaged over a number of days.
(hopefuly not too many)

Colin =^.^=
 
Top