Serial port acquisition thread gets slow when focused Qwidget in Qt

48 views Asked by At

I have a problem with signal acquisition. I have a class called rawdataprovider that is responsible for acquiring data from the serial port. This class is in a thread with the highest priority, and every 25 ms it extracts the data from serial port, through the QExtSerialPort class. While only that is done, the program works correctly, that is, every 25ms the data is extracted from the serial port and sent to the class in charge of managing them. The problem starts when I navigate through the interface, particularly when I move through the Qwidget of the main interface. The processing associated with focusing a Qwidget and painting a frame on it, makes the signal that should be sent every 25 ms to extract the data from the serial port be delayed. Any ideas to solve this problem?

I find it difficult to understand that the simple fact of focusing a Qwidget delays so much a thread. I have tried other ways to extract data from the serial port. I tried to connect the readyRead () signal, which is sent when there is data available on the serial port, with the method responsible for processing the data, but the same problem occurs.

0

There are 0 answers