test/ioc/db: xRecord handle alarms
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "dbAccessDefs.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "devSup.h"
|
||||
@@ -45,17 +46,30 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void monitor(xRecord *prec)
|
||||
{
|
||||
unsigned short monitor_mask = recGblResetAlarms(prec);
|
||||
|
||||
/* we don't track value change, so always post */
|
||||
monitor_mask |= DBE_VALUE | DBE_LOG;
|
||||
|
||||
if (monitor_mask){
|
||||
db_post_events(prec,&prec->val,monitor_mask);
|
||||
}
|
||||
}
|
||||
|
||||
static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct xRecord *prec = (struct xRecord *)pcommon;
|
||||
long ret = 0;
|
||||
xdset *xset = (xdset*)prec->dset;
|
||||
|
||||
prec->pact = TRUE;
|
||||
if(prec->clbk)
|
||||
(*prec->clbk)(prec);
|
||||
prec->pact = TRUE;
|
||||
if(xset && xset->process)
|
||||
ret = (*xset->process)(prec);
|
||||
monitor(prec);
|
||||
recGblGetTimeStamp(prec);
|
||||
recGblFwdLink(prec);
|
||||
prec->pact = FALSE;
|
||||
|
||||
Reference in New Issue
Block a user