Re: Parsing a serial stream too slowly

2012-01-24 Thread Thomas Rachel
Am 24.01.2012 00:13 schrieb Thomas Rachel: [sorry, my Thunderbird kills the indentation] And finally, you can make use of re.finditer() resp. sensorre.finditer(). So you can do sensorre = re.compile(r'\$(.)(.*?)\$') # note the change theonebuffer = '$A1234$$B-10$$C987$' # for now sensorresult

Re: Parsing a serial stream too slowly

2012-01-24 Thread Ulrich Eckhardt
Am 23.01.2012 22:48, schrieb M.Pekala: I think that regex is too slow for this operation, but I'm uncertain of another method in python that could be faster. A little help would be appreciated. Regardless of the outcome here, I would say that your code is still a bit wonky on the handling of p

Re: Parsing a serial stream too slowly

2012-01-24 Thread Cameron Simpson
On 24Jan2012 05:08, Steven D'Aprano wrote: | On Tue, 24 Jan 2012 10:49:41 +1100, Cameron Simpson wrote: | | > | def OnSerialRead(self, event): | > | text = event.data | > | self.sensorabuffer = self.sensorabuffer + text | > | self.sensorbbuffer = self.sensorbbuffer + text | > | self.se

Re: Parsing a serial stream too slowly

2012-01-23 Thread Steven D'Aprano
On Tue, 24 Jan 2012 10:49:41 +1100, Cameron Simpson wrote: > | def OnSerialRead(self, event): > | text = event.data > | self.sensorabuffer = self.sensorabuffer + text > | self.sensorbbuffer = self.sensorbbuffer + text > | self.sensorcbuffer = self.sensorcbuffer + text > > Slow a

Re: Parsing a serial stream too slowly

2012-01-23 Thread M.Pekala
On Jan 23, 6:49 pm, Cameron Simpson wrote: > On 23Jan2012 13:48, M.Pekala wrote: > | Hello, I am having some trouble with a serial stream on a project I am > | working on. I have an external board that is attached to a set of > | sensors. The board polls the sensors, filters them, formats the > |

Re: Parsing a serial stream too slowly

2012-01-23 Thread Cameron Simpson
On 23Jan2012 13:48, M.Pekala wrote: | Hello, I am having some trouble with a serial stream on a project I am | working on. I have an external board that is attached to a set of | sensors. The board polls the sensors, filters them, formats the | values, and sends the formatted values over a serial

Re: Parsing a serial stream too slowly

2012-01-23 Thread Nick Dokos
M.Pekala wrote: > On Jan 23, 5:00 pm, Jon Clements wrote: > > On Jan 23, 9:48 pm, "M.Pekala" wrote: > > > > > > > > > > > > > > > > > > > > > Hello, I am having some trouble with a serial stream on a project I am > > > working on. I have an external board that is attached to a set of > > > sens

Re: Parsing a serial stream too slowly

2012-01-23 Thread Thomas Rachel
Am 23.01.2012 22:48 schrieb M.Pekala: Hello, I am having some trouble with a serial stream on a project I am working on. I have an external board that is attached to a set of sensors. The board polls the sensors, filters them, formats the values, and sends the formatted values over a serial bus.

Re: Parsing a serial stream too slowly

2012-01-23 Thread M.Pekala
On Jan 23, 5:00 pm, Jon Clements wrote: > On Jan 23, 9:48 pm, "M.Pekala" wrote: > > > > > > > > > > > Hello, I am having some trouble with a serial stream on a project I am > > working on. I have an external board that is attached to a set of > > sensors. The board polls the sensors, filters them

Re: Parsing a serial stream too slowly

2012-01-23 Thread Jon Clements
On Jan 23, 9:48 pm, "M.Pekala" wrote: > Hello, I am having some trouble with a serial stream on a project I am > working on. I have an external board that is attached to a set of > sensors. The board polls the sensors, filters them, formats the > values, and sends the formatted values over a seria

Re: Parsing a serial stream too slowly

2012-01-23 Thread Jerry Hill
On Mon, Jan 23, 2012 at 4:48 PM, M.Pekala wrote: > Hello, I am having some trouble with a serial stream on a project I am > When one sensor is running my python script grabs the data just fine, > removes the formatting, and throws it into a text control box. However > when 3 or more sensors are r

Parsing a serial stream too slowly

2012-01-23 Thread M.Pekala
Hello, I am having some trouble with a serial stream on a project I am working on. I have an external board that is attached to a set of sensors. The board polls the sensors, filters them, formats the values, and sends the formatted values over a serial bus. The serial stream comes out like $A1234$