change tsLocalTime to recGblGetTimeStamp

This commit is contained in:
Marty Kraimer
1994-02-03 10:46:25 +00:00
parent a5efa2ccc3
commit 8f4bcf765f
28 changed files with 54 additions and 43 deletions

View File

@@ -141,7 +141,9 @@ struct aidset { /* analog input dset */
/*Following from timing system */
/*
extern unsigned int gts_trigger_counter;
*/
static void alarm();
static void convert();
@@ -222,6 +224,8 @@ static long process(pai)
}
/* event throttling */
/*Will not work with new event systems*/
/*
if (pai->scan == SCAN_IO_EVENT){
if ((pai->evnt != 0) && (gts_trigger_counter != 0)){
if ((gts_trigger_counter % pai->evnt) != 0){
@@ -229,13 +233,14 @@ static long process(pai)
}
}
}
*/
status=readValue(pai); /* read the new value */
/* check if device support set pact */
if ( !pact && pai->pact ) return(0);
pai->pact = TRUE;
tsLocalTime(&pai->time);
recGblGetTimeStamp(pai);
if (status==0) convert(pai);
else if (status==2) status=0;

View File

@@ -275,7 +275,7 @@ static long process(pao)
if ( !pact && pao->pact ) return(0);
pao->pact = TRUE;
tsLocalTime(&pao->time);
recGblGetTimeStamp(pao);
/* check event list */
monitor(pao);

View File

@@ -196,7 +196,7 @@ static long process(pbi)
if ( !pact && pbi->pact ) return(0);
pbi->pact = TRUE;
tsLocalTime(&pbi->time);
recGblGetTimeStamp(pbi);
if(status==0) { /* convert rval to val */
if(pbi->rval==0) pbi->val =0;
else pbi->val = 1;

View File

@@ -295,7 +295,7 @@ static long process(pbo)
if ( !pact && pbo->pact ) return(0);
pbo->pact = TRUE;
tsLocalTime(&pbo->time);
recGblGetTimeStamp(pbo);
wait_time = (int)((pbo->high) * vxTicksPerSecond); /* seconds to ticks */
if(pbo->val==1 && wait_time>0) {
struct callback *pcallback;

View File

@@ -176,7 +176,7 @@ static long process(pcalc)
recGblSetSevr(pcalc,CALC_ALARM,INVALID_ALARM);
} else pcalc->udf = FALSE;
}
tsLocalTime(&pcalc->time);
recGblGetTimeStamp(pcalc);
/* check for alarms */
alarm(pcalc);
/* check event list */
@@ -408,15 +408,16 @@ struct calcRecord *pcalc;
{
struct link *plink; /* structure of the link field */
double *pvalue;
long status,options=0,nRequest=1;
long status=0,options=0,nRequest=1;
int i;
for(i=0, plink=&pcalc->inpa, pvalue=&pcalc->a; i<ARG_MAX; i++, plink++, pvalue++) {
if(plink->type!=CONSTANT)
status = recGblGetLinkValue(plink,(void *)pcalc,
DBR_DOUBLE,pvalue,&options,&nRequest);
if (!RTN_SUCCESS(status)) return(status);
if (!RTN_SUCCESS(status)) return(status);
}
return(0);
}

View File

@@ -187,7 +187,7 @@ static long process(pcompress)
/* check event list */
if(status!=1) {
pcompress->udf=FALSE;
tsLocalTime(&pcompress->time);
recGblGetTimeStamp(pcompress);
monitor(pcompress);
/* process the forward scan link record */
recGblFwdLink(pcompress);

View File

@@ -166,7 +166,7 @@ static long process(pevent)
if(pevent->val>0) post_event((int)pevent->val);
tsLocalTime(&pevent->time);
recGblGetTimeStamp(pevent);
/* check event list */
monitor(pevent);

View File

@@ -150,17 +150,17 @@ static long process(pfanout)
switch (pfanout->selm){
case (SELECT_ALL):
if (pfanout->lnk1.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk1.value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)pfanout->lnk1.value.db_link.pdbAddr)->precord);
if (pfanout->lnk2.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk2.value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)pfanout->lnk2.value.db_link.pdbAddr)->precord);
if (pfanout->lnk3.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk3.value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)pfanout->lnk3.value.db_link.pdbAddr)->precord);
if (pfanout->lnk4.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk4.value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)pfanout->lnk4.value.db_link.pdbAddr)->precord);
if (pfanout->lnk5.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk5.value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)pfanout->lnk5.value.db_link.pdbAddr)->precord);
if (pfanout->lnk6.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk6.value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)pfanout->lnk6.value.db_link.pdbAddr)->precord);
break;
case (SELECTED):
if(pfanout->seln>6) {
@@ -172,7 +172,7 @@ static long process(pfanout)
}
plink=&(pfanout->lnk1);
plink += (pfanout->seln-1);
dbScanPassive(((struct dbAddr *)plink->value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)plink->value.db_link.pdbAddr)->precord);
break;
case (SELECT_MASK):
if(pfanout->seln==0) {
@@ -186,14 +186,14 @@ static long process(pfanout)
state=pfanout->seln;
for ( i=0; i<6; i++, state>>=1, plink++) {
if(state & 1 && plink->type==DB_LINK)
dbScanPassive(((struct dbAddr *)plink->value.db_link.pdbAddr)->precord);
dbScanPassive((void *)pfanout,((struct dbAddr *)plink->value.db_link.pdbAddr)->precord);
}
break;
default:
recGblSetSevr(pfanout,SOFT_ALARM,INVALID_ALARM);
}
pfanout->udf=FALSE;
tsLocalTime(&pfanout->time);
recGblGetTimeStamp(pfanout);
/* check monitors*/
/* get previous stat and sevr and new stat and sevr*/
monitor_mask = recGblResetAlarms(pfanout);

