Hi Emmanuel,
On 06/06/2014 11:49 AM, Emmanuel Mayssat wrote:
> My goal is also to have this feature supported and be part of the
> epics-base.
> The feature I am asking for is very close to what the alias directive is
> doing.
Something like this could be added (in 3.15 or later, not 3.14 which is
now feature-frozen) quite easily. It would have to re-use the existing
syntax for setting field values though, say allowing a "*" meaning
"whatever" for the record type name when the record must already exist:
record("*", "myAO") {
field(VAL, "21")
field(FLNK, "AnotherAO.PROC")
}
That actually only requires a small change to the dbRecordHead() routine
in dbStaticLib to implement, the patch below adds that functionality to
Base-3.15:
=== modified file 'src/ioc/dbStatic/dbLexRoutines.c'
--- src/ioc/dbStatic/dbLexRoutines.c 2014-06-04 19:18:43 +0000
+++ src/ioc/dbStatic/dbLexRoutines.c 2014-06-06 18:01:38 +0000
@@ -931,6 +932,21 @@
if (ellCount(&tempList))
yyerrorAbort("dbRecordHead: tempList not empty");
allocTemp(pdbentry);
+
+ if (recordType[0] == '*' && recordType[1] == 0) {
+ if (dbRecordsOnceOnly)
+ epicsPrintf("Record-type \"*\" not valid with
dbRecordsOnceOnly\n");
+ else {
+ status = dbFindRecord(pdbentry, name);
+ if (status == 0)
+ return; /* done */
+ epicsPrintf("Record \"%s\" not found\n", name);
+ }
+ yyerror(NULL);
+ duplicate = TRUE;
+ return;
+ }
+
status = dbFindRecordType(pdbentry, recordType);
if (status) {
epicsPrintf("Record \"%s\" is of unknown type \"%s\"\n",
I'm not going to provide a patch against 3.14, but it wouldn't be hard
to add the same code there which ought to work...
I don't like the idea that this would silently ignore the new field
values if the named record does not exist though, that strikes me as
rather dangerous; is it essential for your situation? It triggers an
error in the above implementation:
tux% ./bin/linux-x86_64/softIoc -d ~/db/star.db
Record "nonexistent" not found
Error at or before ")" in file "/home/anj/db/star.db" line 11
If there are no complaints I will commit this change to the 3.15 branch.
- Andrew
--
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock
- Replies:
- RE: EPICS database Feature request Emmanuel Mayssat
- Re: EPICS database Feature request Benjamin Franksen
- References:
- EPICS database Feature request Emmanuel Mayssat
- Re: EPICS database Feature request Pete Jemian
- RE: EPICS database Feature request Emmanuel Mayssat
- Navigate by Date:
- Prev:
Re: areaDetector acquirePeriod and acquireTime Zenon Szalata
- Next:
RE: EPICS database Feature request Emmanuel Mayssat
- 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: EPICS database Feature request Emmanuel Mayssat
- Next:
RE: EPICS database Feature request Emmanuel Mayssat
- 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
|