Re: [Interest] Parsing data from serialport

2019-04-21 Thread Roland Hughes
On Monday April 8 22:59:23 CEST 2019 Martin Marmsoler wrote: >What is, when I ignore the ready read? Has the internal buffer a max size? >Because at the moment I have a memory leak and maybe it comes from that? Martin, Sorry to take so long in responding but this was going to be a long post a

Re: [Interest] Parsing data from serialport

2019-04-08 Thread Martin Marmsoler
Thank you Andre for the fast response. Ok than I found the problem, why the program need so much RAM 😂 Am Di., 9. Apr. 2019 um 08:21 Uhr schrieb Andre Hartmann < andre.hartm...@iseg-hv.de>: > Hi Martin, > > > What is, when I ignore the ready read? > > The data will stay in the buffer, of course.

Re: [Interest] Parsing data from serialport

2019-04-08 Thread Andre Hartmann
Hi Martin, What is, when I ignore the ready read? The data will stay in the buffer, of course. Has the internal buffer a max size? Your RAM or 2^32, whichever is lower. Because at the moment I have a memory leak and maybe it comes from that? I doubt that. A leak would mean, you cannot

Re: [Interest] Parsing data from serialport

2019-04-08 Thread Martin Marmsoler
What is, when I ignore the ready read? Has the internal buffer a max size? Because at the moment I have a memory leak and maybe it comes from that? Martin Am Fr., 5. Apr. 2019 um 21:12 Uhr schrieb Konstantin Shegunov < kshegu...@gmail.com>: > On Thu, Apr 4, 2019 at 6:42 PM Jérôme Godbout wrote:

Re: [Interest] Parsing data from serialport

2019-04-05 Thread Konstantin Shegunov
On Thu, Apr 4, 2019 at 6:42 PM Jérôme Godbout wrote: > You jus did the same loop into your slot, the function I did made can be > called as slot to the connect you just told, I agree the > serial_port->waitForReadyRead(5); is not necessary, just often the > transmission have partial or bunch of d

Re: [Interest] Parsing data from serialport

2019-04-05 Thread Konstantin Shegunov
On Thu, Apr 4, 2019 at 9:37 PM wrote: > Try testing them with a million+ row table. > Been there, done that. Be a lamb and stop with the nonsense. I'm sure you run every file operation in a dedicated thread, 'cause you'd *"never ever ever do I/O in the main GUI thread of a Qt application" ...* W

Re: [Interest] Parsing data from serialport

2019-04-05 Thread Jason H
Sent: Friday, April 05, 2019 at 5:45 AM From: "Denis Shienkov" To: rol...@logikalsolutions.com Cc: h...@gmx.com, interest@qt-project.org Subject: Re: [Interest] Parsing data from serialport > Never ever ever do I/O in the main GUI thread of a Qt application.   Why not? I

Re: [Interest] Parsing data from serialport

2019-04-05 Thread Denis Shienkov
> Never ever ever do I/O in the main GUI thread of a Qt application. Why not? It is an asynchronous. You can do I/O in a main thread, but handle data in a separate thread (e.g. to parse it). Of course, it depends on the used communication protocol and etc. A main limitation is that on Windows all

Re: [Interest] Parsing data from serialport

2019-04-05 Thread roland
Quoting interest-requ...@qt-project.org: I think the point is that there's little reason to poll the serial port if you can react to the event. Exactly what you'd do if you had a network socket. Qt already does the heavy lifting for you, so you only need to react to the signal and read as much

Re: [Interest] Parsing data from serialport

2019-04-04 Thread Jérôme Godbout
ich is not always the case. From: Konstantin Shegunov Sent: April 4, 2019 11:19 AM To: Jérôme Godbout Cc: Paolo Angelelli ; interest@qt-project.org Subject: Re: [Interest] Parsing data from serialport On Thu, Apr 4, 2019 at 5:46 PM Jérôme Godbout mailto:godbo...@amotus.ca>> wrote: It r

Re: [Interest] Parsing data from serialport

2019-04-04 Thread Konstantin Shegunov
er things, this might be bad for application reactivity, depending on > the amount of data flowing. > > -Original Message- > From: Interest On Behalf Of Paolo > Angelelli > Sent: April 4, 2019 10:19 AM > To: interest@qt-project.org > Subject: Re: [Interest] Parsing data fr

Re: [Interest] Parsing data from serialport

2019-04-04 Thread Jason H
Maybe you don't need another thread, just maybe an event loop (QEventLoop)? > Sent: Thursday, April 04, 2019 at 10:43 AM > From: "Jérôme Godbout" > To: "Paolo Angelelli" , "interest@qt-project.org" > > Subject: Re: [Interest] Parsing data

Re: [Interest] Parsing data from serialport

2019-04-04 Thread Jérôme Godbout
owing. -Original Message- From: Interest On Behalf Of Paolo Angelelli Sent: April 4, 2019 10:19 AM To: interest@qt-project.org Subject: Re: [Interest] Parsing data from serialport What is the advantage of having such a continuous reading loop in a separate thread? I mean it as opposed to reacti