View File

@@ -174,7 +174,7 @@ static long process(psub)
if(status==0) status = do_gsub(psub);
psub->pact = TRUE;
if(status==1) return(0);
tsLocalTime(&psub->time);
recGblGetTimeStamp(psub);
/* check for alarms */
alarm(psub);
/* check event list */

View File

@@ -137,7 +137,7 @@ static void wdCallback(pcallback)
/* force post events for any count change */
if(phistogram->mcnt>0){
dbScanLock((struct dbCommon *)phistogram);
tsLocalTime(&phistogram->time);
recGblGetTimeStamp(phistogram);
db_post_events(phistogram,&phistogram->bptr,DBE_VALUE);
phistogram->mcnt=0;
dbScanUnlock((struct dbCommon *)phistogram);
@@ -263,7 +263,7 @@ static long process(phistogram)
if ( !pact && phistogram->pact ) return(0);
phistogram->pact = TRUE;
tsLocalTime(&phistogram->time);
recGblGetTimeStamp(phistogram);
if(status==0)add_count(phistogram);
else if(status==2)status=0;

View File

@@ -188,7 +188,7 @@ static long process(plongin)
if ( !pact && plongin->pact ) return(0);
plongin->pact = TRUE;
tsLocalTime(&plongin->time);
recGblGetTimeStamp(plongin);
/* check for alarms */
alarm(plongin);

View File

@@ -222,7 +222,7 @@ static long process(plongout)
if ( !pact && plongout->pact ) return(0);
plongout->pact = TRUE;
tsLocalTime(&plongout->time);
recGblGetTimeStamp(plongout);
/* check for alarms */
alarm(plongout);

View File

@@ -225,7 +225,7 @@ static long process(pmbbi)
if ( !pact && pmbbi->pact ) return(0);
pmbbi->pact = TRUE;
tsLocalTime(&pmbbi->time);
recGblGetTimeStamp(pmbbi);
if(status==0) { /* convert the value */
unsigned long *pstate_values;
short i;

View File

@@ -305,7 +305,7 @@ CONTINUE:
if ( !pact && pmbbo->pact ) return(0);
pmbbo->pact = TRUE;
tsLocalTime(&pmbbo->time);
recGblGetTimeStamp(pmbbo);
/* check event list */
monitor(pmbbo);
/* process the forward scan link record */

View File

@@ -96,7 +96,7 @@ static long process(ppermissive)
ppermissive->pact=TRUE;
ppermissive->udf=FALSE;
tsLocalTime(&ppermissive->time);
recGblGetTimeStamp(ppermissive);
monitor(ppermissive);
recGblFwdLink(ppermissive);
ppermissive->pact=FALSE;

View File

@@ -139,7 +139,7 @@ static long process(ppid)
return(0);
}
tsLocalTime(&ppid->time);
recGblGetTimeStamp(ppid);
/* check for alarms */
alarm(ppid);

View File

@@ -258,7 +258,7 @@ static long process(struct pulseCounterRecord *ppc)
ppc->pact = TRUE;
ppc->udf=FALSE;
tsLocalTime(&ppc->time);
recGblGetTimeStamp(ppc);
/* check event list */
monitor(ppc);

View File

@@ -220,7 +220,7 @@ static long process(ppd)
ppd->pact = TRUE;
ppd->udf=FALSE;
tsLocalTime(&ppd->time);
recGblGetTimeStamp(ppd);
/* check event list */
monitor(ppd);

View File

@@ -210,7 +210,7 @@ static long process(ppt)
if(status==-1)status = 0;
ppt->udf=FALSE;
tsLocalTime(&ppt->time);
recGblGetTimeStamp(ppt);
/* check event list */
monitor(ppt);

View File

@@ -163,7 +163,7 @@ static long process(psel)
}
}
tsLocalTime(&psel->time);
recGblGetTimeStamp(psel);
/* check for alarms */
alarm(psel);

