new routine dbGetLinkDBFtype is now available. It returns the field type of a database link.

dbNotify was fixed to work correctly for putNotify as well as put.
 scanppl now accepts an argumeny rate. scanpel accepts an argument event_number
This commit is contained in:
Marty Kraimer
1998-04-20 16:00:19 +00:00
parent 41b32088a6
commit 5f2780f773
6 changed files with 56 additions and 6 deletions

View File

@@ -453,6 +453,21 @@ int dbIsLinkConnected(struct link *plink)
}
return(FALSE);
}
int dbGetLinkDBFtype(struct link *plink)
{
switch(plink->type) {
case DB_LINK:
{
DBADDR *paddr = (DBADDR *)plink->value.pv_link.pvt;
return((int)paddr->field_type);
}
case CA_LINK: return(dbCaGetLinkDBFtype(plink));
default: break;
}
return(-1);
}
/*
* Process a record if its scan field is passive.

View File

@@ -226,6 +226,7 @@ int dbIsValueField(struct dbFldDes *pdbFldDes);
int dbGetFieldIndex(struct dbAddr *paddr);
long dbGetNelements(struct link *plink,long *nelements);
int dbIsLinkConnected(struct link *plink);
int dbGetLinkDBFtype(struct link *plink);
long dbScanLink(struct dbCommon *pfrom, struct dbCommon *pto);
long dbScanPassive(struct dbCommon *pfrom,struct dbCommon *pto);
void dbScanFwdLink(struct link *plink);
@@ -266,6 +267,7 @@ long dbCaGetPrecision(struct link *plink,short *precision);
long dbCaGetSevr(struct link *plink,short *severity);
long dbCaGetUnits(struct link *plink,char *units,int unitsSize);
int dbCaIsLinkConnected(struct link *plink);
int dbCaGetLinkDBFtype(struct link *plink);
#else
struct rset *dbGetRset();

View File

@@ -405,6 +405,20 @@ int dbCaIsLinkConnected(struct link *plink)
if(ca_state(pca->chid)==cs_conn) return(TRUE);
return(FALSE);
}
int dbCaGetLinkDBFtype(struct link *plink)
{
caLink *pca;
if(!plink) return(-1);
if(plink->type != CA_LINK) return(-1);
pca = (caLink *)plink->value.pv_link.pvt;
if(!pca) return(-1);
if(!pca->chid) return(-1);
if(ca_state(pca->chid)==cs_conn)
return(dbDBRoldToDBFnew[ca_field_type(pca->chid)]);
return(-1);
}
static void eventCallback(struct event_handler_args arg)
{

View File

@@ -124,9 +124,24 @@ static void waitAdd(struct dbCommon *precord,PUTNOTIFY *ppn)
long dbPutNotify(PUTNOTIFY *ppn)
{
long status;
struct dbCommon *precord = ppn->paddr->precord;
long status;
DBADDR *paddr = ppn->paddr;
dbCommon *precord = (dbCommon *)paddr->precord;
short dbfType = paddr->field_type;
if(dbfType>=DBF_INLINK && dbfType<=DBF_FWDLINK) {
/*Initialize everything in PUTNOTIFY except restart list and node*/
callbackSetCallback(notifyCallback,&ppn->callback);
callbackSetUser(ppn,&ppn->callback);
callbackSetPriority(priorityLow,&ppn->callback);
ppn->status = 0;
ppn->restart = FALSE;
ppn->callbackState = callbackNotActive;
status=dbPutField(paddr,ppn->dbrType,ppn->pbuffer,ppn->nRequest);
ppn->status = status;
issueCallback(ppn);
return(S_db_Pending);
}
dbScanLock(precord);
ellInit(&ppn->restartList);
memset(&ppn->restartNode,'\0',sizeof(PNRESTARTNODE));

View File

@@ -53,6 +53,7 @@
#include <tickLib.h>
#include <sysLib.h>
#include <intLib.h>
#include <math.h>
#include "dbDefs.h"
#include "epicsPrint.h"
@@ -311,7 +312,7 @@ void scanDelete(struct dbCommon *precord)
return;
}
int scanppl() /*print periodic list*/
int scanppl(double rate) /*print periodic list*/
{
scan_list *psl;
char message[80];
@@ -323,19 +324,22 @@ int scanppl() /*print periodic list*/
if(psl==NULL) continue;
period = psl->ticks;
period /= vxTicksPerSecond;
if(rate>0.0 && (fabs(rate - period) >.05)) continue;
sprintf(message,"Scan Period= %f seconds ",period);
printList(psl,message);
}
return(0);
}
int scanpel() /*print event list */
int scanpel(int event_number) /*print event list */
{
char message[80];
int priority,evnt;
event_scan_list *pevent_scan_list;
for(evnt=0; evnt<MAX_EVENTS; evnt++) {
if(event_number && evnt<event_number) continue;
if(event_number && evnt>event_number) break;
for(priority=0; priority<NUM_CALLBACK_PRIORITIES; priority++) {
pevent_scan_list = pevent_list[priority][evnt];
if(!pevent_scan_list) continue;

View File

@@ -51,8 +51,8 @@ void scanAdd(struct dbCommon *);
void scanDelete(struct dbCommon *);
void scanOnce(void *precord);
int scanOnceSetQueueSize(int size);
int scanppl(void); /*print periodic lists*/
int scanpel(void); /*print event lists*/
int scanppl(double rate); /*print periodic lists*/
int scanpel(int event_number); /*print event lists*/
int scanpiol(void); /*print io_event list*/
void scanIoInit(IOSCANPVT *);
void scanIoRequest(IOSCANPVT);