> Messages from the plant data driver can arrive at different rates (say
> from 200 ms up, depending on what is written in the config file) ;
> if I fire a redraw() each time I receive the bargraph level my CPU
> utilization for the graphics app goes from 4-5% to 60%,
> so I simply redraw() when the new bargraph value is different from the
> previous.

Yes, checking for differences, and only then triggering a redraw, is a useful 
optimization in most cases.

Note that it can also help to limit the refreshes even in that case - e.g. have 
an Fl_timeout that fires every so often (say 1 Hz) and triggers the redraw 
based on the latest state, "ignoring" any intermediate inputs...






Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to