Real Time Graph

J

jsscshaw88

Hi,

I am a newbie and trying to plot a real time X Y plot in java. I am using Net Beans IDE7.2. Data has been sampled at the rate of 250 Samples per second. It looks like as follows

http://img402.imageshack.us/img402/4927/plotqe.png

Data will be coming into the computer over bluetooth but right now I am trying to read and plot the file. The file can be found at the following link

https://hotfile.com/dl/185255400/ea220f1/packetr.dat.html

You can better view this file in Hex Editor like HxD from wwww.mh-nexus.de.

I do not know how many samples are in the file. But Data sample is 32 bytes long (from byte 13 to byte 44). This Data is the part of a 46 byte Frame.

It will be a square wave of 1Hz, if we plot the data. It will be like 2 to 4 sec long wave form.

I tried to work with the following Code to do this

1. http://audio-analysis.googlecode.co...adlogic/audio/samples/part4/RealTimePlot.java

2. http://www.sharewareconnection.com/livegraph-2-0-beta01.htm


But no sucess. I was not even able to run these above mentioned codes.

Please advise!

jess
 
R

Roedy Green

I am a newbie and trying to plot a real time
X Y plot in java. I am using Net Beans IDE7.2.
Data has been sampled at the rate of 250 Samples
per second. It looks like as follows

You will sent up a Swing Timer to trigger repaints. see
http://mindprod.com/jgloss/timer.html

You will paint with the draw* methods on a JPanel.
see http://mindprod.com/jgloss/jpanel.html

You will best use a VolatileImage. On each repaint, you block move to
scroll, then freshly generate the new tail. see
http://mindprod.com/jgloss/jgloss/volatileimage.html

you can put it in a tight loop by calling repaint at the end of your
PaintComponents method.
 
J

jsscshaw88

Hi Guys,

Its not a school home work. As you can see in the original post that the data is coming over wirless bluetooth.

I designed and made a bluetooth device and I am trying to write a high level software to obtain the data over bluetooth and display it on the screen and store it on the computer.

jess
 
J

jlp

Le 20/12/2012 17:33, (e-mail address removed) a écrit :
Hi Guys,

Its not a school home work. As you can see in the original post that the data is coming over wirless bluetooth.

I designed and made a bluetooth device and I am trying to write a high level software to obtain the data over bluetooth and display it on the screen and store it on the computer.

jess
Did you take a look at JFreeChart?
http://www.jfree.org/jfreechart/
You can treat "TimeSeries" with a slightly delayed time ( not in real time)
 
L

Lew

I will appricate, if you give me some steps to work with "jfreechart".
Like how can I make it integrate with my java [sic] code and how can i [sic]
make it read the format of my file that I did post on the following link

httq://yeah, right, we're going to follow your link. Sheesh.

Here you go:
 
J

John B. Matthews

I will appricate, if you give me some steps to work with "jfreechart".

This Q&A shows two approaches to displaying the incoming data:

<http://stackoverflow.com/q/5048852/230513>.

This Q&A illustrates updating a chart's model from a background thread:

Like how can I make it integrate with my java code and how can i make
it read the format of my file that I did post on the following link

https://hotfile.com/dl/185255400/ea220f1/packetr.dat.html

Rather than ask readers to divine the format, you might describe it in
terms of a minimal sample.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top