View File

@@ -343,7 +343,7 @@ struct seqRecord *pseq;
/* process the forward scan link record */
recGblFwdLink(pseq);
tsLocalTime(&pseq->time);
recGblGetTimeStamp(pseq);
pseq->pact = FALSE;
return(0);

View File

@@ -98,7 +98,7 @@ static long process(pstate)
pstate->udf = FALSE;
pstate->pact=TRUE;
tsLocalTime(&pstate->time);
recGblGetTimeStamp(pstate);
monitor(pstate);
/* process the forward scan link record */
recGblFwdLink(pstate);

View File

@@ -227,7 +227,7 @@ static long process(psm)
/* the init is set when the readback returns */
if (psm->init <= 0){
if(psm->init==0) init_sm(psm);
tsLocalTime(&psm->time);
recGblGetTimeStamp(psm);
monitor(psm);
return(0);
}
@@ -236,7 +236,7 @@ static long process(psm)
if(psm->cmod == POSITION) {
positional_sm(psm);
if(!psm->dmov) {
tsLocalTime(&psm->time);
recGblGetTimeStamp(psm);
monitor(psm);
psm->pact=FALSE;
return(0);
@@ -245,7 +245,7 @@ static long process(psm)
else {
velocity_sm(psm);
}
tsLocalTime(&psm->time);
recGblGetTimeStamp(psm);
/* check event list */
monitor(psm);
/* process the forward scan link record */
@@ -455,7 +455,7 @@ struct steppermotorRecord *psm;
return;
}
psm->pact = TRUE;
tsLocalTime(&psm->time);
recGblGetTimeStamp(psm);
} else psm->mlis.count=0;
if (psm->cmod == VELOCITY){
/* check velocity */
@@ -616,7 +616,7 @@ struct steppermotorRecord *psm;
db_post_events(psm,&psm->dmov,DBE_VALUE|DBE_LOG);
/* check for deviation from desired value */
tsLocalTime(&psm->time);
recGblGetTimeStamp(psm);
alarm(psm);
monitor(psm);
/* process the forward scan link record */

View File

@@ -183,7 +183,7 @@ static long process(pstringin)
if ( !pact && pstringin->pact ) return(0);
pstringin->pact = TRUE;
tsLocalTime(&pstringin->time);
recGblGetTimeStamp(pstringin);
/* check event list */
monitor(pstringin);

View File

@@ -222,7 +222,7 @@ static long process(pstringout)
if ( !pact && pstringout->pact ) return(0);
pstringout->pact = TRUE;
tsLocalTime(&pstringout->time);
recGblGetTimeStamp(pstringout);
/* check event list */
monitor(pstringout);

View File

@@ -184,7 +184,7 @@ static long process(psub)
if(status==0) status = do_sub(psub);
psub->pact = TRUE;
if(status==1) return(0);
tsLocalTime(&psub->time);
recGblGetTimeStamp(psub);
/* check for alarms */
alarm(psub);
/* check event list */

View File

@@ -161,7 +161,7 @@ static long process(ptimer)
/* write the new value */
status = write_timer(ptimer);
ptimer->udf=FALSE;
tsLocalTime(&ptimer->time);
recGblGetTimeStamp(ptimer);
/* check event list */
monitor(ptimer);

View File

@@ -132,7 +132,9 @@ static void monitor();
static long readValue();
/*Following from timing system */
/*
extern unsigned int gts_trigger_counter;
*/
static long init_record(pwf,pass)
@@ -217,6 +219,8 @@ static long process(pwf)
return(S_dev_missingSup);
}
/* event throttling */
/* will not work with new event system*/
/*
if (pwf->scan == SCAN_IO_EVENT){
if ((pwf->evnt != 0) && (gts_trigger_counter != 0)){
if ((gts_trigger_counter % pwf->evnt) != 0){
@@ -225,6 +229,7 @@ static long process(pwf)
}
}
}
*/
if ( pact && pwf->busy ) return(0);
@@ -234,7 +239,7 @@ static long process(pwf)
pwf->pact = TRUE;
pwf->udf=FALSE;
tsLocalTime(&pwf->time);
recGblGetTimeStamp(pwf);
monitor(pwf);
/* process the forward scan link record */