From fabc8d06a9c9fecfdb89eee452382cbc693baa80 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 4 Apr 2013 14:18:35 -0500
Subject: [PATCH] Move db_post_events(waveform, NORD) into recordType.
Dirk pointed out that existing device support authors aren't
going to add this themselves; it's much better if the record
does it all for itself.
---
documentation/RELEASE_NOTES.html | 8 ++++----
src/std/dev/devWfSoft.c | 2 --
src/std/rec/waveformRecord.c | 12 +++++++++---
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 103a9e93a..441425505 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -322,10 +322,10 @@ that number of seconds.
Post events on Waveform record's NORD field
-When the record type or soft device support modify the NORD field of a
-waveform record they now also post a DBE_VALUE and DBE_LOG event, signalling the
-array length change to any clients monitoring the NORD field. Input device
-support routines should be modified to do this as well.
+When the record type or device support modify the NORD field of a waveform
+record, the record support code now posts DBE_VALUE and DBE_LOG events for that
+field, signalling the array length change to any client monitoring the NORD
+field.
Attributes of Non-VAL Fields
diff --git a/src/std/dev/devWfSoft.c b/src/std/dev/devWfSoft.c
index ea9280051..0ea0ce771 100644
--- a/src/std/dev/devWfSoft.c
+++ b/src/std/dev/devWfSoft.c
@@ -76,8 +76,6 @@ static long read_wf(waveformRecord *prec)
if (prec->tsel.type == CONSTANT &&
prec->tse == epicsTimeEventDeviceTime)
dbGetTimeStamp(&prec->inp, &prec->time);
- db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
}
-
return 0;
}
diff --git a/src/std/rec/waveformRecord.c b/src/std/rec/waveformRecord.c
index 0818fa983..b1e450d82 100644
--- a/src/std/rec/waveformRecord.c
+++ b/src/std/rec/waveformRecord.c
@@ -1,5 +1,5 @@
/*************************************************************************\
-* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
+* Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
@@ -318,16 +318,22 @@ static long readValue(waveformRecord *prec)
return status;
if (prec->simm == menuYesNoNO){
- return (*pdset->read_wf)(prec);
+ epicsUInt32 nord = prec->nord;
+
+ status = (*pdset->read_wf)(prec);
+ if (nord != prec->nord)
+ db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
+ return status;
}
if (prec->simm == menuYesNoYES){
long nRequest = prec->nelm;
+
status = dbGetLink(&(prec->siol), prec->ftvl, prec->bptr, 0, &nRequest);
/* nord set only for db links: needed for old db_access */
if (prec->siol.type != CONSTANT) {
prec->nord = nRequest;
- db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
+ db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
if (status == 0)
prec->udf=FALSE;
}