Hi Emma,
I found the bug in StreamFormatConverter.cc.
In StdCharsetConverter::parse() (line 387), replace
info.printf("%%%d[", fmt.width);
with
info.printf("%%%s%d[", fmt.flags & skip_flag ? "*" : "", fmt.width);
I will put a patch on the StreamDevice website.
Dirk
Shepherd, EL (Emma) wrote:
Hi,
I've been battling with a Streams protocol and thought I would ask for
some advice from the experts!
I have the following input from my Streams device: "RC1C0V0.00E2.50"
Now this is just an echo of a command I have sent so instead of saving
the information I want to use the * modifier to simply skip the floating
point numbers, like so:
in "RC1C0V%*[.0-9]E%*f";
(NB: I am using a charset instead of %f for the first number since the E
character could be interpreted as an exponent).
This doesn't work, and I get the following Streams error:
2007/08/23 09:07:49.260 BLXXI-EA-LED-01:CH1SENDOUTPUT: Input
"RC1C0V0.00E2.50" too short. No match for "E"
However, if I remove the * modifiers and put field names there instead,
it works fine:
in "RC1C0V%(MYRECORD.VAL)[.0-9]E%(MYRECORD.VAL)f";
If I leave the field name in for the first number and %*f for the second
I get the following error:
2007/08/23 09:25:25.632 BLXXI-EA-LED-01:CH1SENDOUTPUT: Input "2.50" does
not match format %*f
Any ideas why I am not able to use the * flag in these cases?
Thanks,
Emma
<DIV><FONT size="1" color="gray">This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
</FONT></DIV>
--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182
- References:
- StreamDevice protocol question Shepherd, EL (Emma)
- Navigate by Date:
- Prev:
Alarm Handler Umashankar Panda
- Next:
Re: bug in Red Hat Linux g++ 3.2.3 Dirk Zimoch
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: StreamDevice protocol question Shepherd, EL (Emma)
- Next:
ethernet IP John Sinclair
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|