GUI freezes while wxThread is reading serial port

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Rotlaus
In need of some credit
In need of some credit
Posts: 7
Joined: Sat Mar 18, 2006 3:13 pm

GUI freezes while wxThread is reading serial port

Post by Rotlaus » Tue May 19, 2009 9:41 am

My GUI kind of freezes while i'm reading from the serial device and write that data to a database. What i have done so far:

I have a Main Class which creates a Database Class and a Communication Class which is a wxThread. When the Communication Class has read some data from the serial port it fires an event which get caught in the MainClass. After some further processing the data is handled to the DatabaseClass via a normal function call. When the Database has written the data to the database it fires an event itself, notifying of new procesed Data available. This again is handled by the Main Class which now updates the GUI. This works as excepted, but user input into the GUI is ignored, say any Mouseclick is ignored. I can't select any Meny or change the selection on the Gui.

What am i doing wrong?

Kind regards,

Andre

Romas
I live to help wx-kind
I live to help wx-kind
Posts: 176
Joined: Mon Jun 16, 2008 11:07 am
Location: Kaunas

Post by Romas » Tue May 19, 2009 2:40 pm

Hello,

I simple source would be much better than words :)

mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Post by mc2r » Tue May 19, 2009 3:09 pm

Like Romas said you're going to need to post some code. From your description of the problem I'd hazard a guess that it's a lot of code in regards to posting on a forum. What you want to do is start removing stuff until you have the minimal code needed to reproduce this. Chances are in trying to find the minimal code you'll find what's causing your problem.

-Max

Kraymer
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Feb 04, 2009 1:32 pm
Location: Germany
Contact:

Post by Kraymer » Wed May 20, 2009 10:52 am

Are you using AddPendingEvent() in your Entry() routine? I think that should go smoothly (in comparison to e.g. ProcessEvent() ). Of course, like already mentioned, it's hard to say without any code.

Post Reply