[Lazarus] Fastest way to draw

Brad Campbell brad at wasp.net.au
Sat May 22 09:46:11 CEST 2010


Felipe Monteiro de Carvalho wrote:
> Hello,
> 
> On Fri, May 21, 2010 at 3:30 PM, Brad Campbell <brad at wasp.net.au> wrote:
>> I'm experimenting with an Oscilloscope at the moment.
> 
> Are you implementing the hardware too?

Just the firmware. I'm using the Parallax PropScope. 25M samples/sec. 2 Channels of 10 bit and 4 
bits of Logic input.

http://www.parallax.com/Store/Microcontrollers/PropellerTools/tabid/143/ProductID/586/List/0/Default.aspx?SortField=ProductName,ProductName

>> So there are _lots_ of little fiddly bits to draw (about 1200 line segments
>> per refresh).
>>
>> There has to be a faster way to get data to the screen in a cross-platform
>> fashion (I'm developing on Linux but ultimately I'll be compiled for OSX and
>> Win32).
> 
> In my 2nd year of university my group built built an osciloscope with
> a GUI written in Lazarus and the hardware being an ISA Board .

This is a USB device with an FTDI converter built in. I've managed nice comms at about 960k baud and 
I've implemented the comms in another thread to get around polling and other issues. I can get the 
packets in _far_ faster than I can draw them currently.

I want to refresh the display 30-40 times a second to keep up with the possible sweep rates, at the 
moment I can manage between 4 & 10 depending on the number of samples I'm taking per sweep. At 500 
samples/sweep at the moment I'm sampling over 3 times faster than I can draw. At 6000 samples / 
sweep I can draw a the same rate I sample (~4Hz).

When I get the drawing code fast enough I'll post a solution. I've just ordered a nice slow PPC Mac 
to experiment with, which should make it much easier to benchmark drawing speed.

Brad
-- 
Dolphins are so intelligent that within a few weeks they can
train Americans to stand at the edge of the pool and throw them
fish.




More information about the Lazarus mailing list