CleanupWhitespace

removed spaces at end of line

replaced tabs with spaces
This commit is contained in:
2020-05-20 14:43:02 -07:00
committed by Michael Davidsaver
parent 055223dbe4
commit 36a8b51d8e
610 changed files with 19733 additions and 19733 deletions
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* asSubRecordFunctions.c */
@@ -36,16 +36,16 @@
static void myCallback(epicsCallback *pcallback)
{
ASDBCALLBACK *pasdbcallback = (ASDBCALLBACK *)pcallback;
subRecord *precord;
rset *prset;
ASDBCALLBACK *pasdbcallback = (ASDBCALLBACK *)pcallback;
subRecord *precord;
rset *prset;
callbackGetUser(precord,pcallback);
prset=(rset *)(precord->rset);
precord->val = 0.0;
if(pasdbcallback->status) {
recGblSetSevr(precord,READ_ALARM,precord->brsv);
recGblRecordError(pasdbcallback->status,precord,"asInit Failed");
recGblSetSevr(precord,READ_ALARM,precord->brsv);
recGblRecordError(pasdbcallback->status,precord,"asInit Failed");
}
dbScanLock((dbCommon *)precord);
(*prset->process)((dbCommon *)precord);
@@ -69,11 +69,11 @@ long asSubProcess(subRecord *precord)
ASDBCALLBACK *pcallback = (ASDBCALLBACK *)precord->dpvt;
if(!precord->pact && precord->val==1.0) {
db_post_events(precord,&precord->val,DBE_VALUE);
callbackSetPriority(precord->prio,&pcallback->callback);
asInitAsyn(pcallback);
precord->pact=TRUE;
return(1);
db_post_events(precord,&precord->val,DBE_VALUE);
callbackSetPriority(precord->prio,&pcallback->callback);
asInitAsyn(pcallback);
precord->pact=TRUE;
return(1);
}
db_post_events(precord,&precord->val,DBE_VALUE);
return(0);
+2 -2
View File
@@ -4,12 +4,12 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* devAaoSoft.c - Device Support Routines for soft Waveform Records
*
*
* Original Author: Bob Dalesio
* Current Author: Dirk Zimoch
* Date: 27-MAY-2010
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+1 -1
View File
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devAoSoft.c */
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devAoSoftCallbackCallback.c */
/*
+1 -1
View File
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devAoSoftRaw.c */
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+3 -3
View File
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devBoSoft.c - Device Support Routines for Soft Binary Output*/
@@ -42,11 +42,11 @@ epicsExportAddress(dset, devBoSoft);
static long init_record(dbCommon *pcommon)
{
long status=0;
/* dont convert */
status=2;
return status;
} /* end init_record() */
static long write_bo(boRecord *prec)
+5 -5
View File
@@ -5,13 +5,13 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devBoSoftRaw.c - Device Support Routines for SoftRaw Binary Output*/
/*
* Author: Janet Anderson
* Date: 3-28-92
* Author: Janet Anderson
* Date: 3-28-92
*/
@@ -41,11 +41,11 @@ epicsExportAddress(dset, devBoSoftRaw);
static long init_record(dbCommon *pcommon)
{
long status;
/*Don't convert*/
status = 2;
return status;
} /* end init_record() */
static long write_bo(boRecord *prec)
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devCalcoutSoft.c */
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devCalcoutSoftCallback.c */
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright (c) 2016 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devEnviron.c */
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -4,8 +4,8 @@
\*************************************************************************/
/*
* Original Author: Sheng Peng, ORNL / SNS Project
* Date: 07/2004
* Original Author: Sheng Peng, ORNL / SNS Project
* Date: 07/2004
*
* EPICS device support for general timestamp support
*
@@ -5,12 +5,12 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devHistogramSoft.c */
/*
* Author: Janet Anderson
* Date: 07/02/91
* Author: Janet Anderson
* Date: 07/02/91
*/
#include <stdlib.h>
#include <stdio.h>
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+1 -1
View File
@@ -9,7 +9,7 @@
/*
* Original Author: Janet Anderson
* Date: 09-23-91
* Date: 09-23-91
*/
#include <stdlib.h>
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+4 -4
View File
@@ -5,12 +5,12 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devLoSoft.c */
/*
* Author: Janet Anderson
* Date: 09-23-91
* Author: Janet Anderson
* Date: 09-23-91
*/
#include <stdlib.h>
#include <stdio.h>
@@ -40,7 +40,7 @@ static long init_record(dbCommon *pcommon)
return 0;
} /* end init_record() */
static long write_longout(longoutRecord *prec)
static long write_longout(longoutRecord *prec)
{
dbPutLink(&prec->out,DBR_LONG, &prec->val,1);
return 0;
@@ -36,7 +36,7 @@ longoutdset devLoSoftCallback = {
};
epicsExportAddress(dset, devLoSoftCallback);
static long write_longout(longoutRecord *prec)
static long write_longout(longoutRecord *prec)
{
struct link *plink = &prec->out;
long status;
@@ -2,7 +2,7 @@
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Andrew Johnson
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -100,7 +100,7 @@ static long add_record(dbCommon *pcommon)
pdevPvt = calloc(1, sizeof(*pdevPvt));
if (!pdevPvt) {
long status = S_db_noMemory;
long status = S_db_noMemory;
recGblRecordError(status, (void *)prec,
"devMbbiSoftCallback (add_record) out of memory, calloc() failed");
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -19,7 +19,7 @@
#include "mbboDirectRecord.h"
#include "epicsExport.h"
static long write_mbbo(mbboDirectRecord *prec)
static long write_mbbo(mbboDirectRecord *prec)
{
dbPutLink(&prec->out, DBR_ULONG, &prec->val, 1);
return 0;
@@ -32,7 +32,7 @@ static long init_record(dbCommon *pcommon)
return 2; /* Don't convert */
}
static long write_mbbo(mbboDirectRecord *prec)
static long write_mbbo(mbboDirectRecord *prec)
{
epicsUInt32 data;
+2 -2
View File
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devMbboSoft.c */
/*
@@ -40,7 +40,7 @@ static long init_record(dbCommon *pcommon)
{
/*dont convert*/
return 2;
} /* end init_record() */
static long write_mbbo(mbboRecord *prec)
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Andrew Johnson
@@ -2,7 +2,7 @@
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Andrew Johnson
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
+1 -1
View File
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Janet Anderson
+1 -1
View File
@@ -2,7 +2,7 @@
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <stdio.h>
+1 -1
View File
@@ -8,7 +8,7 @@
/*
* Device support for EPICS time stamps
*
* Original Author: Eric Norum
* Original Author: Eric Norum
*/
#include "dbDefs.h"
+1 -1
View File
@@ -196,7 +196,7 @@ static jlif_result lnkCalc_string(jlink *pjlink, const char *val, size_t len)
}
inbuf = malloc(len+1);
if(!inbuf) {
if(!inbuf) {
errlogPrintf("lnkCalc: Out of memory\n");
free(postbuf);
return jlif_stop;
+1 -1
View File
@@ -348,7 +348,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
aSubRecord *prec = (aSubRecord *)paddr->precord;
int fieldIndex = dbGetFieldIndex(paddr);
int linkNumber;
linkNumber = get_inlinkNumber(fieldIndex);
if (linkNumber >= 0) {
dbGetGraphicLimits(&prec->inpa + linkNumber,
+130 -130
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* aiRecord.c - Record Support Routines for Analog Input records */
@@ -63,26 +63,26 @@ static long get_precision(const DBADDR *, long *);
static long get_graphic_double(DBADDR *, struct dbr_grDouble *);
static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
rset aiRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,aiRSET);
@@ -94,8 +94,8 @@ static long readValue(aiRecord *prec);
static long init_record(struct dbCommon *pcommon, int pass)
{
struct aiRecord *prec = (struct aiRecord *)pcommon;
aidset *pdset;
double eoff = prec->eoff, eslo = prec->eslo;
aidset *pdset;
double eoff = prec->eoff, eslo = prec->eslo;
if (pass == 0) return 0;
@@ -103,27 +103,27 @@ static long init_record(struct dbCommon *pcommon, int pass)
recGblInitConstantLink(&prec->siol, DBF_DOUBLE, &prec->sval);
if(!(pdset = (aidset *)(prec->dset))) {
recGblRecordError(S_dev_noDSET,(void *)prec,"ai: init_record");
return(S_dev_noDSET);
recGblRecordError(S_dev_noDSET,(void *)prec,"ai: init_record");
return(S_dev_noDSET);
}
/* must have read_ai function defined */
if ((pdset->common.number < 6) || (pdset->read_ai == NULL)) {
recGblRecordError(S_dev_missingSup,(void *)prec,"ai: init_record");
return(S_dev_missingSup);
recGblRecordError(S_dev_missingSup,(void *)prec,"ai: init_record");
return(S_dev_missingSup);
}
prec->init = TRUE;
/*The following is for old device support that doesnt know about eoff*/
if ((prec->eslo==1.0) && (prec->eoff==0.0)) {
prec->eoff = prec->egul;
prec->eoff = prec->egul;
}
if (pdset->common.init_record) {
long status = pdset->common.init_record(pcommon);
if (prec->linr == menuConvertSLOPE) {
prec->eoff = eoff;
prec->eslo = eslo;
}
return (status);
if (prec->linr == menuConvertSLOPE) {
prec->eoff = eoff;
prec->eslo = eslo;
}
return (status);
}
prec->mlst = prec->val;
prec->alst = prec->val;
@@ -135,46 +135,46 @@ static long init_record(struct dbCommon *pcommon, int pass)
static long process(struct dbCommon *pcommon)
{
struct aiRecord *prec = (struct aiRecord *)pcommon;
aidset *pdset = (aidset *)(prec->dset);
long status;
aidset *pdset = (aidset *)(prec->dset);
long status;
unsigned char pact=prec->pact;
epicsTimeStamp timeLast;
epicsTimeStamp timeLast;
if( (pdset==NULL) || (pdset->read_ai==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_ai");
return(S_dev_missingSup);
}
timeLast = prec->time;
if( (pdset==NULL) || (pdset->read_ai==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_ai");
return(S_dev_missingSup);
}
timeLast = prec->time;
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
if (status==0) convert(prec);
else if (status==2) status=0;
if (status==0) convert(prec);
else if (status==2) status=0;
if (status == 0) prec->udf = isnan(prec->val);
/* check for alarms */
checkAlarms(prec,&timeLast);
/* check event list */
monitor(prec);
/* process the forward scan link record */
/* check for alarms */
checkAlarms(prec,&timeLast);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->init=FALSE;
prec->pact=FALSE;
return(status);
prec->init=FALSE;
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr,int after)
{
aiRecord *prec = (aiRecord *)(paddr->precord);
aidset *pdset = (aidset *) (prec->dset);
aiRecord *prec = (aiRecord *)(paddr->precord);
aidset *pdset = (aidset *) (prec->dset);
int special_type = paddr->special;
switch(special_type) {
@@ -215,7 +215,7 @@ static long special(DBADDR *paddr,int after)
static long get_units(DBADDR *paddr, char *units)
{
aiRecord *prec=(aiRecord *)paddr->precord;
aiRecord *prec=(aiRecord *)paddr->precord;
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
switch (dbGetFieldIndex(paddr)) {
@@ -232,7 +232,7 @@ static long get_units(DBADDR *paddr, char *units)
static long get_precision(const DBADDR *paddr, long *precision)
{
aiRecord *prec=(aiRecord *)paddr->precord;
aiRecord *prec=(aiRecord *)paddr->precord;
*precision = prec->prec;
if (dbGetFieldIndex(paddr) == indexof(VAL)) return(0);
@@ -242,7 +242,7 @@ static long get_precision(const DBADDR *paddr, long *precision)
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
{
aiRecord *prec=(aiRecord *)paddr->precord;
aiRecord *prec=(aiRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
@@ -265,7 +265,7 @@ static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
{
aiRecord *prec=(aiRecord *)paddr->precord;
aiRecord *prec=(aiRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
@@ -277,8 +277,8 @@ static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
case indexof(ALST):
case indexof(MLST):
case indexof(SVAL):
pcd->upper_ctrl_limit = prec->hopr;
pcd->lower_ctrl_limit = prec->lopr;
pcd->upper_ctrl_limit = prec->hopr;
pcd->lower_ctrl_limit = prec->lopr;
break;
default:
recGblGetControlDouble(paddr,pcd);
@@ -288,7 +288,7 @@ static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
{
aiRecord *prec=(aiRecord *)paddr->precord;
aiRecord *prec=(aiRecord *)paddr->precord;
if (dbGetFieldIndex(paddr) == indexof(VAL)) {
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
@@ -369,7 +369,7 @@ static void checkAlarms(aiRecord *prec, epicsTimeStamp *lastTime)
* level, otherwise to a higher.
*/
afvl = alpha * afvl +
((afvl > 0) ? (1 - alpha) : (alpha - 1)) * alarmRange;
((afvl > 0) ? (1 - alpha) : (alpha - 1)) * alarmRange;
if (afvl - floor(afvl) > THRESHOLD)
afvl = -afvl; /* reverse rounding */
@@ -411,38 +411,38 @@ static void checkAlarms(aiRecord *prec, epicsTimeStamp *lastTime)
static void convert(aiRecord *prec)
{
double val;
double val;
val = (double)prec->rval + (double)prec->roff;
/* adjust slope and offset */
if(prec->aslo!=0.0) val*=prec->aslo;
val+=prec->aoff;
val = (double)prec->rval + (double)prec->roff;
/* adjust slope and offset */
if(prec->aslo!=0.0) val*=prec->aslo;
val+=prec->aoff;
/* convert raw to engineering units and signal units */
switch (prec->linr) {
case menuConvertNO_CONVERSION:
break; /* do nothing*/
case menuConvertLINEAR:
case menuConvertSLOPE:
val = (val * prec->eslo) + prec->eoff;
break;
default: /* must use breakpoint table */
if (cvtRawToEngBpt(&val,prec->linr,prec->init,(void *)&prec->pbrk,&prec->lbrk)!=0) {
recGblSetSevr(prec,SOFT_ALARM,MAJOR_ALARM);
}
}
/* convert raw to engineering units and signal units */
switch (prec->linr) {
case menuConvertNO_CONVERSION:
break; /* do nothing*/
/* apply smoothing algorithm */
case menuConvertLINEAR:
case menuConvertSLOPE:
val = (val * prec->eslo) + prec->eoff;
break;
default: /* must use breakpoint table */
if (cvtRawToEngBpt(&val,prec->linr,prec->init,(void *)&prec->pbrk,&prec->lbrk)!=0) {
recGblSetSevr(prec,SOFT_ALARM,MAJOR_ALARM);
}
}
/* apply smoothing algorithm */
if (prec->smoo != 0.0 && finite(prec->val)){
if (prec->init) prec->val = val; /* initial condition */
prec->val = val * (1.00 - prec->smoo) + (prec->val * prec->smoo);
}else{
prec->val = val;
}
return;
if (prec->init) prec->val = val; /* initial condition */
prec->val = val * (1.00 - prec->smoo) + (prec->val * prec->smoo);
}else{
prec->val = val;
}
return;
}
static void monitor(aiRecord *prec)
@@ -455,15 +455,15 @@ static void monitor(aiRecord *prec)
/* check for archive change */
recGblCheckDeadband(&prec->alst, prec->val, prec->adel, &monitor_mask, DBE_ARCHIVE);
/* send out monitors connected to the value field */
if (monitor_mask){
db_post_events(prec,&prec->val,monitor_mask);
if(prec->oraw != prec->rval) {
db_post_events(prec,&prec->rval,monitor_mask);
prec->oraw = prec->rval;
}
}
return;
/* send out monitors connected to the value field */
if (monitor_mask){
db_post_events(prec,&prec->val,monitor_mask);
if(prec->oraw != prec->rval) {
db_post_events(prec,&prec->rval,monitor_mask);
prec->oraw = prec->rval;
}
}
return;
}
static long readValue(aiRecord *prec)
@@ -477,40 +477,40 @@ static long readValue(aiRecord *prec)
}
switch (prec->simm) {
case menuSimmNO:
status = pdset->read_ai(prec);
break;
case menuSimmNO:
status = pdset->read_ai(prec);
break;
case menuSimmYES:
case menuSimmRAW: {
recGblSetSevr(prec, SIMM_ALARM, prec->sims);
if (prec->pact || (prec->sdly < 0.)) {
status = dbGetLink(&prec->siol, DBR_DOUBLE, &prec->sval, 0, 0);
if (status == 0) {
if (prec->simm == menuSimmYES) {
prec->val = prec->sval;
status = 2; /* don't convert */
} else {
prec->rval = (long)floor(prec->sval);
status = 0; /* convert RVAL */
case menuSimmYES:
case menuSimmRAW: {
recGblSetSevr(prec, SIMM_ALARM, prec->sims);
if (prec->pact || (prec->sdly < 0.)) {
status = dbGetLink(&prec->siol, DBR_DOUBLE, &prec->sval, 0, 0);
if (status == 0) {
if (prec->simm == menuSimmYES) {
prec->val = prec->sval;
status = 2; /* don't convert */
} else {
prec->rval = (long)floor(prec->sval);
status = 0; /* convert RVAL */
}
}
prec->pact = FALSE;
} else { /* !prec->pact && delay >= 0. */
epicsCallback *pvt = prec->simpvt;
if (!pvt) {
pvt = calloc(1, sizeof(epicsCallback)); /* very lazy allocation of callback structure */
prec->simpvt = pvt;
}
if (pvt) callbackRequestProcessCallbackDelayed(pvt, prec->prio, prec, prec->sdly);
prec->pact = TRUE;
}
prec->pact = FALSE;
} else { /* !prec->pact && delay >= 0. */
epicsCallback *pvt = prec->simpvt;
if (!pvt) {
pvt = calloc(1, sizeof(epicsCallback)); /* very lazy allocation of callback structure */
prec->simpvt = pvt;
}
if (pvt) callbackRequestProcessCallbackDelayed(pvt, prec->prio, prec, prec->sdly);
prec->pact = TRUE;
break;
}
break;
}
default:
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
status = -1;
default:
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
status = -1;
}
return status;
+148 -148
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* aoRecord.c - Record Support Routines for Analog Output records */
@@ -64,23 +64,23 @@ static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
rset aoRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,aoRSET);
@@ -95,17 +95,17 @@ static long init_record(struct dbCommon *pcommon, int pass)
{
struct aoRecord *prec = (struct aoRecord *)pcommon;
aodset *pdset;
double eoff = prec->eoff, eslo = prec->eslo;
double value;
long status = 0;
double eoff = prec->eoff, eslo = prec->eslo;
double value;
long status = 0;
if (pass == 0) return 0;
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
if(!(pdset = (aodset *)(prec->dset))) {
recGblRecordError(S_dev_noDSET,(void *)prec,"ao: init_record");
return(S_dev_noDSET);
recGblRecordError(S_dev_noDSET,(void *)prec,"ao: init_record");
return(S_dev_noDSET);
}
/* get the initial value if dol is a constant*/
if (recGblInitConstantLink(&prec->dol,DBF_DOUBLE,&prec->val))
@@ -113,43 +113,43 @@ static long init_record(struct dbCommon *pcommon, int pass)
/* must have write_ao function defined */
if ((pdset->common.number < 6) || (pdset->write_ao ==NULL)) {
recGblRecordError(S_dev_missingSup,(void *)prec,"ao: init_record");
return(S_dev_missingSup);
recGblRecordError(S_dev_missingSup,(void *)prec,"ao: init_record");
return(S_dev_missingSup);
}
prec->init = TRUE;
/*The following is for old device support that doesnt know about eoff*/
if ((prec->eslo==1.0) && (prec->eoff==0.0)) {
prec->eoff = prec->egul;
prec->eoff = prec->egul;
}
if (pdset->common.init_record) {
status = pdset->common.init_record(pcommon);
if (prec->linr == menuConvertSLOPE) {
prec->eoff = eoff;
prec->eslo = eslo;
}
if (prec->linr == menuConvertSLOPE) {
prec->eoff = eoff;
prec->eslo = eslo;
}
switch(status){
case(0): /* convert */
value = (double)prec->rval + (double)prec->roff;
if(prec->aslo!=0.0) value *= prec->aslo;
value += prec->aoff;
value = (double)prec->rval + (double)prec->roff;
if(prec->aslo!=0.0) value *= prec->aslo;
value += prec->aoff;
if (prec->linr == menuConvertNO_CONVERSION){
; /*do nothing*/
; /*do nothing*/
} else if ((prec->linr == menuConvertLINEAR) ||
(prec->linr == menuConvertSLOPE)) {
(prec->linr == menuConvertSLOPE)) {
value = value*prec->eslo + prec->eoff;
}else{
if(cvtRawToEngBpt(&value,prec->linr,prec->init,
(void *)&prec->pbrk,&prec->lbrk)!=0) break;
(void *)&prec->pbrk,&prec->lbrk)!=0) break;
}
prec->val = value;
prec->udf = isnan(value);
prec->val = value;
prec->udf = isnan(value);
break;
case(2): /* no convert */
break;
default:
recGblRecordError(S_dev_badInitRet,(void *)prec,"ao: init_record");
return(S_dev_badInitRet);
recGblRecordError(S_dev_badInitRet,(void *)prec,"ao: init_record");
return(S_dev_badInitRet);
}
}
prec->oval = prec->pval = prec->val;
@@ -165,18 +165,18 @@ static long process(struct dbCommon *pcommon)
{
struct aoRecord *prec = (struct aoRecord *)pcommon;
aodset *pdset = (aodset *)(prec->dset);
long status=0;
unsigned char pact=prec->pact;
double value;
long status=0;
unsigned char pact=prec->pact;
double value;
if ((pdset==NULL) || (pdset->write_ao==NULL)) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_ao");
return(S_dev_missingSup);
}
if ((pdset==NULL) || (pdset->write_ao==NULL)) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_ao");
return(S_dev_missingSup);
}
/* fetch value and convert*/
if (prec->pact == FALSE) {
/* fetch value and convert*/
if (prec->pact == FALSE) {
if (!dbLinkIsConstant(&prec->dol) &&
prec->omsl == menuOmslclosed_loop) {
status = fetch_value(prec, &value);
@@ -184,52 +184,52 @@ static long process(struct dbCommon *pcommon)
else {
value = prec->val;
}
if(!status) convert(prec, value);
prec->udf = isnan(prec->val);
}
if(!status) convert(prec, value);
prec->udf = isnan(prec->val);
}
/* check for alarms */
checkAlarms(prec);
/* check for alarms */
checkAlarms(prec);
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
prec->val=prec->ivov;
value=prec->ivov;
convert(prec,value);
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"ao:process Illegal IVOA field");
}
}
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
prec->val=prec->ivov;
value=prec->ivov;
convert(prec,value);
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"ao:process Illegal IVOA field");
}
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, NULL);
/* check event list */
monitor(prec);
/* check event list */
monitor(prec);
/* process the forward scan link record */
/* process the forward scan link record */
recGblFwdLink(prec);
prec->init=FALSE;
prec->pact=FALSE;
return(status);
prec->init=FALSE;
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
@@ -244,20 +244,20 @@ static long special(DBADDR *paddr, int after)
recGblDbaddrError(S_db_noMod,paddr,"ao: special");
return(S_db_noMod);
}
prec->init=TRUE;
prec->init=TRUE;
if ((prec->linr == menuConvertLINEAR) && pdset->special_linconv) {
double eoff = prec->eoff;
double eslo = prec->eslo;
long status;
prec->eoff = prec->egul;
status = (*pdset->special_linconv)(prec,after);
if (eoff != prec->eoff)
db_post_events(prec, &prec->eoff, DBE_VALUE|DBE_LOG);
double eoff = prec->eoff;
double eslo = prec->eslo;
long status;
prec->eoff = prec->egul;
status = (*pdset->special_linconv)(prec,after);
if (eoff != prec->eoff)
db_post_events(prec, &prec->eoff, DBE_VALUE|DBE_LOG);
if (eslo != prec->eslo)
db_post_events(prec, &prec->eslo, DBE_VALUE|DBE_LOG);
return (status);
}
return (0);
db_post_events(prec, &prec->eslo, DBE_VALUE|DBE_LOG);
return (status);
}
return (0);
case(SPC_MOD):
if (dbGetFieldIndex(paddr) == aoRecordSIMM) {
if (!after)
@@ -276,7 +276,7 @@ static long special(DBADDR *paddr, int after)
static long get_units(DBADDR * paddr,char *units)
{
aoRecord *prec=(aoRecord *)paddr->precord;
aoRecord *prec=(aoRecord *)paddr->precord;
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
switch (dbGetFieldIndex(paddr)) {
@@ -292,7 +292,7 @@ static long get_units(DBADDR * paddr,char *units)
static long get_precision(const DBADDR *paddr,long *precision)
{
aoRecord *prec=(aoRecord *)paddr->precord;
aoRecord *prec=(aoRecord *)paddr->precord;
*precision = prec->prec;
switch (dbGetFieldIndex(paddr)) {
@@ -308,7 +308,7 @@ static long get_precision(const DBADDR *paddr,long *precision)
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
{
aoRecord *prec=(aoRecord *)paddr->precord;
aoRecord *prec=(aoRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
@@ -333,7 +333,7 @@ static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
{
aoRecord *prec=(aoRecord *)paddr->precord;
aoRecord *prec=(aoRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
@@ -356,7 +356,7 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
}
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
{
aoRecord *prec=(aoRecord *)paddr->precord;
aoRecord *prec=(aoRecord *)paddr->precord;
if(dbGetFieldIndex(paddr) == indexof(VAL)){
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
@@ -425,27 +425,27 @@ static void checkAlarms(aoRecord *prec)
static long fetch_value(aoRecord *prec,double *pvalue)
{
short save_pact;
long status;
short save_pact;
long status;
save_pact = prec->pact;
prec->pact = TRUE;
save_pact = prec->pact;
prec->pact = TRUE;
/* don't allow dbputs to val field */
prec->val=prec->pval;
/* don't allow dbputs to val field */
prec->val=prec->pval;
status = dbGetLink(&prec->dol,DBR_DOUBLE,pvalue,0,0);
prec->pact = save_pact;
status = dbGetLink(&prec->dol,DBR_DOUBLE,pvalue,0,0);
prec->pact = save_pact;
if (status) {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
return(status);
}
if (status) {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
return(status);
}
if (prec->oif == aoOIF_Incremental)
*pvalue += prec->val;
if (prec->oif == aoOIF_Incremental)
*pvalue += prec->val;
return(0);
return(0);
}
static void convert(aoRecord *prec, double value)
@@ -477,19 +477,19 @@ static void convert(aoRecord *prec, double value)
/* convert */
switch (prec->linr) {
case menuConvertNO_CONVERSION:
break; /* do nothing*/
case menuConvertLINEAR:
case menuConvertSLOPE:
if (prec->eslo == 0.0) value = 0;
else value = (value - prec->eoff) / prec->eslo;
break;
default:
if (cvtEngToRawBpt(&value, prec->linr, prec->init,
(void *)&prec->pbrk, &prec->lbrk) != 0) {
recGblSetSevr(prec, SOFT_ALARM, MAJOR_ALARM);
return;
}
case menuConvertNO_CONVERSION:
break; /* do nothing*/
case menuConvertLINEAR:
case menuConvertSLOPE:
if (prec->eslo == 0.0) value = 0;
else value = (value - prec->eoff) / prec->eslo;
break;
default:
if (cvtEngToRawBpt(&value, prec->linr, prec->init,
(void *)&prec->pbrk, &prec->lbrk) != 0) {
recGblSetSevr(prec, SOFT_ALARM, MAJOR_ALARM);
return;
}
}
value -= prec->aoff;
if (prec->aslo != 0) value /= prec->aslo;
@@ -525,22 +525,22 @@ static void monitor(aoRecord *prec)
db_post_events(prec,&prec->val,monitor_mask);
}
if(prec->omod) monitor_mask |= (DBE_VALUE|DBE_LOG);
if(monitor_mask) {
prec->omod = FALSE;
db_post_events(prec,&prec->oval,monitor_mask);
if(prec->oraw != prec->rval) {
db_post_events(prec,&prec->rval,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->oraw = prec->rval;
}
if(prec->orbv != prec->rbv) {
db_post_events(prec,&prec->rbv,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->orbv = prec->rbv;
}
}
return;
if(prec->omod) monitor_mask |= (DBE_VALUE|DBE_LOG);
if(monitor_mask) {
prec->omod = FALSE;
db_post_events(prec,&prec->oval,monitor_mask);
if(prec->oraw != prec->rval) {
db_post_events(prec,&prec->rval,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->oraw = prec->rval;
}
if(prec->orbv != prec->rbv) {
db_post_events(prec,&prec->rbv,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->orbv = prec->rbv;
}
}
return;
}
static long writeValue(aoRecord *prec)
+90 -90
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recBi.c - Record Support Routines for Binary Input records */
@@ -58,23 +58,23 @@ static long put_enum_str(const DBADDR *, const char *);
#define get_control_double NULL
#define get_alarm_double NULL
rset biRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,biRSET);
@@ -95,13 +95,13 @@ static long init_record(struct dbCommon *pcommon, int pass)
recGblInitConstantLink(&prec->siol, DBF_USHORT, &prec->sval);
if(!(pdset = (bidset *)(prec->dset))) {
recGblRecordError(S_dev_noDSET,(void *)prec,"bi: init_record");
return(S_dev_noDSET);
recGblRecordError(S_dev_noDSET,(void *)prec,"bi: init_record");
return(S_dev_noDSET);
}
/* must have read_bi function defined */
if( (pdset->common.number < 5) || (pdset->read_bi == NULL) ) {
recGblRecordError(S_dev_missingSup,(void *)prec,"bi: init_record");
return(S_dev_missingSup);
recGblRecordError(S_dev_missingSup,(void *)prec,"bi: init_record");
return(S_dev_missingSup);
}
if( pdset->common.init_record ) {
if((status=(*pdset->common.init_record)(pcommon))) return(status);
@@ -116,37 +116,37 @@ static long process(struct dbCommon *pcommon)
{
struct biRecord *prec = (struct biRecord *)pcommon;
bidset *pdset = (bidset *)(prec->dset);
long status;
unsigned char pact=prec->pact;
long status;
unsigned char pact=prec->pact;
if( (pdset==NULL) || (pdset->read_bi==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_bi");
return(S_dev_missingSup);
}
if( (pdset==NULL) || (pdset->read_bi==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_bi");
return(S_dev_missingSup);
}
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
if(status==0) { /* convert rval to val */
if(prec->rval==0) prec->val =0;
else prec->val = 1;
prec->udf = FALSE;
}
else if(status==2) status=0;
/* check for alarms */
checkAlarms(prec);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
if(prec->rval==0) prec->val =0;
else prec->val = 1;
prec->udf = FALSE;
}
else if(status==2) status=0;
/* check for alarms */
checkAlarms(prec);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
@@ -171,29 +171,29 @@ static long special(DBADDR *paddr, int after)
static long get_enum_str(const DBADDR *paddr, char *pstring)
{
biRecord *prec=(biRecord *)paddr->precord;
int index;
unsigned short *pfield = (unsigned short *)paddr->pfield;
biRecord *prec=(biRecord *)paddr->precord;
int index;
unsigned short *pfield = (unsigned short *)paddr->pfield;
index = dbGetFieldIndex(paddr);
if(index!=biRecordVAL) {
strcpy(pstring,"Illegal_Value");
strcpy(pstring,"Illegal_Value");
} else if(*pfield==0) {
strncpy(pstring,prec->znam,sizeof(prec->znam));
pstring[sizeof(prec->znam)] = 0;
strncpy(pstring,prec->znam,sizeof(prec->znam));
pstring[sizeof(prec->znam)] = 0;
} else if(*pfield==1) {
strncpy(pstring,prec->onam,sizeof(prec->onam));
pstring[sizeof(prec->onam)] = 0;
strncpy(pstring,prec->onam,sizeof(prec->onam));
pstring[sizeof(prec->onam)] = 0;
} else {
strcpy(pstring,"Illegal_Value");
strcpy(pstring,"Illegal_Value");
}
return(0);
}
static long get_enum_strs(const DBADDR *paddr,struct dbr_enumStrs *pes)
{
biRecord *prec=(biRecord *)paddr->precord;
biRecord *prec=(biRecord *)paddr->precord;
pes->no_str = 2;
memset(pes->strs,'\0',sizeof(pes->strs));
@@ -218,52 +218,52 @@ static long put_enum_str(const DBADDR *paddr, const char *pstring)
static void checkAlarms(biRecord *prec)
{
unsigned short val = prec->val;
unsigned short val = prec->val;
if(prec->udf == TRUE){
recGblSetSevr(prec,UDF_ALARM,prec->udfs);
return;
}
if(prec->udf == TRUE){
recGblSetSevr(prec,UDF_ALARM,prec->udfs);
return;
}
if(val>1)return;
/* check for state alarm */
if (val == 0){
recGblSetSevr(prec,STATE_ALARM,prec->zsv);
}else{
recGblSetSevr(prec,STATE_ALARM,prec->osv);
}
if(val>1)return;
/* check for state alarm */
if (val == 0){
recGblSetSevr(prec,STATE_ALARM,prec->zsv);
}else{
recGblSetSevr(prec,STATE_ALARM,prec->osv);
}
/* check for cos alarm */
if(val == prec->lalm) return;
if(val == prec->lalm) return;
recGblSetSevr(prec,COS_ALARM,prec->cosv);
prec->lalm = val;
return;
prec->lalm = val;
return;
}
static void monitor(biRecord *prec)
{
unsigned short monitor_mask;
unsigned short monitor_mask;
monitor_mask = recGblResetAlarms(prec);
/* check for value change */
if (prec->mlst != prec->val){
/* post events for value change and archive change */
monitor_mask |= (DBE_VALUE | DBE_LOG);
/* update last value monitored */
prec->mlst = prec->val;
}
monitor_mask = recGblResetAlarms(prec);
/* check for value change */
if (prec->mlst != prec->val){
/* post events for value change and archive change */
monitor_mask |= (DBE_VALUE | DBE_LOG);
/* update last value monitored */
prec->mlst = prec->val;
}
/* send out monitors connected to the value field */
if (monitor_mask){
db_post_events(prec,&prec->val,monitor_mask);
}
if(prec->oraw!=prec->rval) {
db_post_events(prec,&prec->rval,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->oraw = prec->rval;
}
return;
/* send out monitors connected to the value field */
if (monitor_mask){
db_post_events(prec,&prec->val,monitor_mask);
}
if(prec->oraw!=prec->rval) {
db_post_events(prec,&prec->rval,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->oraw = prec->rval;
}
return;
}
static long readValue(biRecord *prec)
+164 -164
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recBo.c - Record Support Routines for Binary Output records */
@@ -60,24 +60,24 @@ static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
#define get_alarm_double NULL
rset boRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,boRSET);
@@ -105,15 +105,15 @@ static void myCallbackFunc(epicsCallback *arg)
prec=(boRecord *)pcallback->precord;
dbScanLock((struct dbCommon *)prec);
if(prec->pact) {
if((prec->val==1) && (prec->high>0)){
myCallback *pcallback;
pcallback = (myCallback *)(prec->rpvt);
if((prec->val==1) && (prec->high>0)){
myCallback *pcallback;
pcallback = (myCallback *)(prec->rpvt);
callbackSetPriority(prec->prio, &pcallback->callback);
callbackRequestDelayed(&pcallback->callback,(double)prec->high);
}
}
} else {
prec->val = 0;
dbProcess((struct dbCommon *)prec);
prec->val = 0;
dbProcess((struct dbCommon *)prec);
}
dbScanUnlock((struct dbCommon *)prec);
}
@@ -155,17 +155,17 @@ static long init_record(struct dbCommon *pcommon,int pass)
if (pdset->common.init_record) {
status=(*pdset->common.init_record)(pcommon);
if(status==0) {
if(prec->rval==0) prec->val = 0;
else prec->val = 1;
prec->udf = FALSE;
} else if (status==2) status=0;
if(status==0) {
if(prec->rval==0) prec->val = 0;
else prec->val = 1;
prec->udf = FALSE;
} else if (status==2) status=0;
}
prec->mlst = prec->val;
/* convert val to rval */
if ( prec->mask != 0 ) {
if(prec->val==0) prec->rval = 0;
else prec->rval = prec->mask;
if(prec->val==0) prec->rval = 0;
else prec->rval = prec->mask;
} else prec->rval = (epicsUInt32)prec->val;
prec->mlst = prec->val;
@@ -179,86 +179,86 @@ static long process(struct dbCommon *pcommon)
{
struct boRecord *prec = (struct boRecord *)pcommon;
bodset *pdset = (bodset *)(prec->dset);
long status=0;
unsigned char pact=prec->pact;
long status=0;
unsigned char pact=prec->pact;
if( (pdset==NULL) || (pdset->write_bo==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_bo");
return(S_dev_missingSup);
}
if (!prec->pact) {
if (!dbLinkIsConstant(&prec->dol) &&
prec->omsl == menuOmslclosed_loop) {
unsigned short val;
if( (pdset==NULL) || (pdset->write_bo==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_bo");
return(S_dev_missingSup);
}
if (!prec->pact) {
if (!dbLinkIsConstant(&prec->dol) &&
prec->omsl == menuOmslclosed_loop) {
unsigned short val;
prec->pact = TRUE;
status=dbGetLink(&prec->dol,DBR_USHORT, &val,0,0);
prec->pact = FALSE;
if(status==0){
prec->val = val;
prec->udf = FALSE;
}else {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
}
}
/* convert val to rval */
if ( prec->mask != 0 ) {
if(prec->val==0) prec->rval = 0;
else prec->rval = prec->mask;
} else prec->rval = (epicsUInt32)prec->val;
}
/* check for alarms */
checkAlarms(prec);
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
/* convert val to rval */
prec->val=prec->ivov;
if ( prec->mask != 0 ) {
if(prec->val==0) prec->rval = 0;
else prec->rval = prec->mask;
} else prec->rval = (epicsUInt32)prec->val;
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"bo:process Illegal IVOA field");
}
prec->pact = TRUE;
status=dbGetLink(&prec->dol,DBR_USHORT, &val,0,0);
prec->pact = FALSE;
if(status==0){
prec->val = val;
prec->udf = FALSE;
}else {
recGblSetSevr(prec,LINK_ALARM,INVALID_ALARM);
}
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
/* convert val to rval */
if ( prec->mask != 0 ) {
if(prec->val==0) prec->rval = 0;
else prec->rval = prec->mask;
} else prec->rval = (epicsUInt32)prec->val;
}
/* check for alarms */
checkAlarms(prec);
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
/* convert val to rval */
prec->val=prec->ivov;
if ( prec->mask != 0 ) {
if(prec->val==0) prec->rval = 0;
else prec->rval = prec->mask;
} else prec->rval = (epicsUInt32)prec->val;
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"bo:process Illegal IVOA field");
}
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, NULL);
if((prec->val==1) && (prec->high>0)){
myCallback *pcallback;
pcallback = (myCallback *)(prec->rpvt);
callbackSetPriority(prec->prio, &pcallback->callback);
callbackRequestDelayed(&pcallback->callback,(double)prec->high);
}
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
if((prec->val==1) && (prec->high>0)){
myCallback *pcallback;
pcallback = (myCallback *)(prec->rpvt);
callbackSetPriority(prec->prio, &pcallback->callback);
callbackRequestDelayed(&pcallback->callback,(double)prec->high);
}
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
@@ -267,17 +267,17 @@ static long special(DBADDR *paddr, int after)
int special_type = paddr->special;
switch(special_type) {
case(SPC_MOD):
if (dbGetFieldIndex(paddr) == boRecordSIMM) {
if (!after)
recGblSaveSimm(prec->sscn, &prec->oldsimm, prec->simm);
else
recGblCheckSimm((dbCommon *)prec, &prec->sscn, prec->oldsimm, prec->simm);
return(0);
}
default:
recGblDbaddrError(S_db_badChoice, paddr, "bo: special");
return(S_db_badChoice);
case(SPC_MOD):
if (dbGetFieldIndex(paddr) == boRecordSIMM) {
if (!after)
recGblSaveSimm(prec->sscn, &prec->oldsimm, prec->simm);
else
recGblCheckSimm((dbCommon *)prec, &prec->sscn, prec->oldsimm, prec->simm);
return(0);
}
default:
recGblDbaddrError(S_db_badChoice, paddr, "bo: special");
return(S_db_badChoice);
}
}
@@ -311,29 +311,29 @@ static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
static long get_enum_str(const DBADDR *paddr, char *pstring)
{
boRecord *prec=(boRecord *)paddr->precord;
int index;
unsigned short *pfield = (unsigned short *)paddr->pfield;
boRecord *prec=(boRecord *)paddr->precord;
int index;
unsigned short *pfield = (unsigned short *)paddr->pfield;
index = dbGetFieldIndex(paddr);
if(index!=indexof(VAL)) {
strcpy(pstring,"Illegal_Value");
strcpy(pstring,"Illegal_Value");
} else if(*pfield==0) {
strncpy(pstring,prec->znam,sizeof(prec->znam));
pstring[sizeof(prec->znam)] = 0;
strncpy(pstring,prec->znam,sizeof(prec->znam));
pstring[sizeof(prec->znam)] = 0;
} else if(*pfield==1) {
strncpy(pstring,prec->onam,sizeof(prec->onam));
pstring[sizeof(prec->onam)] = 0;
strncpy(pstring,prec->onam,sizeof(prec->onam));
pstring[sizeof(prec->onam)] = 0;
} else {
strcpy(pstring,"Illegal_Value");
strcpy(pstring,"Illegal_Value");
}
return(0);
}
static long get_enum_strs(const DBADDR *paddr,struct dbr_enumStrs *pes)
{
boRecord *prec=(boRecord *)paddr->precord;
boRecord *prec=(boRecord *)paddr->precord;
/*SETTING no_str=0 breaks channel access clients*/
pes->no_str = 2;
@@ -357,55 +357,55 @@ static long put_enum_str(const DBADDR *paddr, const char *pstring)
static void checkAlarms(boRecord *prec)
{
unsigned short val = prec->val;
unsigned short val = prec->val;
/* check for udf alarm */
if(prec->udf == TRUE ){
recGblSetSevr(prec,UDF_ALARM,prec->udfs);
}
/* check for udf alarm */
if(prec->udf == TRUE ){
recGblSetSevr(prec,UDF_ALARM,prec->udfs);
}
/* check for state alarm */
if (val == 0){
recGblSetSevr(prec,STATE_ALARM,prec->zsv);
}else{
recGblSetSevr(prec,STATE_ALARM,prec->osv);
}
/* check for state alarm */
if (val == 0){
recGblSetSevr(prec,STATE_ALARM,prec->zsv);
}else{
recGblSetSevr(prec,STATE_ALARM,prec->osv);
}
/* check for cos alarm */
if(val == prec->lalm) return;
recGblSetSevr(prec,COS_ALARM,prec->cosv);
prec->lalm = val;
return;
if(val == prec->lalm) return;
recGblSetSevr(prec,COS_ALARM,prec->cosv);
prec->lalm = val;
return;
}
static void monitor(boRecord *prec)
{
unsigned short monitor_mask;
unsigned short monitor_mask;
monitor_mask = recGblResetAlarms(prec);
/* check for value change */
if (prec->mlst != prec->val){
/* post events for value change and archive change */
monitor_mask |= (DBE_VALUE | DBE_LOG);
/* update last value monitored */
prec->mlst = prec->val;
}
monitor_mask = recGblResetAlarms(prec);
/* check for value change */
if (prec->mlst != prec->val){
/* post events for value change and archive change */
monitor_mask |= (DBE_VALUE | DBE_LOG);
/* update last value monitored */
prec->mlst = prec->val;
}
/* send out monitors connected to the value field */
if (monitor_mask){
db_post_events(prec,&prec->val,monitor_mask);
}
if(prec->oraw!=prec->rval) {
db_post_events(prec,&prec->rval,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->oraw = prec->rval;
}
if(prec->orbv!=prec->rbv) {
db_post_events(prec,&prec->rbv,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->orbv = prec->rbv;
}
return;
/* send out monitors connected to the value field */
if (monitor_mask){
db_post_events(prec,&prec->val,monitor_mask);
}
if(prec->oraw!=prec->rval) {
db_post_events(prec,&prec->rval,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->oraw = prec->rval;
}
if(prec->orbv!=prec->rbv) {
db_post_events(prec,&prec->rbv,
monitor_mask|DBE_VALUE|DBE_LOG);
prec->orbv = prec->rbv;
}
return;
}
static long writeValue(boRecord *prec)
+15 -15
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Record Support Routines for Calculation records */
@@ -206,7 +206,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
calcRecord *prec = (calcRecord *)paddr->precord;
int fieldIndex = dbGetFieldIndex(paddr);
int linkNumber;
switch (fieldIndex) {
case indexof(VAL):
case indexof(HIHI):
@@ -234,7 +234,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
{
calcRecord *prec = (calcRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
case indexof(HIHI):
@@ -281,24 +281,24 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
static void checkAlarms(calcRecord *prec, epicsTimeStamp *timeLast)
{
enum {
range_Lolo = 1,
range_Low,
range_Normal,
range_High,
range_Hihi
} alarmRange;
static const epicsEnum16 range_stat[] = {
SOFT_ALARM, LOLO_ALARM, LOW_ALARM,
NO_ALARM, HIGH_ALARM, HIHI_ALARM
};
enum {
range_Lolo = 1,
range_Low,
range_Normal,
range_High,
range_Hihi
} alarmRange;
static const epicsEnum16 range_stat[] = {
SOFT_ALARM, LOLO_ALARM, LOW_ALARM,
NO_ALARM, HIGH_ALARM, HIHI_ALARM
};
double val, hyst, lalm, alev, aftc, afvl;
epicsEnum16 asev;
if (prec->udf) {
recGblSetSevr(prec, UDF_ALARM, prec->udfs);
prec->afvl = 0;
prec->afvl = 0;
return;
}
+5 -5
View File
@@ -210,7 +210,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
prpvt->cbScheduled = 0;
prec->epvt = eventNameToHandle(prec->oevt);
if (pcalcoutDSET->common.init_record) pcalcoutDSET->common.init_record(pcommon);
prec->pval = prec->val;
prec->mlst = prec->val;
@@ -261,7 +261,7 @@ static long process(struct dbCommon *pcommon)
doOutput = (prec->val != 0.0);
break;
default:
doOutput = 0;
doOutput = 0;
break;
}
prec->pval = prec->val;
@@ -458,7 +458,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
calcoutRecord *prec = (calcoutRecord *)paddr->precord;
int fieldIndex = dbGetFieldIndex(paddr);
int linkNumber;
switch (fieldIndex) {
case indexof(VAL):
case indexof(HIHI):
@@ -474,7 +474,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
case indexof(ODLY):
recGblGetGraphicDouble(paddr,pgd);
pgd->lower_disp_limit = 0.0;
break;
break;
default:
linkNumber = get_linkNumber(fieldIndex);
if (linkNumber >= 0) {
@@ -490,7 +490,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
{
calcoutRecord *prec = (calcoutRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
case indexof(HIHI):
+24 -24
View File
@@ -2,17 +2,17 @@
* Copyright (c) 2002 Southeastern Universities Research Association, as
* Operator of Thomas Jefferson National Accelerator Facility.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recDfanout.c - Record Support Routines for Dfanout records */
/*
* Original Author: Matt Bickley (Sometime in 1994)
* Original Author: Matt Bickley (Sometime in 1994)
*
* Modification Log:
* -----------------
* .01 1994 mhb Started with longout record to make the data fanout
* .02 May 10, 96 jt Bug Fix
* .02 May 10, 96 jt Bug Fix
* .03 11SEP2000 mrk LONG=>DOUBLE, add SELL,SELN,SELM
*/
@@ -62,24 +62,24 @@ static long get_control_double(DBADDR *,struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *,struct dbr_alDouble *);
rset dfanoutRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,dfanoutRSET);
@@ -183,8 +183,8 @@ static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
case indexof(LALM):
case indexof(ALST):
case indexof(MLST):
pcd->upper_ctrl_limit = prec->hopr;
pcd->lower_ctrl_limit = prec->lopr;
pcd->upper_ctrl_limit = prec->hopr;
pcd->lower_ctrl_limit = prec->lopr;
break;
default:
recGblGetControlDouble(paddr,pcd);
@@ -194,7 +194,7 @@ static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
{
dfanoutRecord *prec=(dfanoutRecord *)paddr->precord;
if(dbGetFieldIndex(paddr) == indexof(VAL)) {
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
+33 -33
View File
@@ -59,24 +59,24 @@ static long special(DBADDR *, int);
#define get_alarm_double NULL
rset eventRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,eventRSET);
@@ -96,7 +96,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
recGblInitConstantLink(&prec->siol, DBF_STRING, &prec->sval);
if( (pdset=(eventdset *)(prec->dset)) && (pdset->common.init_record) )
status=(*pdset->common.init_record)(pcommon);
status=(*pdset->common.init_record)(pcommon);
prec->epvt = eventNameToHandle(prec->val);
@@ -107,27 +107,27 @@ static long process(struct dbCommon *pcommon)
{
struct eventRecord *prec = (struct eventRecord *)pcommon;
eventdset *pdset = (eventdset *)(prec->dset);
long status=0;
unsigned char pact=prec->pact;
long status=0;
unsigned char pact=prec->pact;
if((pdset!=NULL) && (pdset->common.number >= 5) && pdset->read_event )
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
if((pdset!=NULL) && (pdset->common.number >= 5) && pdset->read_event )
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
postEvent(prec->epvt);
postEvent(prec->epvt);
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
/* check event list */
monitor(prec);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
+1 -1
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* histogramRecord.c - Record Support Routines for Histogram records */
+48 -48
View File
@@ -4,13 +4,13 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* int64inRecord.c - Record Support Routines for int64in records */
/*
* Original Author: Janet Anderson
* Date: 9/23/91
* Date: 9/23/91
*/
#include <stddef.h>
@@ -58,27 +58,27 @@ static long get_units(DBADDR *, char *);
#define put_enum_str NULL
static long get_graphic_double(DBADDR *, struct dbr_grDouble *);
static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
rset int64inRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,int64inRSET);
@@ -101,13 +101,13 @@ static long init_record(dbCommon *pcommon, int pass)
recGblInitConstantLink(&prec->siol, DBF_INT64, &prec->sval);
if(!(pdset = (int64indset *)(prec->dset))) {
recGblRecordError(S_dev_noDSET,(void *)prec,"int64in: init_record");
return(S_dev_noDSET);
recGblRecordError(S_dev_noDSET,(void *)prec,"int64in: init_record");
return(S_dev_noDSET);
}
/* must have read_int64in function defined */
if ((pdset->common.number < 5) || (pdset->read_int64in == NULL)) {
recGblRecordError(S_dev_missingSup,(void *)prec,"int64in: init_record");
return(S_dev_missingSup);
recGblRecordError(S_dev_missingSup,(void *)prec,"int64in: init_record");
return(S_dev_missingSup);
}
if (pdset->common.init_record) {
if ((status = pdset->common.init_record(pcommon))) return status;
@@ -122,35 +122,35 @@ static long process(dbCommon *pcommon)
{
int64inRecord *prec = (int64inRecord*)pcommon;
int64indset *pdset = (int64indset *)(prec->dset);
long status;
unsigned char pact=prec->pact;
epicsTimeStamp timeLast;
long status;
unsigned char pact=prec->pact;
epicsTimeStamp timeLast;
if( (pdset==NULL) || (pdset->read_int64in==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_int64in");
return(S_dev_missingSup);
}
timeLast = prec->time;
if( (pdset==NULL) || (pdset->read_int64in==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_int64in");
return(S_dev_missingSup);
}
timeLast = prec->time;
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
if (status==0) prec->udf = FALSE;
/* check for alarms */
checkAlarms(prec, &timeLast);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
/* check for alarms */
checkAlarms(prec, &timeLast);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
@@ -231,7 +231,7 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
return(0);
}
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
{
int64inRecord *prec=(int64inRecord *)paddr->precord;
@@ -257,7 +257,7 @@ static void checkAlarms(int64inRecord *prec, epicsTimeStamp *timeLast)
SOFT_ALARM, LOLO_ALARM, LOW_ALARM,
NO_ALARM, HIGH_ALARM, HIHI_ALARM
};
double aftc, afvl;
epicsInt64 val, hyst, lalm;
epicsInt64 alev;
+85 -85
View File
@@ -9,8 +9,8 @@
/*
* Original Author: Janet Anderson
* Date: 9/23/91
*/
* Date: 9/23/91
*/
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -58,24 +58,24 @@ static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
rset int64outRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,int64outRSET);
@@ -97,17 +97,17 @@ static long init_record(dbCommon *pcommon, int pass)
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
if(!(pdset = (int64outdset *)(prec->dset))) {
recGblRecordError(S_dev_noDSET,(void *)prec,"int64out: init_record");
return(S_dev_noDSET);
recGblRecordError(S_dev_noDSET,(void *)prec,"int64out: init_record");
return(S_dev_noDSET);
}
/* must have write_int64out functions defined */
if ((pdset->common.number < 5) || (pdset->write_int64out == NULL)) {
recGblRecordError(S_dev_missingSup,(void *)prec,"int64out: init_record");
return(S_dev_missingSup);
recGblRecordError(S_dev_missingSup,(void *)prec,"int64out: init_record");
return(S_dev_missingSup);
}
if (prec->dol.type == CONSTANT) {
if(recGblInitConstantLink(&prec->dol,DBF_INT64,&prec->val))
prec->udf=FALSE;
if(recGblInitConstantLink(&prec->dol,DBF_INT64,&prec->val))
prec->udf=FALSE;
}
if (pdset->common.init_record) {
if ((status = pdset->common.init_record(pcommon))) return status;
@@ -122,68 +122,68 @@ static long process(dbCommon *pcommon)
{
int64outRecord *prec = (int64outRecord*)pcommon;
int64outdset *pdset = (int64outdset *)(prec->dset);
long status=0;
epicsInt64 value;
unsigned char pact=prec->pact;
long status=0;
epicsInt64 value;
unsigned char pact=prec->pact;
if( (pdset==NULL) || (pdset->write_int64out==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_int64out");
return(S_dev_missingSup);
}
if (!prec->pact) {
if((prec->dol.type != CONSTANT)
if( (pdset==NULL) || (pdset->write_int64out==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_int64out");
return(S_dev_missingSup);
}
if (!prec->pact) {
if((prec->dol.type != CONSTANT)
&& (prec->omsl == menuOmslclosed_loop)) {
status = dbGetLink(&(prec->dol),DBR_INT64,
&value,0,0);
if (prec->dol.type!=CONSTANT && RTN_SUCCESS(status))
prec->udf=FALSE;
}
else {
value = prec->val;
}
if (!status) convert(prec,value);
}
/* check for alarms */
checkAlarms(prec);
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
prec->val=prec->ivov;
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"int64out:process Illegal IVOA field");
}
status = dbGetLink(&(prec->dol),DBR_INT64,
&value,0,0);
if (prec->dol.type!=CONSTANT && RTN_SUCCESS(status))
prec->udf=FALSE;
}
else {
value = prec->val;
}
if (!status) convert(prec,value);
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
/* check for alarms */
checkAlarms(prec);
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
prec->val=prec->ivov;
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"int64out:process Illegal IVOA field");
}
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, NULL);
/* check event list */
monitor(prec);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
@@ -221,7 +221,7 @@ static long get_units(DBADDR *paddr,char *units)
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
{
int64outRecord *prec=(int64outRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
case indexof(HIHI):
@@ -410,9 +410,9 @@ static long writeValue(int64outRecord *prec)
static void convert(int64outRecord *prec, epicsInt64 value)
{
/* check drive limits */
if(prec->drvh > prec->drvl) {
if (value > prec->drvh) value = prec->drvh;
else if (value < prec->drvl) value = prec->drvl;
}
prec->val = value;
if(prec->drvh > prec->drvl) {
if (value > prec->drvh) value = prec->drvh;
else if (value < prec->drvl) value = prec->drvl;
}
prec->val = value;
}
+46 -46
View File
@@ -4,13 +4,13 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recLongin.c - Record Support Routines for Longin records */
/*
* Author: Janet Anderson
* Date: 9/23/91
* Author: Janet Anderson
* Date: 9/23/91
*/
#include <stddef.h>
@@ -59,27 +59,27 @@ static long get_units(DBADDR *, char *);
#define put_enum_str NULL
static long get_graphic_double(DBADDR *, struct dbr_grDouble *);
static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
rset longinRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,longinRSET);
@@ -126,35 +126,35 @@ static long process(struct dbCommon *pcommon)
{
struct longinRecord *prec = (struct longinRecord *)pcommon;
longindset *pdset = (longindset *)(prec->dset);
long status;
unsigned char pact=prec->pact;
epicsTimeStamp timeLast;
long status;
unsigned char pact=prec->pact;
epicsTimeStamp timeLast;
if( (pdset==NULL) || (pdset->read_longin==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_longin");
return(S_dev_missingSup);
}
timeLast = prec->time;
if( (pdset==NULL) || (pdset->read_longin==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_longin");
return(S_dev_missingSup);
}
timeLast = prec->time;
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
if (status==0) prec->udf = FALSE;
/* check for alarms */
checkAlarms(prec, &timeLast);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
/* check for alarms */
checkAlarms(prec, &timeLast);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
@@ -236,7 +236,7 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
return(0);
}
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
{
longinRecord *prec=(longinRecord *)paddr->precord;
@@ -253,7 +253,7 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
static void checkAlarms(longinRecord *prec, epicsTimeStamp *timeLast)
{
enum {
enum {
range_Lolo = 1,
range_Low,
range_Normal,
@@ -264,7 +264,7 @@ static void checkAlarms(longinRecord *prec, epicsTimeStamp *timeLast)
SOFT_ALARM, LOLO_ALARM, LOW_ALARM,
NO_ALARM, HIGH_ALARM, HIHI_ALARM
};
double aftc, afvl;
epicsInt32 val, hyst, lalm;
epicsInt32 alev;
+81 -81
View File
@@ -4,13 +4,13 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Janet Anderson
* Date: 9/23/91
*/
* Author: Janet Anderson
* Date: 9/23/91
*/
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -59,24 +59,24 @@ static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
rset longoutRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,longoutRSET);
@@ -125,67 +125,67 @@ static long process(struct dbCommon *pcommon)
{
struct longoutRecord *prec = (struct longoutRecord *)pcommon;
longoutdset *pdset = (longoutdset *)(prec->dset);
long status=0;
epicsInt32 value;
unsigned char pact=prec->pact;
long status=0;
epicsInt32 value;
unsigned char pact=prec->pact;
if( (pdset==NULL) || (pdset->write_longout==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_longout");
return(S_dev_missingSup);
}
if (!prec->pact) {
if (!dbLinkIsConstant(&prec->dol) &&
prec->omsl == menuOmslclosed_loop) {
status = dbGetLink(&prec->dol, DBR_LONG, &value, 0, 0);
if (!dbLinkIsConstant(&prec->dol) && !status)
prec->udf=FALSE;
}
else {
value = prec->val;
}
if (!status) convert(prec,value);
}
/* check for alarms */
checkAlarms(prec);
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
prec->val=prec->ivov;
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"longout:process Illegal IVOA field");
}
if( (pdset==NULL) || (pdset->write_longout==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_longout");
return(S_dev_missingSup);
}
if (!prec->pact) {
if (!dbLinkIsConstant(&prec->dol) &&
prec->omsl == menuOmslclosed_loop) {
status = dbGetLink(&prec->dol, DBR_LONG, &value, 0, 0);
if (!dbLinkIsConstant(&prec->dol) && !status)
prec->udf=FALSE;
}
else {
value = prec->val;
}
if (!status) convert(prec,value);
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
/* check for alarms */
checkAlarms(prec);
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
prec->val=prec->ivov;
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"longout:process Illegal IVOA field");
}
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, NULL);
/* check event list */
monitor(prec);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
@@ -223,7 +223,7 @@ static long get_units(DBADDR *paddr,char *units)
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
{
longoutRecord *prec=(longoutRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
case indexof(HIHI):
@@ -414,9 +414,9 @@ static long writeValue(longoutRecord *prec)
static void convert(longoutRecord *prec, epicsInt32 value)
{
/* check drive limits */
if(prec->drvh > prec->drvl) {
if (value > prec->drvh) value = prec->drvh;
else if (value < prec->drvl) value = prec->drvl;
}
prec->val = value;
if(prec->drvh > prec->drvl) {
if (value > prec->drvh) value = prec->drvh;
else if (value < prec->drvl) value = prec->drvl;
}
prec->val = value;
}
@@ -197,7 +197,7 @@ static long special(DBADDR *paddr, int after)
static long get_precision(const DBADDR *paddr,long *precision)
{
mbbiDirectRecord *prec=(mbbiDirectRecord *)paddr->precord;
mbbiDirectRecord *prec=(mbbiDirectRecord *)paddr->precord;
if(dbGetFieldIndex(paddr)==mbbiDirectRecordVAL)
*precision = prec->nobt;
else
+1 -1
View File
@@ -5,7 +5,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -305,7 +305,7 @@ static long special(DBADDR *paddr, int after)
static long get_precision(const DBADDR *paddr,long *precision)
{
mbboDirectRecord *prec=(mbboDirectRecord *)paddr->precord;
mbboDirectRecord *prec=(mbboDirectRecord *)paddr->precord;
if(dbGetFieldIndex(paddr)==mbboDirectRecordVAL)
*precision = prec->nobt;
else
+1 -1
View File
@@ -5,7 +5,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* mbboRecord.c - Record Support Routines for multi bit binary Output records */
+22 -22
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recPermissive.c - Record Support Routines for Permissive records */
@@ -53,24 +53,24 @@ static long process(struct dbCommon *);
#define get_alarm_double NULL
rset permissiveRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,permissiveRSET);
@@ -104,12 +104,12 @@ static void monitor(permissiveRecord *prec)
prec->oval = val;
prec->oflg = wflg;
if(oval != val) {
db_post_events(prec,&prec->val,
monitor_mask|DBE_VALUE|DBE_LOG);
db_post_events(prec,&prec->val,
monitor_mask|DBE_VALUE|DBE_LOG);
}
if(oflg != wflg) {
db_post_events(prec,&prec->wflg,
monitor_mask|DBE_VALUE|DBE_LOG);
monitor_mask|DBE_VALUE|DBE_LOG);
}
return;
}
+5 -5
View File
@@ -2,7 +2,7 @@
* Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Printf record type */
@@ -130,7 +130,7 @@ static void doPrintf(printfRecord *prec)
flags |= F_BADLNK;
break;
case 'h':
if (flags & (F_LONGLONG | F_LONG | F_CHAR))
if (flags & (F_LONGLONG | F_LONG | F_CHAR))
flags |= F_BADFMT;
else if (flags & F_SHORT)
flags = (flags & ~F_SHORT) | F_CHAR;
@@ -138,11 +138,11 @@ static void doPrintf(printfRecord *prec)
flags |= F_SHORT;
break;
case 'l':
if (flags & (F_LONGLONG | F_SHORT | F_CHAR))
if (flags & (F_LONGLONG | F_SHORT | F_CHAR))
flags |= F_BADFMT;
else if (flags & F_LONG)
else if (flags & F_LONG)
flags = (flags & ~F_LONG) | F_LONGLONG;
else
else
flags |= F_LONG;
break;
default:
+59 -59
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* selRecord.c - Record Support Routines for Select records */
@@ -55,28 +55,28 @@ static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
rset selRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,selRSET);
#define SEL_MAX 12
#define SEL_MAX 12
static void checkAlarms(selRecord *);
static void do_sel(selRecord *);
@@ -111,7 +111,7 @@ static long process(struct dbCommon *pcommon)
struct selRecord *prec = (struct selRecord *)pcommon;
prec->pact = TRUE;
if ( RTN_SUCCESS(fetch_values(prec)) ) {
do_sel(prec);
do_sel(prec);
}
recGblGetTimeStamp(prec);
@@ -134,7 +134,7 @@ static long process(struct dbCommon *pcommon)
static long get_units(DBADDR *paddr, char *units)
{
selRecord *prec=(selRecord *)paddr->precord;
selRecord *prec=(selRecord *)paddr->precord;
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
strncpy(units,prec->egu,DB_UNITS_SIZE);
@@ -144,7 +144,7 @@ static long get_units(DBADDR *paddr, char *units)
static long get_precision(const DBADDR *paddr, long *precision)
{
selRecord *prec=(selRecord *)paddr->precord;
selRecord *prec=(selRecord *)paddr->precord;
double *pvalue,*plvalue;
int i;
@@ -155,10 +155,10 @@ static long get_precision(const DBADDR *paddr, long *precision)
pvalue = &prec->a;
plvalue = &prec->la;
for(i=0; i<SEL_MAX; i++, pvalue++, plvalue++) {
if(paddr->pfield==(void *)&pvalue
|| paddr->pfield==(void *)&plvalue){
return(0);
}
if(paddr->pfield==(void *)&pvalue
|| paddr->pfield==(void *)&plvalue){
return(0);
}
}
recGblGetPrec(paddr,precision);
return(0);
@@ -167,9 +167,9 @@ static long get_precision(const DBADDR *paddr, long *precision)
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
{
selRecord *prec=(selRecord *)paddr->precord;
selRecord *prec=(selRecord *)paddr->precord;
int index = dbGetFieldIndex(paddr);
switch (index) {
case indexof(VAL):
case indexof(HIHI):
@@ -201,9 +201,9 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd)
{
selRecord *prec=(selRecord *)paddr->precord;
selRecord *prec=(selRecord *)paddr->precord;
int index = dbGetFieldIndex(paddr);
switch (index) {
case indexof(VAL):
case indexof(HIHI):
@@ -235,7 +235,7 @@ static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd)
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
{
selRecord *prec=(selRecord *)paddr->precord;
selRecord *prec=(selRecord *)paddr->precord;
if(dbGetFieldIndex(paddr) == indexof(VAL)) {
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
@@ -305,9 +305,9 @@ static void checkAlarms(selRecord *prec)
static void monitor(selRecord *prec)
{
unsigned monitor_mask;
double *pnew;
double *pprev;
int i;
double *pnew;
double *pprev;
int i;
monitor_mask = recGblResetAlarms(prec);
@@ -325,27 +325,27 @@ static void monitor(selRecord *prec)
/* trigger monitors of the SELN field */
if (prec->nlst != prec->seln) {
prec->nlst = prec->seln;
db_post_events(prec, &prec->seln, monitor_mask);
prec->nlst = prec->seln;
db_post_events(prec, &prec->seln, monitor_mask);
}
/* check all input fields for changes, even if VAL hasn't changed */
for(i=0, pnew=&prec->a, pprev=&prec->la; i<SEL_MAX; i++, pnew++, pprev++) {
if(*pnew != *pprev) {
db_post_events(prec, pnew, monitor_mask);
*pprev = *pnew;
}
if(*pnew != *pprev) {
db_post_events(prec, pnew, monitor_mask);
*pprev = *pnew;
}
}
return;
}
static void do_sel(selRecord *prec)
{
double *pvalue;
double order[SEL_MAX];
unsigned short count;
unsigned short i,j;
double val;
double *pvalue;
double order[SEL_MAX];
unsigned short count;
unsigned short i,j;
double val;
/* selection mechanism */
pvalue = &prec->a;
@@ -409,29 +409,29 @@ static void do_sel(selRecord *prec)
*/
static int fetch_values(selRecord *prec)
{
struct link *plink;
double *pvalue;
int i;
long status;
struct link *plink;
double *pvalue;
int i;
long status;
plink = &prec->inpa;
pvalue = &prec->a;
/* If mechanism is selSELM_Specified, only get the selected input*/
if(prec->selm == selSELM_Specified) {
/* fetch the select index */
status=dbGetLink(&(prec->nvl),DBR_USHORT,&(prec->seln),0,0);
if (!RTN_SUCCESS(status) || (prec->seln >= SEL_MAX))
return(status);
/* fetch the select index */
status=dbGetLink(&(prec->nvl),DBR_USHORT,&(prec->seln),0,0);
if (!RTN_SUCCESS(status) || (prec->seln >= SEL_MAX))
return(status);
plink += prec->seln;
pvalue += prec->seln;
plink += prec->seln;
pvalue += prec->seln;
status=dbGetLink(plink,DBR_DOUBLE, pvalue,0,0);
return(status);
status=dbGetLink(plink,DBR_DOUBLE, pvalue,0,0);
return(status);
}
/* fetch all inputs*/
for(i=0; i<SEL_MAX; i++, plink++, pvalue++) {
status=dbGetLink(plink,DBR_DOUBLE, pvalue,0,0);
status=dbGetLink(plink,DBR_DOUBLE, pvalue,0,0);
}
return(status);
}
+5 -5
View File
@@ -4,12 +4,12 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: John Winans
* Date: 09-21-92
* Author: John Winans
* Date: 09-21-92
*/
#include <stddef.h>
#include <stdlib.h>
@@ -321,7 +321,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
{
seqRecord *prec = (seqRecord *) paddr->precord;
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY1);
if (fieldOffset >= 0)
switch (fieldOffset & 2) {
case 0: /* DLYn */
+29 -29
View File
@@ -4,13 +4,13 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recState.c - Record Support Routines for State records */
/*
* Original Author: Bob Dalesio
* Date: 10-10-90
* Date: 10-10-90
*/
#include <stddef.h>
@@ -55,24 +55,24 @@ static long process(struct dbCommon *);
#define get_alarm_double NULL
rset stateRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,stateRSET);
@@ -95,14 +95,14 @@ static long process(struct dbCommon *pcommon)
{
struct stateRecord *prec = (struct stateRecord *)pcommon;
prec->udf = FALSE;
prec->pact=TRUE;
recGblGetTimeStamp(prec);
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(0);
prec->udf = FALSE;
prec->pact=TRUE;
recGblGetTimeStamp(prec);
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(0);
}
static void monitor(stateRecord *prec)
@@ -113,7 +113,7 @@ static void monitor(stateRecord *prec)
monitor_mask = recGblResetAlarms(prec);
if(strncmp(prec->oval,prec->val,sizeof(prec->val))) {
db_post_events(prec,&(prec->val[0]),monitor_mask|DBE_VALUE|DBE_LOG);
strncpy(prec->oval,prec->val,sizeof(prec->oval));
strncpy(prec->oval,prec->val,sizeof(prec->oval));
}
return;
}
+37 -37
View File
@@ -4,13 +4,13 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recStringin.c - Record Support Routines for Stringin records */
/*
* Author: Janet Anderson
* Date: 4/23/91
* Author: Janet Anderson
* Date: 4/23/91
*/
@@ -59,24 +59,24 @@ static long special(DBADDR *, int);
#define get_alarm_double NULL
rset stringinRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,stringinRSET);
@@ -123,29 +123,29 @@ static long process(struct dbCommon *pcommon)
{
struct stringinRecord *prec = (struct stringinRecord *)pcommon;
stringindset *pdset = (stringindset *)(prec->dset);
long status;
unsigned char pact=prec->pact;
long status;
unsigned char pact=prec->pact;
if( (pdset==NULL) || (pdset->read_stringin==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_stringin");
return(S_dev_missingSup);
}
if( (pdset==NULL) || (pdset->read_stringin==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"read_stringin");
return(S_dev_missingSup);
}
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
status=readValue(prec); /* read the new value */
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
/* check event list */
monitor(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
+64 -64
View File
@@ -4,14 +4,14 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recStringout.c - Record Support Routines for Stringout records */
/*
* Author: Janet Anderson
* Date: 4/23/91
*/
* Author: Janet Anderson
* Date: 4/23/91
*/
#include <stddef.h>
@@ -61,24 +61,24 @@ static long special(DBADDR *, int);
#define get_alarm_double NULL
rset stringoutRSET={
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
RSETNUMBER,
report,
initialize,
init_record,
process,
special,
get_value,
cvt_dbaddr,
get_array_info,
put_array_info,
get_units,
get_precision,
get_enum_str,
get_enum_strs,
put_enum_str,
get_graphic_double,
get_control_double,
get_alarm_double
};
epicsExportAddress(rset,stringoutRSET);
@@ -126,58 +126,58 @@ static long process(struct dbCommon *pcommon)
{
struct stringoutRecord *prec = (struct stringoutRecord *)pcommon;
stringoutdset *pdset = (stringoutdset *)(prec->dset);
long status=0;
unsigned char pact=prec->pact;
long status=0;
unsigned char pact=prec->pact;
if( (pdset==NULL) || (pdset->write_stringout==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_stringout");
return(S_dev_missingSup);
}
if (!prec->pact &&
!dbLinkIsConstant(&prec->dol) &&
prec->omsl == menuOmslclosed_loop) {
status = dbGetLink(&prec->dol, DBR_STRING, prec->val, 0, 0);
if (!dbLinkIsConstant(&prec->dol) && !status)
prec->udf=FALSE;
}
if( (pdset==NULL) || (pdset->write_stringout==NULL) ) {
prec->pact=TRUE;
recGblRecordError(S_dev_missingSup,(void *)prec,"write_stringout");
return(S_dev_missingSup);
}
if (!prec->pact &&
!dbLinkIsConstant(&prec->dol) &&
prec->omsl == menuOmslclosed_loop) {
status = dbGetLink(&prec->dol, DBR_STRING, prec->val, 0, 0);
if (!dbLinkIsConstant(&prec->dol) && !status)
prec->udf=FALSE;
}
if(prec->udf == TRUE ){
recGblSetSevr(prec,UDF_ALARM,prec->udfs);
}
if(prec->udf == TRUE ){
recGblSetSevr(prec,UDF_ALARM,prec->udfs);
}
if (prec->nsev < INVALID_ALARM )
if (prec->nsev < INVALID_ALARM )
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
else {
switch (prec->ivoa) {
case (menuIvoaContinue_normally) :
status=writeValue(prec); /* write the new value */
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
strncpy(prec->val, prec->ivov, sizeof(prec->val));
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"stringout:process Illegal IVOA field");
break;
case (menuIvoaDon_t_drive_outputs) :
break;
case (menuIvoaSet_output_to_IVOV) :
if(prec->pact == FALSE){
strncpy(prec->val, prec->ivov, sizeof(prec->val));
}
status=writeValue(prec); /* write the new value */
break;
default :
status=-1;
recGblRecordError(S_db_badField,(void *)prec,
"stringout:process Illegal IVOA field");
}
}
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
/* check if device support set pact */
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
prec->pact = TRUE;
recGblGetTimeStampSimm(prec, prec->simm, NULL);
monitor(prec);
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
monitor(prec);
recGblFwdLink(prec);
prec->pact=FALSE;
return(status);
}
static long special(DBADDR *paddr, int after)
+4 -4
View File
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Record Support Routines for Subroutine records */
@@ -241,7 +241,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
subRecord *prec = (subRecord *)paddr->precord;
int fieldIndex = dbGetFieldIndex(paddr);
int linkNumber;
switch (fieldIndex) {
case indexof(VAL):
case indexof(HIHI):
@@ -269,7 +269,7 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
{
subRecord *prec = (subRecord *)paddr->precord;
switch (dbGetFieldIndex(paddr)) {
case indexof(VAL):
case indexof(HIHI):
@@ -308,7 +308,7 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
&pad->upper_warning_limit,
&pad->upper_alarm_limit);
} else
recGblGetAlarmDouble(paddr, pad);
recGblGetAlarmDouble(paddr, pad);
}
return 0;
}
@@ -3,7 +3,7 @@
# Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
# in file LICENSE that is included with this distribution.
#*************************************************************************
use strict;
@@ -7,7 +7,7 @@
* found in the file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Andrew Johnson Date: 2003-04-08 */
/* Author: Andrew Johnson Date: 2003-04-08 */
#include <iostream>
#include <string>
@@ -212,7 +212,7 @@ int main(int argc, char *argv[])
std::cout<<"# End "<<argv[optind]<<"\n";
epicsThreadSleep(0.2);
loadedDb = true; /* Give it the benefit of the doubt... */
loadedDb = true; /* Give it the benefit of the doubt... */
}
if (loadedDb) {