From 4b38becc6a49ac6a6f57ef51b46f1b29c4edd2bb Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Wed, 4 Aug 1993 12:54:29 +0000 Subject: [PATCH] Replaced recGblResetSevr by recGblResetAlarms --- src/rec/recAi.c | 15 +-------------- src/rec/recAo.c | 15 +-------------- src/rec/recBi.c | 15 +-------------- src/rec/recBo.c | 15 +-------------- src/rec/recCalc.c | 15 +-------------- src/rec/recCompress.c | 15 +-------------- src/rec/recEvent.c | 16 +--------------- src/rec/recFanout.c | 7 ++----- src/rec/recGsub.c | 15 +-------------- src/rec/recHistogram.c | 25 +------------------------ src/rec/recLongin.c | 15 +-------------- src/rec/recLongout.c | 17 +---------------- src/rec/recMbbi.c | 14 +------------- src/rec/recMbbo.c | 15 +-------------- src/rec/recPermissive.c | 16 +--------------- src/rec/recPid.c | 15 +-------------- src/rec/recPulseCounter.c | 18 +----------------- src/rec/recPulseDelay.c | 17 +---------------- src/rec/recPulseTrain.c | 17 +---------------- src/rec/recSel.c | 15 +-------------- src/rec/recSeq.c | 7 +------ src/rec/recState.c | 16 +--------------- src/rec/recSteppermotor.c | 17 ++--------------- src/rec/recStringin.c | 17 +---------------- src/rec/recStringout.c | 17 +---------------- src/rec/recSub.c | 14 +------------- src/rec/recTimer.c | 17 +---------------- src/rec/recWaveform.c | 16 +--------------- 28 files changed, 30 insertions(+), 403 deletions(-) diff --git a/src/rec/recAi.c b/src/rec/recAi.c index 90f005ea2..64cca8f1d 100644 --- a/src/rec/recAi.c +++ b/src/rec/recAi.c @@ -441,21 +441,8 @@ static void monitor(pai) { unsigned short monitor_mask; double delta; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pai,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pai,&pai->stat,DBE_VALUE); - db_post_events(pai,&pai->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pai); /* check for value change */ delta = pai->mlst - pai->val; if(delta<0.0) delta = -delta; diff --git a/src/rec/recAo.c b/src/rec/recAo.c index a44148acb..d68bf0053 100644 --- a/src/rec/recAo.c +++ b/src/rec/recAo.c @@ -522,21 +522,8 @@ static void monitor(pao) { unsigned short monitor_mask; double delta; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pao,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pao,&pao->stat,DBE_VALUE); - db_post_events(pao,&pao->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pao); /* check for value change */ delta = pao->mlst - pao->val; if(delta<0.0) delta = -delta; diff --git a/src/rec/recBi.c b/src/rec/recBi.c index 920498258..64d179416 100644 --- a/src/rec/recBi.c +++ b/src/rec/recBi.c @@ -297,21 +297,8 @@ static void monitor(pbi) struct biRecord *pbi; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pbi,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev){ - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and sevr fields */ - db_post_events(pbi,&pbi->stat,DBE_VALUE); - db_post_events(pbi,&pbi->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pbi); /* check for value change */ if (pbi->mlst != pbi->val){ /* post events for value change and archive change */ diff --git a/src/rec/recBo.c b/src/rec/recBo.c index d7aeeccaf..e81878954 100644 --- a/src/rec/recBo.c +++ b/src/rec/recBo.c @@ -392,21 +392,8 @@ static void monitor(pbo) struct boRecord *pbo; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pbo,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev){ - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and sevr fields */ - db_post_events(pbo,&pbo->stat,DBE_VALUE); - db_post_events(pbo,&pbo->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pbo); /* check for value change */ if (pbo->mlst != pbo->val){ /* post events for value change and archive change */ diff --git a/src/rec/recCalc.c b/src/rec/recCalc.c index 31ee6bf20..0832ad5af 100644 --- a/src/rec/recCalc.c +++ b/src/rec/recCalc.c @@ -365,24 +365,11 @@ static void monitor(pcalc) { unsigned short monitor_mask; double delta; - unsigned short stat,sevr,nsta,nsev; double *pnew; double *pprev; int i; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pcalc,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pcalc,&pcalc->stat,DBE_VALUE); - db_post_events(pcalc,&pcalc->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pcalc); /* check for value change */ delta = pcalc->mlst - pcalc->val; if(delta<0.0) delta = -delta; diff --git a/src/rec/recCompress.c b/src/rec/recCompress.c index fbb53b0ef..fda0dff19 100644 --- a/src/rec/recCompress.c +++ b/src/rec/recCompress.c @@ -324,21 +324,8 @@ static void monitor(pcompress) struct compressRecord *pcompress; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pcompress,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pcompress,&pcompress->stat,DBE_VALUE); - db_post_events(pcompress,&pcompress->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pcompress); monitor_mask |= (DBE_LOG|DBE_VALUE); if(monitor_mask) db_post_events(pcompress,pcompress->bptr,monitor_mask); return; diff --git a/src/rec/recEvent.c b/src/rec/recEvent.c index 7cad47ffa..7f7b86a2d 100644 --- a/src/rec/recEvent.c +++ b/src/rec/recEvent.c @@ -194,23 +194,9 @@ static void monitor(pevent) struct eventRecord *pevent; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pevent,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pevent,&pevent->stat,DBE_VALUE); - db_post_events(pevent,&pevent->sevr,DBE_VALUE); - } - + monitor_mask = recGblResetAlarms(pevent); db_post_events(pevent,&pevent->val,monitor_mask|DBE_VALUE); return; } diff --git a/src/rec/recFanout.c b/src/rec/recFanout.c index bd94365f9..fc9b18f40 100644 --- a/src/rec/recFanout.c +++ b/src/rec/recFanout.c @@ -139,6 +139,7 @@ static long process(pfanout) long status=0; long options=0; long nRequest=1; + unsigned short monitor_mask; pfanout->pact = TRUE; @@ -195,11 +196,7 @@ static long process(pfanout) tsLocalTime(&pfanout->time); /* check monitors*/ /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pfanout,stat,sevr,nsta,nsev); - if((stat!=nsta || sevr!=nsev)){ - db_post_events(pfanout,&pfanout->stat,DBE_VALUE); - db_post_events(pfanout,&pfanout->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pfanout); /* process the forward scan link record */ recGblFwdLink(pfanout); diff --git a/src/rec/recGsub.c b/src/rec/recGsub.c index cd038ae61..65b81434f 100644 --- a/src/rec/recGsub.c +++ b/src/rec/recGsub.c @@ -340,24 +340,11 @@ static void monitor(psub) { unsigned short monitor_mask; double delta; - short stat,sevr,nsta,nsev; float *pnew; float *pprev; int i; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(psub,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(psub,&psub->stat,DBE_VALUE); - db_post_events(psub,&psub->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(psub); /* check for value change */ delta = psub->mlst - psub->val; if(delta<0.0) delta = -delta; diff --git a/src/rec/recHistogram.c b/src/rec/recHistogram.c index 861b9da0d..62186fac6 100644 --- a/src/rec/recHistogram.c +++ b/src/rec/recHistogram.c @@ -317,31 +317,8 @@ static void monitor(phistogram) struct histogramRecord *phistogram; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - stat=phistogram->stat; - sevr=phistogram->sevr; - nsta=phistogram->nsta; - nsev=phistogram->nsev; - /*set current stat and sevr*/ - phistogram->stat = nsta; - phistogram->sevr = nsev; - phistogram->nsta = 0; - phistogram->nsev = 0; - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(phistogram,&phistogram->stat,DBE_VALUE); - db_post_events(phistogram,&phistogram->sevr,DBE_VALUE); - } - + monitor_mask = recGblResetAlarms(phistogram); /* post events for count change */ if(phistogram->mcnt>phistogram->mdel){ /* post events for count change */ diff --git a/src/rec/recLongin.c b/src/rec/recLongin.c index d874ce6ec..7ad57b65d 100644 --- a/src/rec/recLongin.c +++ b/src/rec/recLongin.c @@ -321,22 +321,9 @@ static void monitor(plongin) { unsigned short monitor_mask; long delta; - unsigned short stat,sevr,nsta,nsev; /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(plongin,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(plongin,&plongin->stat,DBE_VALUE); - db_post_events(plongin,&plongin->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(plongin); /* check for value change */ delta = plongin->mlst - plongin->val; if(delta<0) delta = -delta; diff --git a/src/rec/recLongout.c b/src/rec/recLongout.c index c539fbc5b..08fdcec1b 100644 --- a/src/rec/recLongout.c +++ b/src/rec/recLongout.c @@ -352,24 +352,9 @@ static void monitor(plongout) struct longoutRecord *plongout; { unsigned short monitor_mask; - long delta; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(plongout,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(plongout,&plongout->stat,DBE_VALUE); - db_post_events(plongout,&plongout->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(plongout); /* check for value change */ delta = plongout->mlst - plongout->val; if(delta<0) delta = -delta; diff --git a/src/rec/recMbbi.c b/src/rec/recMbbi.c index 53b7d23af..e5a1d5ad6 100644 --- a/src/rec/recMbbi.c +++ b/src/rec/recMbbi.c @@ -383,20 +383,8 @@ static void monitor(pmbbi) struct mbbiRecord *pmbbi; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pmbbi,stat,sevr,nsta,nsev); - - monitor_mask = 0; - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev){ - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and sevr fields */ - db_post_events(pmbbi,&pmbbi->stat,DBE_VALUE); - db_post_events(pmbbi,&pmbbi->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pmbbi); /* check for value change */ if (pmbbi->mlst != pmbbi->val){ /* post events for value change and archive change */ diff --git a/src/rec/recMbbo.c b/src/rec/recMbbo.c index abbc40f24..15f22b424 100644 --- a/src/rec/recMbbo.c +++ b/src/rec/recMbbo.c @@ -428,21 +428,8 @@ static void monitor(pmbbo) struct mbboRecord *pmbbo; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pmbbo,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev){ - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and sevr fields */ - db_post_events(pmbbo,&pmbbo->stat,DBE_VALUE); - db_post_events(pmbbo,&pmbbo->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pmbbo); /* check for value change */ if (pmbbo->mlst != pmbbo->val){ /* post events for value change and archive change */ diff --git a/src/rec/recPermissive.c b/src/rec/recPermissive.c index 20dc22348..bb58f079f 100644 --- a/src/rec/recPermissive.c +++ b/src/rec/recPermissive.c @@ -118,11 +118,9 @@ static void monitor(ppermissive) struct permissiveRecord *ppermissive; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; unsigned short val,oval,wflg,oflg; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(ppermissive,stat,sevr,nsta,nsev); + monitor_mask = recGblResetAlarms(ppermissive); /* get val,oval,wflg,oflg*/ val=ppermissive->val; oval=ppermissive->oval; @@ -131,18 +129,6 @@ static void monitor(ppermissive) /*set oval and oflg*/ ppermissive->oval = val; ppermissive->oflg = wflg; - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(ppermissive,&ppermissive->stat,DBE_VALUE); - db_post_events(ppermissive,&ppermissive->sevr,DBE_VALUE); - } - if(oval != val) { db_post_events(ppermissive,&ppermissive->val,monitor_mask|DBE_VALUE); } diff --git a/src/rec/recPid.c b/src/rec/recPid.c index 0727a0b6f..b27ecd1cf 100644 --- a/src/rec/recPid.c +++ b/src/rec/recPid.c @@ -293,21 +293,8 @@ static void monitor(ppid) { unsigned short monitor_mask; float delta; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(ppid,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(ppid,&ppid->stat,DBE_VALUE); - db_post_events(ppid,&ppid->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(ppid); /* check for value change */ delta = ppid->mlst - ppid->val; if(delta<0.0) delta = -delta; diff --git a/src/rec/recPulseCounter.c b/src/rec/recPulseCounter.c index 2cb61eb23..22a9c59ae 100644 --- a/src/rec/recPulseCounter.c +++ b/src/rec/recPulseCounter.c @@ -311,24 +311,8 @@ static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd) static void monitor(struct pulseCounterRecord *ppc) { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(ppc,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) - { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(ppc,&ppc->stat,DBE_VALUE); - db_post_events(ppc,&ppc->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(ppc); monitor_mask |= (DBE_VALUE | DBE_LOG); db_post_events(ppc,&ppc->val,monitor_mask); diff --git a/src/rec/recPulseDelay.c b/src/rec/recPulseDelay.c index 060063bd0..b078825e6 100644 --- a/src/rec/recPulseDelay.c +++ b/src/rec/recPulseDelay.c @@ -385,23 +385,8 @@ static void monitor(ppd) struct pulseDelayRecord *ppd; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(ppd,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(ppd,&ppd->stat,DBE_VALUE); - db_post_events(ppd,&ppd->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(ppd); monitor_mask |= (DBE_VALUE | DBE_LOG); /* temp change, keep old val value in pfld so ascii files do not diff --git a/src/rec/recPulseTrain.c b/src/rec/recPulseTrain.c index d1e7dae4b..f25e3cb63 100644 --- a/src/rec/recPulseTrain.c +++ b/src/rec/recPulseTrain.c @@ -279,23 +279,8 @@ static void monitor(ppt) struct pulseTrainRecord *ppt; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(ppt,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(ppt,&ppt->stat,DBE_VALUE); - db_post_events(ppt,&ppt->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(ppt); monitor_mask |= (DBE_VALUE | DBE_LOG); db_post_events(ppt,&ppt->val,monitor_mask); if(ppt->oper != ppt->per){ diff --git a/src/rec/recSel.c b/src/rec/recSel.c index 92d471742..697fc0918 100644 --- a/src/rec/recSel.c +++ b/src/rec/recSel.c @@ -348,24 +348,11 @@ static void monitor(psel) { unsigned short monitor_mask; double delta; - unsigned short stat,sevr,nsta,nsev; double *pnew; double *pprev; int i; - /* get peevious stat and sevr and new stat and sevr*/ - recGblResetSevr(psel,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(psel,&psel->stat,DBE_VALUE); - db_post_events(psel,&psel->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(psel); /* check for value change */ delta = psel->mlst - psel->val; if(delta<0.0) delta = -delta; diff --git a/src/rec/recSeq.c b/src/rec/recSeq.c index 7b4782312..2bc35bdeb 100644 --- a/src/rec/recSeq.c +++ b/src/rec/recSeq.c @@ -338,12 +338,7 @@ struct seqRecord *pseq; printf("asyncFinish(%s) completing processing\n", pseq->name); pseq->udf = FALSE; - recGblResetSevr(pseq, stat, sevr, nsta, nsev); - if((stat!=nsta || sevr!=nsev)) - { - db_post_events(pseq, &pseq->stat, DBE_VALUE); - db_post_events(pseq, &pseq->sevr, DBE_VALUE); - } + recGblResetAlarms(pseq); /* process the forward scan link record */ recGblFwdLink(pseq); diff --git a/src/rec/recState.c b/src/rec/recState.c index 58404a658..eca07c86a 100644 --- a/src/rec/recState.c +++ b/src/rec/recState.c @@ -121,23 +121,9 @@ static void monitor(pstate) struct stateRecord *pstate; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pstate,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pstate,&pstate->stat,DBE_VALUE); - db_post_events(pstate,&pstate->sevr,DBE_VALUE); - } - + monitor_mask = recGblResetAlarms(pstate); if(strncmp(pstate->oval,pstate->val,sizeof(pstate->val))) { db_post_events(pstate,&(pstate->val[0]),monitor_mask|DBE_VALUE); strncpy(pstate->oval,pstate->val,sizeof(pstate->val)); diff --git a/src/rec/recSteppermotor.c b/src/rec/recSteppermotor.c index 52b815652..0ff1a549d 100644 --- a/src/rec/recSteppermotor.c +++ b/src/rec/recSteppermotor.c @@ -395,22 +395,9 @@ static void monitor(psm) { unsigned short monitor_mask; float delta; - unsigned short stat,sevr,nsta,nsev; /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(psm,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(psm,&psm->stat,DBE_VALUE); - db_post_events(psm,&psm->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(psm); /* check for value change */ delta = psm->mlst - psm->val; if(delta<0.0) delta = -delta; @@ -536,7 +523,7 @@ struct steppermotorRecord *psm; /* alarm conditions for limit switches */ /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(psm,stat,sevr,nsta,nsev); + recGblResetAlarms(psm); post_events = FALSE; if (psm->mccw && psm->mcw){ /* limits disconnected */ recGblSetSevr(psm,WRITE_ALARM,INVALID_ALARM); diff --git a/src/rec/recStringin.c b/src/rec/recStringin.c index 1efcfaaa2..1b7c3a71b 100644 --- a/src/rec/recStringin.c +++ b/src/rec/recStringin.c @@ -210,23 +210,8 @@ static void monitor(pstringin) struct stringinRecord *pstringin; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pstringin,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pstringin,&pstringin->stat,DBE_VALUE); - db_post_events(pstringin,&pstringin->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pstringin); if(strncmp(pstringin->oval,pstringin->val,sizeof(pstringin->val))) { db_post_events(pstringin,&(pstringin->val[0]),monitor_mask|DBE_VALUE); strncpy(pstringin->oval,pstringin->val,sizeof(pstringin->val)); diff --git a/src/rec/recStringout.c b/src/rec/recStringout.c index 21b6b5b83..290ce92da 100644 --- a/src/rec/recStringout.c +++ b/src/rec/recStringout.c @@ -249,23 +249,8 @@ static void monitor(pstringout) struct stringoutRecord *pstringout; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pstringout,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pstringout,&pstringout->stat,DBE_VALUE); - db_post_events(pstringout,&pstringout->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pstringout); if(strncmp(pstringout->oval,pstringout->val,sizeof(pstringout->val))) { db_post_events(pstringout,&(pstringout->val[0]),monitor_mask|DBE_VALUE); strncpy(pstringout->oval,pstringout->val,sizeof(pstringout->val)); diff --git a/src/rec/recSub.c b/src/rec/recSub.c index aaa04fd1b..81db2dc73 100644 --- a/src/rec/recSub.c +++ b/src/rec/recSub.c @@ -350,24 +350,12 @@ static void monitor(psub) { unsigned short monitor_mask; double delta; - unsigned short stat,sevr,nsta,nsev; double *pnew; double *pprev; int i; /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(psub,stat,sevr,nsta,nsev); - - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(psub,&psub->stat,DBE_VALUE); - db_post_events(psub,&psub->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(psub); /* check for value change */ delta = psub->mlst - psub->val; if(delta<0.0) delta = -delta; diff --git a/src/rec/recTimer.c b/src/rec/recTimer.c index be0db0f67..7f8a844ac 100644 --- a/src/rec/recTimer.c +++ b/src/rec/recTimer.c @@ -176,23 +176,8 @@ static void monitor(ptimer) struct timerRecord *ptimer; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(ptimer,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev){ - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and sevr fields */ - db_post_events(ptimer,&ptimer->stat,DBE_VALUE); - db_post_events(ptimer,&ptimer->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(ptimer); monitor_mask |= (DBE_VALUE | DBE_LOG); db_post_events(ptimer,&ptimer->val,monitor_mask); db_post_events(ptimer,&ptimer->t1wd,monitor_mask); diff --git a/src/rec/recWaveform.c b/src/rec/recWaveform.c index 570c37380..afb653382 100644 --- a/src/rec/recWaveform.c +++ b/src/rec/recWaveform.c @@ -343,22 +343,8 @@ static void monitor(pwf) struct waveformRecord *pwf; { unsigned short monitor_mask; - unsigned short stat,sevr,nsta,nsev; - /* get previous stat and sevr and new stat and sevr*/ - recGblResetSevr(pwf,stat,sevr,nsta,nsev); - - /* Flags which events to fire on the value field */ - monitor_mask = 0; - - /* alarm condition changed this scan */ - if (stat!=nsta || sevr!=nsev) { - /* post events for alarm condition change*/ - monitor_mask = DBE_ALARM; - /* post stat and nsev fields */ - db_post_events(pwf,&pwf->stat,DBE_VALUE); - db_post_events(pwf,&pwf->sevr,DBE_VALUE); - } + monitor_mask = recGblResetAlarms(pwf); monitor_mask |= (DBE_LOG|DBE_VALUE); if(monitor_mask) db_post_events(pwf,pwf->bptr,monitor_mask); return;