Hi Ralph,
On 09/13/2013 09:52 AM, Ralph Lange wrote:
On 13.09.2013 16:47, Ralph Lange wrote:
Maybe using a new magic number for TSE would be a cleaner solution:
"-3" = use timestamp of record that TSEL points to.
That would make things a lot more obvious and autoSaveRestore would
just work.
Dear fellow core-talkers,
Would that work? Or am I missing something?
I'm not sure how that could work.
Currently the pvlOptTSELisTime bit is set by recGblTSELwasModified()
being called after the link is initialized either from iocInit.c's
doResolveLinks() or from dbAccess.c's dbPutFieldLink(). At runtime if
recGblGetTimeStamp() sees the bit set it does not read TSE from TSEL but
just reads the timestamp through it instead.
Since we do the .TIME => .VAL modification internally I think it would
make more sense to reverse it internally as well, in dbGetString()
(dbStaticLib.c). Between loading the database and running iocInit() the
bit would not have been set, but the .TIME => .VAL substitution would
not have been done yet either so I think that's fairly safe.
I'm also going to drop the .VAL from the internal representation and
just remove the .TIME part, which simplifies the reverse substitution
slightly.
This patch appears to do the job (to the 3.14 branch):
=== modified file 'src/db/recGbl.c'
--- src/db/recGbl.c 2012-10-17 23:08:39 +0000
+++ src/db/recGbl.c 2013-09-13 16:09:27 +0000
@@ -303,7 +303,7 @@
/*Note that the VAL value will not be used*/
pfieldname = strstr(ppv_link->pvname, ".TIME");
if (pfieldname) {
- strcpy(pfieldname, ".VAL");
+ *pfieldname = 0;
ppv_link->pvlMask |= pvlOptTSELisTime;
}
}
=== modified file 'src/dbStatic/dbStaticLib.c'
--- src/dbStatic/dbStaticLib.c 2013-05-09 20:48:49 +0000
+++ src/dbStatic/dbStaticLib.c 2013-09-13 16:09:24 +0000
@@ -2041,9 +2041,11 @@
else if(pvlMask&pvlOptCP) ppind=3;
else if(pvlMask&pvlOptCPP) ppind=4;
else ppind=0;
- if(plink->value.pv_link.pvname)
+ if(plink->value.pv_link.pvname) {
strcpy(message,plink->value.pv_link.pvname);
- else
+ if (pvlMask & pvlOptTSELisTime)
+ strcat(message, ".TIME");
+ } else
strcpy(message,"");
strcat(message," ");
strcat(message,ppstring[ppind]);
I'll commit this change and write back to tech-talk. I think it's worth
adding as a Known Problems patch too.
- Andrew
--
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock
- Replies:
- Re: TSEL question Ralph Lange
- References:
- Re: TSEL question Ralph Lange
- Re: TSEL question Ralph Lange
- Navigate by Date:
- Prev:
Re: TSEL question Ralph Lange
- Next:
Re: TSEL question Ralph Lange
- 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: TSEL question Ralph Lange
- Next:
Re: TSEL question Ralph Lange
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|