From 192ad95ba970f3dfade621e40f10392b098d1cbe Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Mon, 14 Sep 1992 14:27:31 +0000 Subject: [PATCH] modified fetch_values to call recGblGetLinkValue --- src/rec/recCalc.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/rec/recCalc.c b/src/rec/recCalc.c index afccf40c6..1692efb19 100644 --- a/src/rec/recCalc.c +++ b/src/rec/recCalc.c @@ -68,6 +68,7 @@ * .26 07-16-92 jba added invalid alarm fwd link test and chngd fwd lnk to macro * .27 07-21-92 jba changed alarm limits for non val related fields * .28 08-06-92 jba New algorithm for calculating analog alarms + * .29 09-10-92 jba modified fetch_values to call recGblGetLinkValue */ #include @@ -420,32 +421,15 @@ struct calcRecord *pcalc; { struct link *plink; /* structure of the link field */ double *pvalue; - long options,nRequest; + long status,options=0,nRequest=1; int i; - long status; for(i=0, plink=&pcalc->inpa, pvalue=&pcalc->a; itype == CA_LINK) - { - if (dbCaGetLink(plink)) - { - recGblSetSevr(pcalc,LINK_ALARM,INVALID_ALARM); - return(-1); - } /* endif */ - } - else - { - if(plink->type==DB_LINK) - { - options=0; - nRequest=1; - status = dbGetLink(&plink->value.db_link,(struct dbCommon *)pcalc,DBR_DOUBLE, pvalue,&options,&nRequest); - if(status!=0) { - recGblSetSevr(pcalc,LINK_ALARM,INVALID_ALARM); - return(-1); - } - } /* endif */ - } /* endif */ + + status = recGblGetLinkValue(plink,(void *)pcalc, + DBR_DOUBLE,pvalue,&options,&nRequest); + + if (!RTN_SUCCESS(status)) return(status); } return(0); }