RE: [gtk-list] Re: Drawing application



> Hi,
> 
> The code for reading the values given by the sensor was 
> written in C, before i
> started on gtk.
> It just reads a value from a digital oscilloscope, through 
> the PC serial port,
> and stores it in a float variable.
> Anyway, how do i set the function priority?
> Perhaps i should use GtkPlot, as suggested by Adrian Feiguin. Thanks,
> Nilton

GtkPlot is sure worth looking at (it has some really nice features).

But... how do you retrieve the variable? are you waiting for one to come (busy waiting) or are you leaving the waiting to GDK?
GDK has some really nice features for recieving data. You can use gdk_input_add (dunno the parameters,you should give a callback anyway) to add a device. This gives you a file descriptor that can be used to close the input. The data will be delivert, an event will be triggered and voila...

I used it to create a very simple terminal for my 68HC11 microcontroler (minicom is still to complex for that) on the serial port.

regards,

Arjan

> "Arjan J. Molenaar" wrote:
> 
> > >
> > > Hello,
> >
> > Hi,
> >
> > > I'm writing an application for magnetic field mapping. I'd
> > > like to know
> > > if there is some way of stopping a background callback and
> > > then plotting
> > > some points on a pixmap on a drawing area. My code reads 
> a value given
> > > by a sensor, and is then supposed to plot it on the pixmap. But it
> > > doesn't. It only plots an array of points sometime later 
> or when the
> > > mapping is done.
> > >
> >
> > It's hard to see what you mean... So you have the sensor 
> connected using
> > gdk_input? If so, you can give that function a lower 
> priority. (Drawing
> > has a high priority by default IIRC.)
> > You could also trigger a sensor-read on a timeout.
> >
> > Hope this helps...
> >
> > regards,
> >
> > Arjan
> >
> > --
> > To unsubscribe: mail -s unsubscribe 
> gtk-list-request@redhat.com < /dev/null
> 
> -- 
> To unsubscribe: mail -s unsubscribe 
> gtk-list-request@redhat.com < /dev/null
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]