Need advise about an application
stef.mientki at gmail.com
Sun Apr 5 19:23:27 CEST 2009
> I am currently working on an application and I need a advise.
> I am supposed to read data from a device connected to a serial port. I
> am reading data using pySerial. The devise is sending signals with a
> time between two signals of one second.
> The application is supposed to collect the data and put it into a
> sqlite DB. wxPython GUI.
> I am worried about this asspect that I have two solutions how to do it
> but as I never tried it I wanted to ask for advise which one should be
> solution 1):
> The GUI is set into a separate thread then the part of collecting and
> saving data. Well one thread for getting signals and saving data and
> the other for GUI and data presentation
> solution 2):
> create an event which is binded to pySerial read methon. Well when the
> devise sends a signal the event function is triggered.
> Or maybe combine the two?
I think the easiest method is to use a timer (100 ms interval),
let the timer-completion check if new data from serial available, etc.
I use this method with far larger throughputs ( 10k bytes / sec)
and it works very good.
More information about the Python-list