PDA

View Full Version : Signals don't work



Calypoter
3rd January 2012, 13:11
I have an application with a lot of signals in it. On my development computer everything works perfect. But when I copy the application to the production pc the signals stop working.

I use QExtSerialPort for serial communication with sms modems. The problem with the signals is only when there are some threads using the QExtSerialPort library.

Is this a bug in qt?

Cruz
4th January 2012, 09:02
It's most definitely not a bug in Qt. Hope that helps.

Calypoter
4th January 2012, 09:19
If it isn't a bug, what is it then? What could it be that the signals are working on my development pc but not on the production pc. The production pc is a server with win 2003 server. Is that a problem with qt?

Lesiok
4th January 2012, 10:04
We are working on Win 2003 server and signals are working perfectly. Maybe You should show us some code.

Calypoter
4th January 2012, 10:25
The code is really complex to show. I'm working on it for 3 months full time.

I have a page and a thread. The thread collects data from a database and signal is to the page. When all is collected is signals the page that it may show the data.
It works perfect on both pc's.

In the same application I have also some threads that uses QExtSerialPort for serial communications. I can start and stop those threads from within the application. When I start the app with no threads everything works but when I activate some of the threads the signals stop working. I'm now trying to rewrite the serial communication code so I don't need QExtSerialPort any more. I hope it will fix the problem.

Cruz
4th January 2012, 11:21
If I understand correctly, only the app and the database thread work correctly, but app + database thread + serial port thread are so broken, that not even the database thread signals are delivered?

If this is true, then from the information you gave I would assume that you initiate a serial port communication from the GUI thread by mistake and it hangs, such that no events are handled and no signals are received anymore. On one of the machines the serial port settings are different (the port number?) such that the communication is not successful so that's why it could hang.

Try some more thorough debugging and problem analysis before you recode everything. Try reducing your code to a minimal structure and find a point where everything works and then add functionality piece by piece until it breaks. This way you can also generate more showable code and might get better help from the forum.

Lesiok
4th January 2012, 11:58
Good news : we are using QExtSerialPort in another thread and it is working on Windows 2003 server too :)

Calypoter
5th January 2012, 09:44
Good news : we are using QExtSerialPort in another thread and it is working on Windows 2003 server too :)

Do you create the serialport in the constuctor or in the run?
I create it in the constructor and get the data in the run.

Added after 14 minutes:

I think I found the problem. QExtSerialPort was using EventDriven and I changed it to Polling and now everything works.

Lesiok
5th January 2012, 15:51
Serialport is created in constructor. And we are using event driven mode.
What version of QExtSerialPort You have ?

Calypoter
6th January 2012, 07:23
I use version 1.2

Lesiok
8th January 2012, 08:20
We are using 1.1