From 5a498e26a1fb732feeb08814bc447307095fe107 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 10 Dec 2012 09:25:58 -0600
Subject: [PATCH 1/2] Added Undefined Severity field UDFS
With this, records can be configured to have a lower
alarm severity when they are undefined.
Sets initial severity at iocInit too.
---
src/ioc/db/dbCommon.dbd | 8 +++++++-
src/ioc/misc/iocInit.c | 5 +++++
src/std/dev/devTimestamp.c | 2 +-
src/std/rec/aiRecord.c | 2 +-
src/std/rec/aoRecord.c | 2 +-
src/std/rec/biRecord.c | 2 +-
src/std/rec/boRecord.c | 2 +-
src/std/rec/calcRecord.c | 2 +-
src/std/rec/calcoutRecord.c | 4 ++--
src/std/rec/dfanoutRecord.c | 2 +-
src/std/rec/longinRecord.c | 2 +-
src/std/rec/longoutRecord.c | 2 +-
src/std/rec/mbbiRecord.c | 2 +-
src/std/rec/mbboDirectRecord.c | 2 +-
src/std/rec/mbboRecord.c | 2 +-
src/std/rec/selRecord.c | 2 +-
src/std/rec/stringoutRecord.c | 2 +-
src/std/rec/subArrayRecord.c | 2 +-
src/std/rec/subRecord.c | 2 +-
19 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/src/ioc/db/dbCommon.dbd b/src/ioc/db/dbCommon.dbd
index 981e3b01a..f87853bec 100644
--- a/src/ioc/db/dbCommon.dbd
+++ b/src/ioc/db/dbCommon.dbd
@@ -110,7 +110,6 @@
prompt("Alarm Severity")
special(SPC_NOMOD)
menu(menuAlarmSevr)
- initial("INVALID")
}
field(NSTA,DBF_MENU) {
prompt("New Alarm Status")
@@ -241,6 +240,13 @@
interest(1)
initial("1")
}
+ field(UDFS,DBF_MENU) {
+ prompt("Undefined Alarm Sevrty")
+ promptgroup(GUI_COMMON)
+ interest(1)
+ menu(menuAlarmSevr)
+ initial("INVALID")
+ }
%#include "epicsTime.h"
field(TIME,DBF_NOACCESS) {
prompt("Time")
diff --git a/src/ioc/misc/iocInit.c b/src/ioc/misc/iocInit.c
index 123767c74..dcf4c004f 100644
--- a/src/ioc/misc/iocInit.c
+++ b/src/ioc/misc/iocInit.c
@@ -33,6 +33,7 @@
#include "caeventmask.h"
#define epicsExportSharedSymbols
+#include "alarm.h"
#include "dbBase.h"
#include "dbFldTypes.h"
#include "link.h"
@@ -415,6 +416,10 @@ static void doInitRecord0(dbRecordType *pdbRecordType, dbCommon *precord,
/* Reset the process active field */
precord->pact = FALSE;
+ /* Initial UDF severity */
+ if (precord->udf && precord->stat == UDF_ALARM)
+ precord->sevr = precord->udfs;
+
/* Init DSET NOTE that result may be NULL */
pdevSup = dbDTYPtoDevSup(pdbRecordType, precord->dtyp);
precord->dset = pdevSup ? pdevSup->pdset : NULL;
diff --git a/src/std/dev/devTimestamp.c b/src/std/dev/devTimestamp.c
index 203d7f708..a43a2d352 100644
--- a/src/std/dev/devTimestamp.c
+++ b/src/std/dev/devTimestamp.c
@@ -62,7 +62,7 @@ static long read_stringin (stringinRecord *prec)
prec->inp.value.instio.string, &prec->time);
if (len >= sizeof prec->val) {
prec->udf = TRUE;
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
return -1;
}
prec->udf = FALSE;
diff --git a/src/std/rec/aiRecord.c b/src/std/rec/aiRecord.c
index 2188f53a2..4f2211e52 100644
--- a/src/std/rec/aiRecord.c
+++ b/src/std/rec/aiRecord.c
@@ -323,7 +323,7 @@ static void checkAlarms(aiRecord *prec, epicsTimeStamp *lastTime)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
prec->afvl = 0;
return;
}
diff --git a/src/std/rec/aoRecord.c b/src/std/rec/aoRecord.c
index 307f21658..31bd3c12c 100644
--- a/src/std/rec/aoRecord.c
+++ b/src/std/rec/aoRecord.c
@@ -378,7 +378,7 @@ static void checkAlarms(aoRecord *prec)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
return;
}
diff --git a/src/std/rec/biRecord.c b/src/std/rec/biRecord.c
index b58bb65d5..c8dda1da5 100644
--- a/src/std/rec/biRecord.c
+++ b/src/std/rec/biRecord.c
@@ -204,7 +204,7 @@ static void checkAlarms(biRecord *prec)
if(prec->udf == TRUE){
- recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM);
+ recGblSetSevr(prec,UDF_ALARM,prec->udfs);
return;
}
diff --git a/src/std/rec/boRecord.c b/src/std/rec/boRecord.c
index ed6364734..df8f17671 100644
--- a/src/std/rec/boRecord.c
+++ b/src/std/rec/boRecord.c
@@ -353,7 +353,7 @@ static void checkAlarms(boRecord *prec)
/* check for udf alarm */
if(prec->udf == TRUE ){
- recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM);
+ recGblSetSevr(prec,UDF_ALARM,prec->udfs);
}
/* check for state alarm */
diff --git a/src/std/rec/calcRecord.c b/src/std/rec/calcRecord.c
index a55ec5d98..edc2713de 100644
--- a/src/std/rec/calcRecord.c
+++ b/src/std/rec/calcRecord.c
@@ -299,7 +299,7 @@ static void checkAlarms(calcRecord *prec, epicsTimeStamp *timeLast)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
prec->afvl = 0;
return;
}
diff --git a/src/std/rec/calcoutRecord.c b/src/std/rec/calcoutRecord.c
index c21caa863..a967fa85e 100644
--- a/src/std/rec/calcoutRecord.c
+++ b/src/std/rec/calcoutRecord.c
@@ -526,7 +526,7 @@ static void checkAlarms(calcoutRecord *prec)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
return;
}
@@ -591,7 +591,7 @@ static void execOutput(calcoutRecord *prec)
break;
}
if (prec->udf){
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
}
/* Check to see what to do if INVALID */
diff --git a/src/std/rec/dfanoutRecord.c b/src/std/rec/dfanoutRecord.c
index 9ffb66969..3deba1dc6 100644
--- a/src/std/rec/dfanoutRecord.c
+++ b/src/std/rec/dfanoutRecord.c
@@ -207,7 +207,7 @@ static void checkAlarms(dfanoutRecord *prec)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
return;
}
diff --git a/src/std/rec/longinRecord.c b/src/std/rec/longinRecord.c
index 817f7cc66..a0f52e6b4 100644
--- a/src/std/rec/longinRecord.c
+++ b/src/std/rec/longinRecord.c
@@ -255,7 +255,7 @@ static void checkAlarms(longinRecord *prec, epicsTimeStamp *timeLast)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
prec->afvl = 0;
return;
}
diff --git a/src/std/rec/longoutRecord.c b/src/std/rec/longoutRecord.c
index ba1fa34b9..6c7e8f10b 100644
--- a/src/std/rec/longoutRecord.c
+++ b/src/std/rec/longoutRecord.c
@@ -272,7 +272,7 @@ static void checkAlarms(longoutRecord *prec)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
return;
}
diff --git a/src/std/rec/mbbiRecord.c b/src/std/rec/mbbiRecord.c
index 3bdffe12e..bcd35af35 100644
--- a/src/std/rec/mbbiRecord.c
+++ b/src/std/rec/mbbiRecord.c
@@ -311,7 +311,7 @@ static void checkAlarms(mbbiRecord *prec, epicsTimeStamp *timeLast)
/* check for udf alarm */
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
prec->afvl = 0;
return;
}
diff --git a/src/std/rec/mbboDirectRecord.c b/src/std/rec/mbboDirectRecord.c
index 2d52131d7..10d45afb2 100644
--- a/src/std/rec/mbboDirectRecord.c
+++ b/src/std/rec/mbboDirectRecord.c
@@ -175,7 +175,7 @@ static long process(mbboDirectRecord *prec)
}
}
if(prec->udf) {
- recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM);
+ recGblSetSevr(prec,UDF_ALARM,prec->udfs);
goto CONTINUE;
}
if(prec->nsev < INVALID_ALARM
diff --git a/src/std/rec/mbboRecord.c b/src/std/rec/mbboRecord.c
index c2fc5e84c..c71602770 100644
--- a/src/std/rec/mbboRecord.c
+++ b/src/std/rec/mbboRecord.c
@@ -219,7 +219,7 @@ static long process(mbboRecord *prec)
}
}
if (prec->udf==TRUE) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
goto CONTINUE;
}
/* convert val to rval */
diff --git a/src/std/rec/selRecord.c b/src/std/rec/selRecord.c
index 6720aa6ea..f4dfb0cc2 100644
--- a/src/std/rec/selRecord.c
+++ b/src/std/rec/selRecord.c
@@ -255,7 +255,7 @@ static void checkAlarms(selRecord *prec)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
return;
}
diff --git a/src/std/rec/stringoutRecord.c b/src/std/rec/stringoutRecord.c
index 1f2842e38..cd5315c73 100644
--- a/src/std/rec/stringoutRecord.c
+++ b/src/std/rec/stringoutRecord.c
@@ -146,7 +146,7 @@ static long process(stringoutRecord *prec)
}
if(prec->udf == TRUE ){
- recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM);
+ recGblSetSevr(prec,UDF_ALARM,prec->udfs);
}
if (prec->nsev < INVALID_ALARM )
diff --git a/src/std/rec/subArrayRecord.c b/src/std/rec/subArrayRecord.c
index f40f5ac0c..1112a3057 100644
--- a/src/std/rec/subArrayRecord.c
+++ b/src/std/rec/subArrayRecord.c
@@ -152,7 +152,7 @@ static long process(subArrayRecord *prec)
prec->udf = !!status; /* 0 or 1 */
if (status)
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
monitor(prec);
diff --git a/src/std/rec/subRecord.c b/src/std/rec/subRecord.c
index 780e9b5e1..d11b5146f 100644
--- a/src/std/rec/subRecord.c
+++ b/src/std/rec/subRecord.c
@@ -321,7 +321,7 @@ static void checkAlarms(subRecord *prec)
epicsEnum16 asev;
if (prec->udf) {
- recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
+ recGblSetSevr(prec, UDF_ALARM, prec->udfs);
return;
}
From 79b499d4c52d2472a170664e2ae09a92a5d3acfb Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 10 Dec 2012 09:36:55 -0600
Subject: [PATCH 2/2] Releas notes for UDFS.
---
documentation/RELEASE_NOTES.html | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index b9ba24961..e8260d0a7 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -15,6 +15,15 @@ EPICS Base 3.15.0.x releases are not intended for use in production systems.
Changes between 3.15.0.1 and 3.15.0.2
+New Undefined Severity field UDFS
+
+A new field has been added to dbCommon which configures the alarm severity
+associated with the record being undefined (UDF=TRUE). The default value is
+INVALID so old databases will not be affected, but now individual records can be
+configured to have a lower severity or even no alarm when undefined. Be careful
+when changing this on applications where the IVOA field of output records is
+used, IVOA still requires an INVALID severity to trigger value replacement.
+
Redirection of the errlog console stream
A new routine has been added to the errlog facility which allows the console