pvalink time: key

This commit is contained in:
Michael Davidsaver
2018-04-18 14:22:46 -07:00
parent 27fd0868cf
commit 197e079ad5
3 changed files with 12 additions and 1 deletions

View File

@ -77,7 +77,7 @@ struct pvaLinkConfig : public jlink
MSI,
} ms;
bool defer, pipeline;
bool defer, pipeline, time;
int monorder;
// internals used by jlif parsing

View File

@ -14,6 +14,7 @@ pvaLinkConfig::pvaLinkConfig()
,ms(NMS)
,defer(false)
,pipeline(false)
,time(false)
,monorder(0)
{}
pvaLinkConfig::~pvaLinkConfig() {}
@ -34,6 +35,7 @@ using namespace pvalink;
* "pipeline":false,
* "proc":true, // false, true, none, "", "NPP", "PP", "CP", "CPP"
* "sevr":true, // false, true, "NMS", "MS", "MSI", "MSS"
* "time":true, // false, true
* "monorder":#,// order of processing during CP scan
* "defer":true,// whether to immediately start Put, or only queue value to be sent
* }
@ -100,6 +102,8 @@ jlif_result pva_parse_bool(jlink *pjlink, int val)
pvt->defer = !!val;
} else if(pvt->jkey == "pipeline") {
pvt->pipeline = !!val;
} else if(pvt->jkey == "time") {
pvt->time = !!val;
} else if(pvt->debug) {
printf("pva link parsing unknown integer depth=%u key=\"%s\" value=%s\n",
pvt->parseDepth, pvt->jkey.c_str(), val ? "true" : "false");

View File

@ -171,6 +171,9 @@ long pvaGetValue(DBLINK *plink, short dbrType, void *pbuffer,
}
// TODO: better capture of disconnect time
epicsTimeGetCurrent(&self->snap_time);
if(self->time) {
plink->precord->time = self->snap_time;
}
return -1;
}
@ -203,6 +206,10 @@ long pvaGetValue(DBLINK *plink, short dbrType, void *pbuffer,
recGblSetSevr(plink->precord, self->snap_severity, LINK_ALARM);
}
if(self->time) {
plink->precord->time = self->snap_time;
}
return 0;
}CATCH(pvaIsConnected)
return -1;