[futurebasic] Re: [FB] continuous display of serial data

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2009 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Fri, 30 Jan 2009 05:56:23 -0500
Luciano, if doing a lot of plotting/printing in a short time period,  
you may wish to only update using FlushWindowBuffer every few lines,  
otherwise it can (depending on situation) slow down the reporting  
when there are a lot of characters or lines being plotted (as with  
serial work) OS X has double buffered windows as you likely know and  
the time they take to flush can add up...Flushwindowbuffer dumps the  
whole window buffer, not just the new line.

I think RP has done some optimizing as to that at some point ?  
(QDAddToDirtyRgn?) Some similar something. Long time ago. :)

//Cheap method

dim pCnt as int

pCnt = 0  // init somewhere

// Somewhere in some plot loop

pCnt++   // increment each plotted

if pCnt > 5 then FlushWindowBuffer : pCnt = 0 // flush and reset


On Jan 30, 2009, at 5:28 AM, luciano bernardi wrote:

> Ciao Michele!
> I am glad you did not test the serial program because in adapting  
> from the
> larger program I've made a couple of stupid mistakes.
> Here it is the amended copy.
> And now with  FLUSHWINDOWBUFFER .....IT WORKS!!!!
> Thank you so much!
> Luciano
> On 30-01-2009 10:21, Michele Neri, nerimic@... wrote:
>> Ciao Luciano,
>> I can't test with actual serial input at this time but I believe that
>> it's just a problem of refresh in the output window.
>> Have you tried to flush the window buffer after the plot statement?
>> ...
>> plot x0% + (x%-1), y0% + (200-yold%) to x0%+ x%, y0% + (200-ynew% )
>> next x%
>> Michele.
>> luciano bernardi ha scritto:
>>> ...
>>> The problem I have now is to be able to “continuously” display the
>>> data coming from an external device. The sample program I have
>>> attached (adapted from a larger one) works well and reliably, but it
>>> displays the data ONLY when all the 400 data had been received
>>> (whereas I need to see them continuously, one after the other).
>>> ...
>>> Can someone give me a suggestion?
>>> Many thanks
>>> Luciano Bernardi