jba added pass test to init_record and changed cvt_dbaddr
This commit is contained in:
+4
-1
@@ -141,12 +141,15 @@ void convert();
|
||||
long cvtRawToEngBpt();
|
||||
void monitor();
|
||||
|
||||
static long init_record(pai)
|
||||
static long init_record(pai,pass)
|
||||
struct aiRecord *pai;
|
||||
int pass;
|
||||
{
|
||||
struct aidset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct aidset *)(pai->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pai,"ai: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+4
-1
@@ -136,13 +136,16 @@ long cvtEngToRawBpt();
|
||||
void monitor();
|
||||
|
||||
|
||||
static long init_record(pao)
|
||||
static long init_record(pao,pass)
|
||||
struct aoRecord *pao;
|
||||
int pass;
|
||||
{
|
||||
struct aodset *pdset;
|
||||
long status=0;
|
||||
double value;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct aodset *)(pao->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pao,"ao: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+4
-1
@@ -116,12 +116,15 @@ struct bidset { /* binary input dset */
|
||||
void alarm();
|
||||
void monitor();
|
||||
|
||||
static long init_record(pbi)
|
||||
static long init_record(pbi,pass)
|
||||
struct biRecord *pbi;
|
||||
int pass;
|
||||
{
|
||||
struct bidset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct bidset *)(pbi->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pbi,"bi: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+4
-1
@@ -154,13 +154,16 @@ static void myCallback(pcallback)
|
||||
dbScanUnlock((struct dbCommon *)pbo);
|
||||
}
|
||||
|
||||
static long init_record(pbo)
|
||||
static long init_record(pbo,pass)
|
||||
struct boRecord *pbo;
|
||||
int pass;
|
||||
{
|
||||
struct bodset *pdset;
|
||||
long status=0;
|
||||
struct callback *pcallback;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct bodset *)(pbo->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pbo,"bo: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+4
-1
@@ -133,8 +133,9 @@ long dbCaGetLink();
|
||||
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
|
||||
|
||||
|
||||
static long init_record(pcalc)
|
||||
static long init_record(pcalc,pass)
|
||||
struct calcRecord *pcalc;
|
||||
int pass;
|
||||
{
|
||||
long status;
|
||||
struct link *plink;
|
||||
@@ -143,6 +144,8 @@ static long init_record(pcalc)
|
||||
short error_number;
|
||||
char rpbuf[80];
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
plink = &pcalc->inpa;
|
||||
pvalue = &pcalc->a;
|
||||
for(i=0; i<ARG_MAX; i++, plink++, pvalue++) {
|
||||
|
||||
@@ -122,17 +122,18 @@ int compress_array();
|
||||
int compress_scalar();
|
||||
int array_average();
|
||||
|
||||
static long init_record(pcompress)
|
||||
static long init_record(pcompress,pass)
|
||||
struct compressRecord *pcompress;
|
||||
int pass;
|
||||
{
|
||||
|
||||
/* This routine may get called twice. Once by cvt_dbaddr. Once by iocInit*/
|
||||
if(pcompress->bptr==NULL) {
|
||||
if (pass==0){
|
||||
pcompress->bptr = (double *)calloc(pcompress->nsam,sizeof(double));
|
||||
/* allocate memory for the summing buffer for conversions requiring it */
|
||||
if (pcompress->alg == AVERAGE){
|
||||
pcompress->sptr = (double *)calloc(pcompress->nsam,sizeof(double));
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
if(pcompress->wptr==NULL && pcompress->inp.type==DB_LINK) {
|
||||
struct dbAddr *pdbAddr = (struct dbAddr *)(pcompress->inp.value.db_link.pdbAddr);
|
||||
@@ -231,9 +232,6 @@ static long cvt_dbaddr(paddr)
|
||||
{
|
||||
struct compressRecord *pcompress=(struct compressRecord *)paddr->precord;
|
||||
|
||||
/* This may get called before init_record. If so just call it*/
|
||||
if(pcompress->bptr==NULL) (void)init_record(pcompress);
|
||||
|
||||
paddr->pfield = (void *)(pcompress->bptr);
|
||||
paddr->no_elements = pcompress->nsam;
|
||||
paddr->field_type = DBF_DOUBLE;
|
||||
|
||||
+4
-1
@@ -99,12 +99,15 @@ struct eventdset { /* event input dset */
|
||||
};
|
||||
void monitor();
|
||||
|
||||
static long init_record(pevent)
|
||||
static long init_record(pevent,pass)
|
||||
struct eventRecord *pevent;
|
||||
int pass;
|
||||
{
|
||||
struct eventdset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if( (pdset=(struct eventdset *)(pevent->dset)) && (pdset->init_record) )
|
||||
status=(*pdset->init_record)(pevent);
|
||||
return(status);
|
||||
|
||||
+6
-4
@@ -104,12 +104,14 @@ long dbCaAddInlink();
|
||||
long dbCaGetLink();
|
||||
|
||||
|
||||
static long init_record(pfanout)
|
||||
struct fanoutRecord *pfanout;
|
||||
static long init_record(pfanout,pass)
|
||||
struct fanoutRecord *pfanout;
|
||||
int pass;
|
||||
{
|
||||
|
||||
/* Added for Channel Access Links */
|
||||
long status;
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
/* get link selection if sell is a constant and nonzero*/
|
||||
if (pfanout->sell.type==CONSTANT && pfanout->sell.value.value!=0 ){
|
||||
|
||||
@@ -147,8 +147,9 @@ static void wdCallback(pcallback)
|
||||
return;
|
||||
}
|
||||
|
||||
static long init_record(phistogram)
|
||||
struct histogramRecord *phistogram;
|
||||
static long init_record(phistogram,pass)
|
||||
struct histogramRecord *phistogram;
|
||||
int pass;
|
||||
{
|
||||
struct histogramdset *pdset;
|
||||
long status;
|
||||
@@ -156,6 +157,8 @@ static long init_record(phistogram)
|
||||
float wait_time;
|
||||
void (*process)();
|
||||
|
||||
if (pass==0){
|
||||
|
||||
/* This routine may get called twice. Once by cvt_dbaddr. Once by iocInit*/
|
||||
|
||||
pcallback->process = process;
|
||||
@@ -194,6 +197,8 @@ static long init_record(phistogram)
|
||||
recGblRecordError(S_dev_missingSup,phistogram,"histogram: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* call device support init_record */
|
||||
if( pdset->init_record ) {
|
||||
@@ -328,8 +333,6 @@ static long cvt_dbaddr(paddr)
|
||||
{
|
||||
struct histogramRecord *phistogram=(struct histogramRecord *)paddr->precord;
|
||||
|
||||
/* This may get called before init_record. If so just call it*/
|
||||
if(phistogram->bptr==NULL) init_record(phistogram);
|
||||
paddr->pfield = (void *)(phistogram->bptr);
|
||||
paddr->no_elements = phistogram->nelm;
|
||||
paddr->field_type = DBF_ULONG;
|
||||
|
||||
+4
-1
@@ -104,12 +104,15 @@ struct longindset { /* longin input dset */
|
||||
void alarm();
|
||||
void monitor();
|
||||
|
||||
static long init_record(plongin)
|
||||
static long init_record(plongin,pass)
|
||||
struct longinRecord *plongin;
|
||||
int pass;
|
||||
{
|
||||
struct longindset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct longindset *)(plongin->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,plongin,"longin: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
@@ -104,12 +104,15 @@ void alarm();
|
||||
int convert();
|
||||
void monitor();
|
||||
|
||||
static long init_record(plongout)
|
||||
static long init_record(plongout,pass)
|
||||
struct longoutRecord *plongout;
|
||||
int pass;
|
||||
{
|
||||
struct longoutdset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct longoutdset *)(plongout->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,plongout,"longout: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+4
-1
@@ -136,13 +136,16 @@ static void init_common(pmbbi)
|
||||
return;
|
||||
}
|
||||
|
||||
static long init_record(pmbbi)
|
||||
static long init_record(pmbbi,pass)
|
||||
struct mbbiRecord *pmbbi;
|
||||
int pass;
|
||||
{
|
||||
struct mbbidset *pdset;
|
||||
long status;
|
||||
int i;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct mbbidset *)(pmbbi->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pmbbi,"mbbi: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+4
-1
@@ -143,13 +143,16 @@ static void init_common(pmbbo)
|
||||
return;
|
||||
}
|
||||
|
||||
static long init_record(pmbbo)
|
||||
static long init_record(pmbbo,pass)
|
||||
struct mbboRecord *pmbbo;
|
||||
int pass;
|
||||
{
|
||||
struct mbbodset *pdset;
|
||||
long status;
|
||||
int i;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct mbbodset *)(pmbbo->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pmbbo,"mbbo: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+7
-4
@@ -101,11 +101,14 @@ long dbCaAddInlink();
|
||||
long dbCaGetLink();
|
||||
|
||||
|
||||
static long init_record(ppid)
|
||||
struct pidRecord *ppid;
|
||||
static long init_record(ppid,pass)
|
||||
struct pidRecord *ppid;
|
||||
int pass;
|
||||
{
|
||||
/* Added for Channel Access Links */
|
||||
long status;
|
||||
/* Added for Channel Access Links */
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
/* initialize the setpoint for constant setpoint */
|
||||
if (ppid->stpl.type == CONSTANT){
|
||||
|
||||
@@ -112,12 +112,15 @@ struct pcdset { /* pulseCounter input dset */
|
||||
|
||||
void monitor();
|
||||
|
||||
static long init_record(ppc)
|
||||
struct pulseCounterRecord *ppc;
|
||||
static long init_record(ppc,pass)
|
||||
struct pulseCounterRecord *ppc;
|
||||
int pass;
|
||||
{
|
||||
struct pcdset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
/* must have device support */
|
||||
if(!(pdset = (struct pcdset *)(ppc->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,ppc,"pc: init_record");
|
||||
|
||||
@@ -102,12 +102,15 @@ struct pddset { /* pulseDelay input dset */
|
||||
};
|
||||
void monitor();
|
||||
|
||||
static long init_record(ppd)
|
||||
struct pulseDelayRecord *ppd;
|
||||
static long init_record(ppd,pass)
|
||||
struct pulseDelayRecord *ppd;
|
||||
int pass;
|
||||
{
|
||||
struct pddset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
/* must have device support */
|
||||
if(!(pdset = (struct pddset *)(ppd->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,ppd,"pd: init_record");
|
||||
|
||||
@@ -114,12 +114,15 @@ struct ptdset { /* pulseTrain input dset */
|
||||
|
||||
void monitor();
|
||||
|
||||
static long init_record(ppt)
|
||||
struct pulseTrainRecord *ppt;
|
||||
static long init_record(ppt,pass)
|
||||
struct pulseTrainRecord *ppt;
|
||||
int pass;
|
||||
{
|
||||
struct ptdset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
/* must have device support */
|
||||
if(!(pdset = (struct ptdset *)(ppt->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,ppt,"pt: init_record");
|
||||
|
||||
+5
-2
@@ -111,8 +111,9 @@ long dbCaGetLink();
|
||||
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"};
|
||||
|
||||
|
||||
static long init_record(psel)
|
||||
struct selRecord *psel;
|
||||
static long init_record(psel,pass)
|
||||
struct selRecord *psel;
|
||||
int pass;
|
||||
{
|
||||
struct link *plink;
|
||||
int i;
|
||||
@@ -120,6 +121,8 @@ static long init_record(psel)
|
||||
/* Added for Channel Access Links */
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
/* get seln initial value if nvl is a constant*/
|
||||
if (psel->nvl.type == CONSTANT ) psel->seln = psel->nvl.value.value;
|
||||
if (psel->nvl.type == PV_LINK)
|
||||
|
||||
@@ -172,12 +172,14 @@ long dbCaGetLink();
|
||||
|
||||
|
||||
|
||||
static long init_record(psm)
|
||||
static long init_record(psm,pass)
|
||||
struct steppermotorRecord *psm;
|
||||
int pass;
|
||||
{
|
||||
struct smdset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct smdset *)(psm->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,psm,"sm: init_record");
|
||||
|
||||
@@ -101,12 +101,15 @@ struct stringindset { /* stringin input dset */
|
||||
};
|
||||
void monitor();
|
||||
|
||||
static long init_record(pstringin)
|
||||
static long init_record(pstringin,pass)
|
||||
struct stringinRecord *pstringin;
|
||||
int pass;
|
||||
{
|
||||
struct stringindset *pdset;
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct stringindset *)(pstringin->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pstringin,"stringin: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
@@ -102,12 +102,15 @@ struct stringoutdset { /* stringout input dset */
|
||||
};
|
||||
void monitor();
|
||||
|
||||
static long init_record(pstringout)
|
||||
static long init_record(pstringout,pass)
|
||||
struct stringoutRecord *pstringout;
|
||||
int pass;
|
||||
{
|
||||
struct stringoutdset *pdset;
|
||||
long status=0;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
if(!(pdset = (struct stringoutdset *)(pstringout->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pstringout,"stringout: init_record");
|
||||
return(S_dev_noDSET);
|
||||
|
||||
+4
-1
@@ -101,8 +101,9 @@ void monitor();
|
||||
long do_sub();
|
||||
long fetch_values();
|
||||
|
||||
static long init_record(psub)
|
||||
static long init_record(psub,pass)
|
||||
struct subRecord *psub;
|
||||
int pass;
|
||||
{
|
||||
FUNCPTR psubroutine;
|
||||
char sub_type;
|
||||
@@ -113,6 +114,8 @@ static long init_record(psub)
|
||||
int i;
|
||||
double *pvalue;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
plink = &psub->inpa;
|
||||
pvalue = &psub->a;
|
||||
for(i=0; i<ARG_MAX; i++, plink++, pvalue++) {
|
||||
|
||||
+5
-3
@@ -139,12 +139,14 @@ void read_timer();
|
||||
void convert_timer();
|
||||
void write_timer();
|
||||
|
||||
static long init_record(ptimer)
|
||||
static long init_record(ptimer,pass)
|
||||
struct timerRecord *ptimer;
|
||||
int pass;
|
||||
{
|
||||
|
||||
/* Added for Channel Access Links */
|
||||
long status;
|
||||
long status;
|
||||
|
||||
if (pass!=0) return(0);
|
||||
|
||||
/* get the delay initial value if torg is a constant*/
|
||||
if (ptimer->torg.type == CONSTANT ){
|
||||
|
||||
+16
-18
@@ -131,15 +131,14 @@ void monitor();
|
||||
extern unsigned int gts_trigger_counter;
|
||||
|
||||
|
||||
static long init_record(pwf)
|
||||
static long init_record(pwf,pass)
|
||||
struct waveformRecord *pwf;
|
||||
int pass;
|
||||
{
|
||||
struct wfdset *pdset;
|
||||
long status;
|
||||
|
||||
|
||||
/* This routine may get called twice. Once by cvt_dbaddr. Once by iocInit*/
|
||||
if(pwf->bptr==NULL) {
|
||||
if (pass==0){
|
||||
if(pwf->nelm<=0) pwf->nelm=1;
|
||||
if(pwf->ftvl == 0) {
|
||||
pwf->bptr = (char *)calloc(pwf->nelm,MAX_STRING_SIZE);
|
||||
@@ -148,18 +147,19 @@ static long init_record(pwf)
|
||||
pwf->bptr = (char *)calloc(pwf->nelm,sizeofTypes[pwf->ftvl]);
|
||||
}
|
||||
pwf->nord = 0;
|
||||
/* must have read_wf function defined */
|
||||
if(!(pdset = (struct wfdset *)(pwf->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pwf,"wf: init_record");
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
if( (pdset->number < 5) || (pdset->read_wf == NULL) ) {
|
||||
recGblRecordError(S_dev_missingSup,pwf,"wf: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
if( pdset->init_record ) {
|
||||
if((status=(*pdset->init_record)(pwf))) return(status);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
/* must have read_wf function defined */
|
||||
if(!(pdset = (struct wfdset *)(pwf->dset))) {
|
||||
recGblRecordError(S_dev_noDSET,pwf,"wf: init_record");
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
if( (pdset->number < 5) || (pdset->read_wf == NULL) ) {
|
||||
recGblRecordError(S_dev_missingSup,pwf,"wf: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
if( pdset->init_record ) {
|
||||
if((status=(*pdset->init_record)(pwf))) return(status);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -220,8 +220,6 @@ static long cvt_dbaddr(paddr)
|
||||
{
|
||||
struct waveformRecord *pwf=(struct waveformRecord *)paddr->precord;
|
||||
|
||||
/* This may get called before init_record. If so just call it*/
|
||||
if(pwf->bptr==NULL) init_record(pwf);
|
||||
paddr->pfield = (void *)(pwf->bptr);
|
||||
paddr->no_elements = pwf->nelm;
|
||||
paddr->field_type = pwf->ftvl;
|
||||
|
||||
Reference in New Issue
Block a user