4D SYSTEMS FORUM
New Posts
 
 
 


Reply
 
Author Comment
 
air1kdf

Registered: 02/07/08
Posts: 9
 #1 

I'm using a 32028-P1T. What is the best way to do a scrolling graph? Are there any examples?

Initially I was going to do SGC mode, but now I realize that I can have it all (the display handle everything visual, while my PIC processor can handle all the IO and other stuff) I'm a windows programmer, so BitBLT comes to my mind first. So I tried the serial copypaste command, but was very disappointed with the performance. I would like to essentially update the whole screen at least 10x/second.

I was going to copypaste, copy from uSD to screen (about 6 pixels wide), and line from the previous point to the new point.

So my next thoughts are clear the screen, paint horizontal lines, paint the graph.

-or-

use the poly line to paint, and clear, then somehow shift all the arrays values, paint the now missing horizontal lines, and the new poly line.

I hope this makes sense, but this is 3 ways that I can think of to do the same thing. I really need fast as the graph will probably be 200x320 in size. How are the Blood Pressure monitors programmed that I see?

kaddrison

Registered: 30/01/10
Posts: 368
 #2 
set a pixel (keep the values in an array) for how many you want - say 30

so set the first 30 clear 1 set 31 clear 2 set 32 etc - if you check if its a graph line before you clear it and only clear if it is not - should be quick

air1kdf

Registered: 02/07/08
Posts: 9
 #3 
I'm using lines instead of pixels because it looks way better with fast vertical moving data. Also the graph needs about a 50 dimensioned array (50 * 6 = 300 pixels). If I understand the reply, there is a way to add and delete elements of the array. Eventually it would run out of space though wouldn't it?

Is there a way to shift all elements rapidly in the array?
meldavia

Registered: 18/03/07
Posts: 900
 #4 
If you are just showing a line graph, the easiest way would be to use gfx_Polyline and an array of points for the graph. Then for a non flicker display, its easiest to draw the polyline in the desired colour, wait say 20msec, redraw the polyline in the background colour to erase it, then update the polyline array with the new points and repeat the process.
BTW dont 'shift' the array, just update it with the new info...
air1kdf

Registered: 02/07/08
Posts: 9
 #5 
OK, option 3. I think that I'm still missing something though. You say just update the array. Are you meaning to say. Polyline with 50 elements, then add to the end if the array with the single new value, then polyline 1 to 50, then 2 to 51? At what point does the 0 contain the new value?
meldavia

Registered: 18/03/07
Posts: 900
 #6 
Actually we were just discussing similar requirements along these lines, might be worth having a look here to shed a bit more light on the subject:-

http://4d.websitetoolbox.com/post?id=4800545&pid=41061455#post41061455


air1kdf

Registered: 02/07/08
Posts: 9
 #7 
I'm over 50 frames per second now. I used 2 buffers, wrote to each at an offset location, used 2 pointers, and alternated which buffer I used for many samples each. Simple concept, but the code will give you a headache. Still working out the bugs. Requires 4x the memory.
meldavia

Registered: 18/03/07
Posts: 900
 #8 
Wow that sounds great, please keep us posted on on your method
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Powered by Website Toolbox - Create a Website Forum Hosting, Guestbook Hosting, or Website Chat Room for your website.