From 8f4bcf765fb1eaeafb5b0946cacec13abb4c848e Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 3 Feb 1994 10:46:25 +0000 Subject: [PATCH] change tsLocalTime to recGblGetTimeStamp --- src/rec/recAi.c | 7 ++++++- src/rec/recAo.c | 2 +- src/rec/recBi.c | 2 +- src/rec/recBo.c | 2 +- src/rec/recCalc.c | 7 ++++--- src/rec/recCompress.c | 2 +- src/rec/recEvent.c | 2 +- src/rec/recFanout.c | 18 +++++++++--------- src/rec/recGsub.c | 2 +- src/rec/recHistogram.c | 4 ++-- src/rec/recLongin.c | 2 +- src/rec/recLongout.c | 2 +- src/rec/recMbbi.c | 2 +- src/rec/recMbbo.c | 2 +- src/rec/recPermissive.c | 2 +- src/rec/recPid.c | 2 +- src/rec/recPulseCounter.c | 2 +- src/rec/recPulseDelay.c | 2 +- src/rec/recPulseTrain.c | 2 +- src/rec/recSel.c | 2 +- src/rec/recSeq.c | 2 +- src/rec/recState.c | 2 +- src/rec/recSteppermotor.c | 10 +++++----- src/rec/recStringin.c | 2 +- src/rec/recStringout.c | 2 +- src/rec/recSub.c | 2 +- src/rec/recTimer.c | 2 +- src/rec/recWaveform.c | 7 ++++++- 28 files changed, 54 insertions(+), 43 deletions(-) diff --git a/src/rec/recAi.c b/src/rec/recAi.c index 64cca8f1d..9a2923c35 100644 --- a/src/rec/recAi.c +++ b/src/rec/recAi.c @@ -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; diff --git a/src/rec/recAo.c b/src/rec/recAo.c index 83a8e69cd..52f575d33 100644 --- a/src/rec/recAo.c +++ b/src/rec/recAo.c @@ -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); diff --git a/src/rec/recBi.c b/src/rec/recBi.c index 64d179416..619aecb83 100644 --- a/src/rec/recBi.c +++ b/src/rec/recBi.c @@ -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; diff --git a/src/rec/recBo.c b/src/rec/recBo.c index aa87af7bb..225a92daf 100644 --- a/src/rec/recBo.c +++ b/src/rec/recBo.c @@ -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; diff --git a/src/rec/recCalc.c b/src/rec/recCalc.c index 071bbc11a..ef3006617 100644 --- a/src/rec/recCalc.c +++ b/src/rec/recCalc.c @@ -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; itype!=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); } diff --git a/src/rec/recCompress.c b/src/rec/recCompress.c index fda0dff19..49e61c7ac 100644 --- a/src/rec/recCompress.c +++ b/src/rec/recCompress.c @@ -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); diff --git a/src/rec/recEvent.c b/src/rec/recEvent.c index 7f7b86a2d..2660d3483 100644 --- a/src/rec/recEvent.c +++ b/src/rec/recEvent.c @@ -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); diff --git a/src/rec/recFanout.c b/src/rec/recFanout.c index fc9b18f40..97ac6c6d7 100644 --- a/src/rec/recFanout.c +++ b/src/rec/recFanout.c @@ -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); diff --git a/src/rec/recGsub.c b/src/rec/recGsub.c index 65b81434f..ad3c44de5 100644 --- a/src/rec/recGsub.c +++ b/src/rec/recGsub.c @@ -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 */ diff --git a/src/rec/recHistogram.c b/src/rec/recHistogram.c index 62186fac6..f8176abcc 100644 --- a/src/rec/recHistogram.c +++ b/src/rec/recHistogram.c @@ -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; diff --git a/src/rec/recLongin.c b/src/rec/recLongin.c index 7ad57b65d..34dbd58a0 100644 --- a/src/rec/recLongin.c +++ b/src/rec/recLongin.c @@ -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); diff --git a/src/rec/recLongout.c b/src/rec/recLongout.c index 08fdcec1b..d18687ba9 100644 --- a/src/rec/recLongout.c +++ b/src/rec/recLongout.c @@ -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); diff --git a/src/rec/recMbbi.c b/src/rec/recMbbi.c index e5a1d5ad6..cde4709e0 100644 --- a/src/rec/recMbbi.c +++ b/src/rec/recMbbi.c @@ -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; diff --git a/src/rec/recMbbo.c b/src/rec/recMbbo.c index 55d408c09..83e15462e 100644 --- a/src/rec/recMbbo.c +++ b/src/rec/recMbbo.c @@ -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 */ diff --git a/src/rec/recPermissive.c b/src/rec/recPermissive.c index bb58f079f..9a7a1c22b 100644 --- a/src/rec/recPermissive.c +++ b/src/rec/recPermissive.c @@ -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; diff --git a/src/rec/recPid.c b/src/rec/recPid.c index b27ecd1cf..397981963 100644 --- a/src/rec/recPid.c +++ b/src/rec/recPid.c @@ -139,7 +139,7 @@ static long process(ppid) return(0); } - tsLocalTime(&ppid->time); + recGblGetTimeStamp(ppid); /* check for alarms */ alarm(ppid); diff --git a/src/rec/recPulseCounter.c b/src/rec/recPulseCounter.c index 22a9c59ae..9e740107f 100644 --- a/src/rec/recPulseCounter.c +++ b/src/rec/recPulseCounter.c @@ -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); diff --git a/src/rec/recPulseDelay.c b/src/rec/recPulseDelay.c index b078825e6..9d4e3b58b 100644 --- a/src/rec/recPulseDelay.c +++ b/src/rec/recPulseDelay.c @@ -220,7 +220,7 @@ static long process(ppd) ppd->pact = TRUE; ppd->udf=FALSE; - tsLocalTime(&ppd->time); + recGblGetTimeStamp(ppd); /* check event list */ monitor(ppd); diff --git a/src/rec/recPulseTrain.c b/src/rec/recPulseTrain.c index f25e3cb63..19ebdca98 100644 --- a/src/rec/recPulseTrain.c +++ b/src/rec/recPulseTrain.c @@ -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); diff --git a/src/rec/recSel.c b/src/rec/recSel.c index 697fc0918..5e84ff433 100644 --- a/src/rec/recSel.c +++ b/src/rec/recSel.c @@ -163,7 +163,7 @@ static long process(psel) } } - tsLocalTime(&psel->time); + recGblGetTimeStamp(psel); /* check for alarms */ alarm(psel); diff --git a/src/rec/recSeq.c b/src/rec/recSeq.c index 2bc35bdeb..6c3c0d6bf 100644 --- a/src/rec/recSeq.c +++ b/src/rec/recSeq.c @@ -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); diff --git a/src/rec/recState.c b/src/rec/recState.c index eca07c86a..d4ed9ba2b 100644 --- a/src/rec/recState.c +++ b/src/rec/recState.c @@ -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); diff --git a/src/rec/recSteppermotor.c b/src/rec/recSteppermotor.c index 0e19a5dc8..5e042d72e 100644 --- a/src/rec/recSteppermotor.c +++ b/src/rec/recSteppermotor.c @@ -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 */ diff --git a/src/rec/recStringin.c b/src/rec/recStringin.c index 1b7c3a71b..00136d81e 100644 --- a/src/rec/recStringin.c +++ b/src/rec/recStringin.c @@ -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); diff --git a/src/rec/recStringout.c b/src/rec/recStringout.c index 290ce92da..e425961b8 100644 --- a/src/rec/recStringout.c +++ b/src/rec/recStringout.c @@ -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); diff --git a/src/rec/recSub.c b/src/rec/recSub.c index 81db2dc73..a41b5f5b2 100644 --- a/src/rec/recSub.c +++ b/src/rec/recSub.c @@ -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 */ diff --git a/src/rec/recTimer.c b/src/rec/recTimer.c index dd86cd121..8a8326519 100644 --- a/src/rec/recTimer.c +++ b/src/rec/recTimer.c @@ -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); diff --git a/src/rec/recWaveform.c b/src/rec/recWaveform.c index afb653382..7478ed0a1 100644 --- a/src/rec/recWaveform.c +++ b/src/rec/recWaveform.c @@ -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 */