testrealtime update rate
"Brian Phelps" <[email protected]> Thu, 5 Jul 2007 10:48:16 -0400
| Newsgroups | gmane.comp.scigraphica.gtkextra |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I am using modified code from testrealtime.c and I am having a problem
getting it to update quickly. It seems as though when I set the
gtk_timeout_add to anything below 100, it makes no difference in screen
refresh rates.
I would just like to refresh the data points every 30ms. It seems the
gtk_plot_canvas_paint(GTK_PLOT_CANVAS(canvas)); is the speed culprit, but
without it my graph just redraws itself on top of the previous one. Is there
a quicker way to get rid of the old plot and redraw to achieve a higher
rate? My modified update code is:
(my px/py data is created in another function as px=1..20 and py is all
0's. I am just making one point grow for test purposes)
gint
update(gpointer data)
{
GtkPlot *plot;
gdouble x, y;
gdouble xmin, xmax;
plot = GTK_PLOT(data);
py[10]+=.01;
gtk_plot_data_set_numpoints(dataset, 20);
gtk_plot_data_set_x(dataset, px);
gtk_plot_data_set_y(dataset, py);
gtk_plot_canvas_paint(GTK_PLOT_CANVAS(canvas));
gtk_plot_refresh(plot, NULL);
return TRUE;
}
--
Got e-? http://electronjunkie.wordpress.com
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Scigraphica-gtkextra mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scigraphica-gtkextra