Re: [Interest] Parsing data from serialport

2019-04-04 Thread Paolo Angelelli
o whatever you need with your line, check data integrity > > // Remove the processed data but leave the unprocessed data alone > buffer.remove(0, pos + 1); // Remove \n too > pos = buffer.indexOf(‘\n’); >} > } > > From: Interest On Behalf Of Martin Marmsole

Re: [Interest] Parsing data from serialport

2019-04-03 Thread Martin Marmsoler
gt; > > > *From:* Martin Marmsoler > *Sent:* April 3, 2019 3:49 AM > *To:* Jérôme Godbout > *Cc:* Thiago Macieira ; interest@qt-project.org > *Subject:* Re: [Interest] Parsing data from serialport > > > > But why I need a new buffer when there already one exist? (t

Re: [Interest] Parsing data from serialport

2019-04-03 Thread Roland Hughes
You probably want to read as far as I got with this series. http://www.logikalsolutions.com/wordpress/information-technology/how-far-weve-come-pt-1/ Be sure to pull down the code for the various SerialKeypad implementations. Here is a direct link to one of the zip files which was posted in case

Re: [Interest] Parsing data from serialport

2019-04-03 Thread Jérôme Godbout
bout Cc: Thiago Macieira ; interest@qt-project.org Subject: Re: [Interest] Parsing data from serialport But why I need a new buffer when there already one exist? (the QIODevice and my own buffer or?) My idea: Main() { Connect(readyread, myreadyread) } myreadyread() { If (!canreadline())

Re: [Interest] Parsing data from serialport

2019-04-03 Thread Martin Marmsoler
> > > > // Remove the processed data but leave the unprocessed data alone > > buffer.remove(0, pos + 1); // Remove \n too > > pos = buffer.indexOf(‘\n’); > > } > > } > > > > *From:* Interest *On Behalf Of *Martin > Marmsoler > *Sent:* April 2,

Re: [Interest] Parsing data from serialport

2019-04-02 Thread Jérôme Godbout
d data alone buffer.remove(0, pos + 1); // Remove \n too pos = buffer.indexOf(‘\n’); } } From: Interest On Behalf Of Martin Marmsoler Sent: April 2, 2019 3:58 PM To: Thiago Macieira Cc: interest@qt-project.org Subject: Re: [Interest] Parsing data from serialport > To be able to rol

Re: [Interest] Parsing data from serialport

2019-04-02 Thread Martin Marmsoler
> To be able to roll back, in case your reading from the device didn't result in what you wanted or you got an error. See QDataStream. Ah ok I understand. So this minimal example QSerialPort sPort; sPort.open(QIODevice::ReadOnly); if(sPort.waitForReadyRead(2000)){ while (!device.atEnd()) {

Re: [Interest] Parsing data from serialport

2019-04-02 Thread Thiago Macieira
On Tuesday, 2 April 2019 07:04:03 PDT Martin Marmsoler wrote: > Thank you Thiago for your response. But what is transactionstart for? To be able to roll back, in case your reading from the device didn't result in what you wanted or you got an error. See QDataStream. -- Thiago Macieira - thiago.

Re: [Interest] Parsing data from serialport

2019-04-02 Thread Martin Marmsoler
Thank you Thiago for your response. But what is transactionstart for? Best regards, Martin Thiago Macieira schrieb am Mo., 1. Apr. 2019, 09:03: > On Sunday, 31 March 2019 21:48:30 CEST Martin Marmsoler wrote: > > But as I understand I have to use startTransaction, because otherwise the > > b

Re: [Interest] Parsing data from serialport

2019-04-02 Thread Marian Beermann
Why not use QIODevice::readyRead signal and check if a complete line can be read in the slot? -Marian Am 31.03.19 um 21:48 schrieb Martin Marmsoler: > Hello, > > I'm trying to implement a serial connection with QIODevice (SerialPort). > I would like to parse line by line (each line consists of m

Re: [Interest] Parsing data from serialport

2019-04-02 Thread Zielinski, Mariusz UTC CCS
[mailto:martin.marmso...@gmail.com] Sent: 31 marca 2019 23:49 To: interest@qt-project.org Subject: [Interest] Parsing data from serialport Hello, I'm trying to implement a serial connection with QIODevice (SerialPort). I would like to parse line by line (each line consists of multiple columns of

Re: [Interest] Parsing data from serialport

2019-04-01 Thread Thiago Macieira
On Sunday, 31 March 2019 21:48:30 CEST Martin Marmsoler wrote: > But as I understand I have to use startTransaction, because otherwise the > buffer will not be used. I'm I correct? No, you're not. You're using the buffer if you opened the device in buffered mode, which you did if you did not pas

[Interest] Parsing data from serialport

2019-03-31 Thread Martin Marmsoler
Hello, I'm trying to implement a serial connection with QIODevice (SerialPort). I would like to parse line by line (each line consists of multiple columns of data) and for this I found canReadLine(). But as I understand I have to use startTransaction, because otherwise the buffer will not be used.