Subject: |
Re: Scanning on event number fails with EPICS 3.16 |
From: |
Dirk Zimoch <[email protected]> |
To: |
EPICS core-talk <[email protected]> |
Date: |
Tue, 13 Feb 2018 15:44:53 +0100 |
Tests completed.
Merge request:
https://code.launchpad.net/~dirk.zimoch/epics-base/+git/epics-base/+merge/337644
Dirk
On 12.02.2018 09:05, Dirk Zimoch wrote:
I have pushed a new version to
https://code.launchpad.net/~dirk.zimoch/epics-base/+git/epics-base/+ref/named-events-backward-compatibility.
Now the logic is like this:
NULL is no event.
Leading and trailing spaces (isspace()) are trimmed.
An empty string is no event.
A numeric but not finite (inf, nan) value is no event.
A numeric value that converts (rounds towards zero) to an integer in the
range 1 ... 255 is a numeric event.
A numeric value that converts to 0 is no event.
A numeric event is then converted to a decimal integer string.
All other events are named events.
I have modified scanpel so that it prints every existing event, even if
no record uses it. The function now accepts glob patterns for filtering.
epics> postEvent "bla"
epics> postEvent "Injection"
epics> postEvent "2.00000"
epics> postEvent "Nan"
epics> postEvent "inf
epics> postEvent "-inf"
epics> postEvent "info"
epics> postEvent "0xff"
epics> scanpel
Event "255"
Event "info"
Event "2"
Event "Injection"
Event "bla"
epics> scanpel "2*"
Event "255"
Event "2"
If that look OK for you, I will make a merge request.
I am still working on the tests...
Dirk
On 08.02.2018 17:48, Andrew Johnson wrote:
Hi Dirk,
On 02/08/2018 07:23 AM, Dirk Zimoch wrote:
Attached is a patch file for dbScan.c which should fix the problem and
restore backward compatibility.
I have created (and quickly tested) it with EPICS 7 but I guess it
should work with 3.16 as well.
Please work against the 3.15 branch, since that was where we introduced
your named events work. We will merge it up into the later branches from
there.
The hack is to treat "x.000000" and "x" as the same event name if x is
an integer between 0 and 255. ("0" and "0.000000" are no event at all
now just like "").
I don't like the string comparisons since they would silently break if
the number of decimal digits generated by the double → string conversion
gets changed.
Better to parse the string properly into a double — look at the
epicsParseDouble() routine declared in epicsStdlib.h and documented at
https://epics.anl.gov/base/R3-15/5-docs/AppDevGuide/libComOSIlibraries.html#x21-84700020.13
— then either round or truncate the fractional part.
Thanks,
- Andrew
- References:
- Re: Scanning on event number fails with EPICS 3.16 Andrew Johnson
- Re: Scanning on event number fails with EPICS 3.16 Dirk Zimoch
- Navigate by Date:
- Prev:
Re: Scanning on event number fails with EPICS 3.16 Dirk Zimoch
- Next:
Re: EPICS 7 Documentation or just README.examples for the V4 part. Williams Jr., Ernest L.
- Index:
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: Scanning on event number fails with EPICS 3.16 Dirk Zimoch
- Next:
bundling linenoise with base Benjamin Franksen
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
|