Re: [Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
Yes... now i'm tryng to implement the run function so that i will send m_parent-canReadNotification(); continously. For the moment it seems to work Il 15 marzo 2012 18:05, David Ching d...@dcsoft.com ha scritto: Date: Fri, 16 Mar 2012 01:30:15 +1100 From: Tony Rietwyk t...@rightsoft.com.au Is this running on Windows? I seem to remember that the timers had the same problem - the events don't get delivered while the window is in resize mode. I never found a fix or workaround for this, and had to implement my own timers in a separate thread looping on sleep. I've experienced the same symptom (but was not able to diagnose why) using both QSerialPort and QExtSerialPort. If the window was dragged extensively, data loss would occur (characters would be unrecoverably lost). But the serial protocol had disabled any form of flow control (e.g. XON/XOFF, or hardware). So I blamed the problem on using a fragile serial protocol. Was this correct? If not, how are we supposed to use QSerialPort / QExtSerialPort reliably in a GUI app? Thanks, David ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
Hi, i have a program with : - a main thread - a serial manager thread using Qserialport i noticed that if i move the main gui the EV_RXCHAR event is not fired or cached... what's wrong? thanks, Riccardo ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
the serial port class is this one: http://www.google.it/url?sa=trct=jq=esrc=ssource=webcd=1ved=0CCwQFjAAurl=http%3A%2F%2Fgitorious.org%2Finbiza-labs%2Fqserialportei=8OhhT_vNGY6KhQeg6tieCAusg=AFQjCNF7vwKcu_dJz8y-QE6ziYhoPe4uNwsig2=adTbs9FuJPYZhrNXtnfALg it expect a EV_RXCHAR event on receiving something on the serial port so it reimplements the QWidget event function: bool WinSerialPortEngine::event(QEvent *e) { // qDebug()event e e-type(); bool ret = false; if (e-type() == QEvent::WinEventAct) { if (EV_ERR m_currentMask m_setMask) { m_parent-canErrorNotification(); ret = true; } if (EV_RXCHAR m_currentMask m_setMask) { m_parent-canReadNotification(); ret = true; } //FIXME: This is why it does not work? if (EV_TXEMPTY m_currentMask m_setMask) { m_parent-canWriteNotification(); ret = true; } } else { ret = QWinEventNotifier::event(e); } ::WaitCommEvent(m_descriptor, m_currentMask, m_ov); return ret; } the problem is that while receiving events like the QEvent::NonClientAreaMouseButtonPres on the gui thread it stop receivng EV_RXCHAR event on the serial port class Il 15 marzo 2012 12:53, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: On 15 mars 2012, at 12:37, Riccardo Roasio wrote: Hi, i have a program with : - a main thread - a serial manager thread using Qserialport i noticed that if i move the main gui the EV_RXCHAR event is not fired or cached... what's wrong? thanks, Riccardo ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest Hi, With so few information, we won't be really be able to help you. But here is a few questions: - How is your serial manager thread implemented ? (My guess: run reimplementation) - Do you have signals slots directly connected ? Hope this helps Samuel PS: Did you also read this article ? http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/ And there where a few discussions on the qt-nokia mailing list last year about threading, you might want to look for them ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
I must say, I don't understand your use of QSerialPort. You are waiting on data coming from the serial port, aren't you ? So, why not just connect to the readyRead signal ? On 15 mars 2012, at 14:07, Riccardo Roasio wrote: the serial port class is this one: http://www.google.it/url?sa=trct=jq=esrc=ssource=webcd=1ved=0CCwQFjAAurl=http%3A%2F%2Fgitorious.org%2Finbiza-labs%2Fqserialportei=8OhhT_vNGY6KhQeg6tieCAusg=AFQjCNF7vwKcu_dJz8y-QE6ziYhoPe4uNwsig2=adTbs9FuJPYZhrNXtnfALg it expect a EV_RXCHAR event on receiving something on the serial port so it reimplements the QWidget event function: bool WinSerialPortEngine::event(QEvent *e) { // qDebug()event e e-type(); bool ret = false; if (e-type() == QEvent::WinEventAct) { if (EV_ERR m_currentMask m_setMask) { m_parent-canErrorNotification(); ret = true; } if (EV_RXCHAR m_currentMask m_setMask) { m_parent-canReadNotification(); ret = true; } //FIXME: This is why it does not work? if (EV_TXEMPTY m_currentMask m_setMask) { m_parent-canWriteNotification(); ret = true; } } else { ret = QWinEventNotifier::event(e); } ::WaitCommEvent(m_descriptor, m_currentMask, m_ov); return ret; } the problem is that while receiving events like the QEvent::NonClientAreaMouseButtonPres on the gui thread it stop receivng EV_RXCHAR event on the serial port class Il 15 marzo 2012 12:53, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: On 15 mars 2012, at 12:37, Riccardo Roasio wrote: Hi, i have a program with : - a main thread - a serial manager thread using Qserialport i noticed that if i move the main gui the EV_RXCHAR event is not fired or cached... what's wrong? thanks, Riccardo ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest Hi, With so few information, we won't be really be able to help you. But here is a few questions: - How is your serial manager thread implemented ? (My guess: run reimplementation) - Do you have signals slots directly connected ? Hope this helps Samuel PS: Did you also read this article ? http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/ And there where a few discussions on the qt-nokia mailing list last year about threading, you might want to look for them ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
Sorry..so what you think i have do do? Il 15 marzo 2012 14:26, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: I must say, I don't understand your use of QSerialPort. You are waiting on data coming from the serial port, aren't you ? So, why not just connect to the readyRead signal ? On 15 mars 2012, at 14:07, Riccardo Roasio wrote: the serial port class is this one: http://www.google.it/url?sa=trct=jq=esrc=ssource=webcd=1ved=0CCwQFjAAurl=http%3A%2F%2Fgitorious.org%2Finbiza-labs%2Fqserialportei=8OhhT_vNGY6KhQeg6tieCAusg=AFQjCNF7vwKcu_dJz8y-QE6ziYhoPe4uNwsig2=adTbs9FuJPYZhrNXtnfALg it expect a EV_RXCHAR event on receiving something on the serial port so it reimplements the QWidget event function: bool WinSerialPortEngine::event(QEvent *e) { // qDebug()event e e-type(); bool ret = false; if (e-type() == QEvent::WinEventAct) { if (EV_ERR m_currentMask m_setMask) { m_parent-canErrorNotification(); ret = true; } if (EV_RXCHAR m_currentMask m_setMask) { m_parent-canReadNotification(); ret = true; } //FIXME: This is why it does not work? if (EV_TXEMPTY m_currentMask m_setMask) { m_parent-canWriteNotification(); ret = true; } } else { ret = QWinEventNotifier::event(e); } ::WaitCommEvent(m_descriptor, m_currentMask, m_ov); return ret; } the problem is that while receiving events like the QEvent::NonClientAreaMouseButtonPres on the gui thread it stop receivng EV_RXCHAR event on the serial port class Il 15 marzo 2012 12:53, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: On 15 mars 2012, at 12:37, Riccardo Roasio wrote: Hi, i have a program with : - a main thread - a serial manager thread using Qserialport i noticed that if i move the main gui the EV_RXCHAR event is not fired or cached... what's wrong? thanks, Riccardo ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest Hi, With so few information, we won't be really be able to help you. But here is a few questions: - How is your serial manager thread implemented ? (My guess: run reimplementation) - Do you have signals slots directly connected ? Hope this helps Samuel PS: Did you also read this article ? http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/ And there where a few discussions on the qt-nokia mailing list last year about threading, you might want to look for them ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
Again: use the readyRead signal ? http://qt-project.org/doc/qt-4.8/qiodevice.html#readyRead On 15 mars 2012, at 14:27, Riccardo Roasio wrote: Sorry..so what you think i have do do? Il 15 marzo 2012 14:26, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: I must say, I don't understand your use of QSerialPort. You are waiting on data coming from the serial port, aren't you ? So, why not just connect to the readyRead signal ? On 15 mars 2012, at 14:07, Riccardo Roasio wrote: the serial port class is this one: http://www.google.it/url?sa=trct=jq=esrc=ssource=webcd=1ved=0CCwQFjAAurl=http%3A%2F%2Fgitorious.org%2Finbiza-labs%2Fqserialportei=8OhhT_vNGY6KhQeg6tieCAusg=AFQjCNF7vwKcu_dJz8y-QE6ziYhoPe4uNwsig2=adTbs9FuJPYZhrNXtnfALg it expect a EV_RXCHAR event on receiving something on the serial port so it reimplements the QWidget event function: bool WinSerialPortEngine::event(QEvent *e) { // qDebug()event e e-type(); bool ret = false; if (e-type() == QEvent::WinEventAct) { if (EV_ERR m_currentMask m_setMask) { m_parent-canErrorNotification(); ret = true; } if (EV_RXCHAR m_currentMask m_setMask) { m_parent-canReadNotification(); ret = true; } //FIXME: This is why it does not work? if (EV_TXEMPTY m_currentMask m_setMask) { m_parent-canWriteNotification(); ret = true; } } else { ret = QWinEventNotifier::event(e); } ::WaitCommEvent(m_descriptor, m_currentMask, m_ov); return ret; } the problem is that while receiving events like the QEvent::NonClientAreaMouseButtonPres on the gui thread it stop receivng EV_RXCHAR event on the serial port class Il 15 marzo 2012 12:53, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: On 15 mars 2012, at 12:37, Riccardo Roasio wrote: Hi, i have a program with : - a main thread - a serial manager thread using Qserialport i noticed that if i move the main gui the EV_RXCHAR event is not fired or cached... what's wrong? thanks, Riccardo ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest Hi, With so few information, we won't be really be able to help you. But here is a few questions: - How is your serial manager thread implemented ? (My guess: run reimplementation) - Do you have signals slots directly connected ? Hope this helps Samuel PS: Did you also read this article ? http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/ And there where a few discussions on the qt-nokia mailing list last year about threading, you might want to look for them ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
Hi Riccardo, Is this running on Windows? I seem to remember that the timers had the same problem - the events don't get delivered while the window is in resize mode. I never found a fix or workaround for this, and had to implement my own timers in a separate thread looping on sleep. Hope that helps, Tony. Sent: Friday, 16 March 2012 12:45 AM Again: use the readyRead signal ? http://qt-project.org/doc/qt-4.8/qiodevice.html#readyRead On 15 mars 2012, at 14:27, Riccardo Roasio wrote: Sorry..so what you think i have do do? Il 15 marzo 2012 14:26, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: I must say, I don't understand your use of QSerialPort. You are waiting on data coming from the serial port, aren't you ? So, why not just connect to the readyRead signal ? On 15 mars 2012, at 14:07, Riccardo Roasio wrote: the serial port class is this one: http://www.google.it/url?sa=trct=jq=esrc=ssource=webcd=1ved= 0C CwQFjAAurl=http%3A%2F%2Fgitorious.org%2Finbiza- labs%2Fqserialporte i=8OhhT_vNGY6KhQeg6tieCAusg=AFQjCNF7vwKcu_dJz8y- QE6ziYhoPe4uNwsig2 =adTbs9FuJPYZhrNXtnfALg it expect a EV_RXCHAR event on receiving something on the serial port so it reimplements the QWidget event function: bool WinSerialPortEngine::event(QEvent *e) { // qDebug()event e e-type(); bool ret = false; if (e-type() == QEvent::WinEventAct) { if (EV_ERR m_currentMask m_setMask) { m_parent-canErrorNotification(); ret = true; } if (EV_RXCHAR m_currentMask m_setMask) { m_parent-canReadNotification(); ret = true; } //FIXME: This is why it does not work? if (EV_TXEMPTY m_currentMask m_setMask) { m_parent-canWriteNotification(); ret = true; } } else { ret = QWinEventNotifier::event(e); } ::WaitCommEvent(m_descriptor, m_currentMask, m_ov); return ret; } the problem is that while receiving events like the QEvent::NonClientAreaMouseButtonPres on the gui thread it stop receivng EV_RXCHAR event on the serial port class Il 15 marzo 2012 12:53, Samuel Gaist samuel.ga...@edeltech.ch ha scritto: On 15 mars 2012, at 12:37, Riccardo Roasio wrote: Hi, i have a program with : - a main thread - a serial manager thread using Qserialport i noticed that if i move the main gui the EV_RXCHAR event is not fired or cached... what's wrong? thanks, Riccardo ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest Hi, With so few information, we won't be really be able to help you. But here is a few questions: - How is your serial manager thread implemented ? (My guess: run reimplementation) - Do you have signals slots directly connected ? Hope this helps Samuel PS: Did you also read this article ? http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/ And there where a few discussions on the qt-nokia mailing list last year about threading, you might want to look for them ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] QSerialport EV_RXCHAR not emitted or catched while moving window
Date: Fri, 16 Mar 2012 01:30:15 +1100 From: Tony Rietwyk t...@rightsoft.com.au Is this running on Windows? I seem to remember that the timers had the same problem - the events don't get delivered while the window is in resize mode. I never found a fix or workaround for this, and had to implement my own timers in a separate thread looping on sleep. I've experienced the same symptom (but was not able to diagnose why) using both QSerialPort and QExtSerialPort. If the window was dragged extensively, data loss would occur (characters would be unrecoverably lost). But the serial protocol had disabled any form of flow control (e.g. XON/XOFF, or hardware). So I blamed the problem on using a fragile serial protocol. Was this correct? If not, how are we supposed to use QSerialPort / QExtSerialPort reliably in a GUI app? Thanks, David ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest