fix support for channel access retrievals

This commit is contained in:
Roger Cole
1991-08-21 15:15:33 +00:00
parent 6f7535d108
commit eea30f7c10
5 changed files with 1018 additions and 567 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,7 @@
* .00 06-12-91 rac initial version
* .01 06-18-91 rac installed in SCCS
* .02 06-19-91 rac replace <fields.h> with <alarm.h>
* .03 08-15-91 rac use new call for sydOpen
*
* make options
* -DvxWorks makes a version for VxWorks
@@ -88,7 +89,7 @@ void *pHandle; /* I NULL; someday might implement a callback
}
(*ppSspec)->nInBufs = SYD_CHAN_MAX_IN;
return sydOpen(ppSspec, pHandle);
return sydOpen(ppSspec);
}
/*+/subr**********************************************************************
* NAME sydCAFunc - handle "Channel Access" data interactions
@@ -172,9 +173,10 @@ void *pArg; /* I pointer to arg, as required by funcCode */
ca_clear_channel(pCh);
return retStat;
}
pSChan->dbrType = dbf_type_to_DBR_TIME(ca_field_type(pCh));
pSChan->dbfType = ca_field_type(pCh);
pSChan->dbrType = dbf_type_to_DBR_TIME(pSChan->dbfType);
pSChan->elCount = ca_element_count(pCh);
pSChan->dbrGrType = dbf_type_to_DBR_GR(ca_field_type(pCh));
pSChan->dbrGrType = dbf_type_to_DBR_GR(pSChan->dbfType);
stat = ca_get(pSChan->dbrGrType, pCh, &pSChan->grBuf);
if (stat != ECA_NORMAL) {
retStat = S_syd_ERROR;

View File

@@ -28,6 +28,7 @@
* .00 12-04-90 rac initial version
* .01 06-18-91 rac installed in SCCS
* .02 06-19-91 rac replace <fields.h> with <alarm.h>
* .03 08-06-91 rac allow specifying file name
*
* make options
* -DvxWorks makes a version for VxWorks
@@ -66,14 +67,33 @@
# include <stdio.h>
# include <sys/file.h> /* for O_RDWR and O_RDONLY definitions */
#endif
long sydCFFunc();
long sydCFFuncGetGR();
/*+/subr**********************************************************************
* NAME sydOpenCF - open an AR `by channel' file for retrieval
*
* DESCRIPTION
* Open an archiver `by channel' file for synchronous data retrieval.
*
* RETURNS
* S_syd_OK, or
* S_syd_ERROR, or
* other code indicating error
*
* BUGS
* o text
*
* SEE ALSO
*
* EXAMPLE
*
*-*/
long
sydOpenCF(ppSspec, pHandle)
sydOpenCF(ppSspec, filePath)
SYD_SPEC **ppSspec; /* O pointer to synchronous set spec pointer */
void *pHandle; /* I pointer to handle for "source" */
char *filePath; /* I path name for `by channel' archive file */
{
long stat;
@@ -83,27 +103,27 @@ void *pHandle; /* I pointer to handle for "source" */
return S_syd_noMem;
(*ppSspec)->pFunc = sydCFFunc;
(*ppSspec)->type = SYD_TY_CF;
if ((stat = sydCFFunc(*ppSspec, NULL, SYD_FC_INIT, pHandle)) != S_syd_OK){
if ((stat = sydCFFunc(*ppSspec, NULL, SYD_FC_INIT, filePath)) != S_syd_OK){
GenFree((char *)*ppSspec);
*ppSspec = NULL;
return stat;
}
(*ppSspec)->nInBufs = 2;
return sydOpen(ppSspec, pHandle);
return sydOpen(ppSspec);
}
/*+/subr**********************************************************************
* NAME sydCFFunc - handle "by channel" data file interactions
*
* DESCRIPTION
*
* sydCFFunc(pSspec, NULL, SYD_FC_INIT, NULL) open "by channel" file
* sydCFFunc(pSspec, pSChan, SYD_FC_OPEN, NULL) chanName already in pSChan
* sydCFFunc(pSspec, NULL, SYD_FC_INIT, filePath) open "by channel" file
* sydCFFunc(pSspec, pSChan, SYD_FC_OPEN, NULL) chanName already in pSChan
* sydCFFunc(pSspec, pSChan, SYD_FC_READ, NULL)
* sydCFFunc(pSspec, NULL, SYD_FC_READ_SYNC, NULL) sync "by channel" file
* sydCFFunc(pSspec, NULL, SYD_FC_READ_SYNC, NULL) sync "by channel" file
* sydCFFunc(pSspec, pSChan, SYD_FC_POSITION, &stamp)
* sydCFFunc(pSspec, pSChan, SYD_FC_CLOSE, NULL)
* sydCFFunc(pSspec, NULL, SYD_FC_FILEINFO, outFile)
* sydCFFunc(pSspec, NULL, SYD_FC_WRAPUP, NULL) close "by channel" file
* sydCFFunc(pSspec, NULL, SYD_FC_WRAPUP, NULL) close "by channel" file
*
* RETURNS
* S_syd_OK, or
@@ -154,8 +174,8 @@ void *pArg; /* I pointer to arg, as required by funcCode */
retStat = S_syd_chanNotFound;
else {
pSChan->pHandle = (void *)pChanDesc;
pSChan->dbrType =
dbf_type_to_DBR_TIME(ArCFChanFieldType(pChanDesc));
pSChan->dbfType = ArCFChanFieldType(pChanDesc);
pSChan->dbrType = dbf_type_to_DBR_TIME(pSChan->dbfType);
pSChan->elCount = ArCFChanElementCount(pChanDesc);
sydCFFuncGetGR(pSChan, pChanDesc);
}

View File

@@ -134,6 +134,7 @@ void *pArg; /* I pointer to arg, as required by funcCode */
else if (funcCode == SYD_FC_OPEN) {
pPChan = (PFO_CHAN *)pArg;
pSChan->pHandle = (void *)pPChan->pGsd;
pSChan->dbfType = ca_field_type(pPChan->pGsd->pChid);
pSChan->dbrType = pPChan->pGsd->time_type;
assert(dbr_type_is_TIME(pSChan->dbrType));
pSChan->elCount = pPChan->pGsd->count;

View File

@@ -28,6 +28,7 @@
* .00 12-04-90 rac initial version
* .01 06-18-91 rac installed in SCCS
* .02 06-19-91 rac replace <fields.h> with <alarm.h>
* .03 08-14-91 rac jjj
*
* make options
* -DvxWorks makes a version for VxWorks
@@ -252,9 +253,9 @@ long pos;
}
long
sydOpenSSF(ppSspec, pHandle)
sydOpenSSF(ppSspec, filePath)
SYD_SPEC **ppSspec; /* O pointer to synchronous set spec pointer */
void *pHandle; /* I pointer to handle for "source" */
char *filePath; /* I path name for `sample set' archive file */
{
long stat;
@@ -264,20 +265,20 @@ void *pHandle; /* I pointer to handle for "source" */
return S_syd_noMem;
(*ppSspec)->pFunc = sydSSFFunc;
(*ppSspec)->type = SYD_TY_SSF;
if ((stat = sydSSFFunc(*ppSspec, NULL, SYD_FC_INIT, pHandle)) != S_syd_OK){
if ((stat = sydSSFFunc(*ppSspec, NULL,SYD_FC_INIT,filePath)) != S_syd_OK){
GenFree((char *)*ppSspec);
*ppSspec = NULL;
return stat;
}
(*ppSspec)->nInBufs = 2;
return sydOpen(ppSspec, pHandle);
return sydOpen(ppSspec);
}
/*+/subr**********************************************************************
* NAME sydSSFFunc - handle "sample set" data file interactions
*
* DESCRIPTION
*
* sydSSFFunc(pSspec, NULL, SYD_FC_INIT, fileName) open "sample set" file
* sydSSFFunc(pSspec, NULL, SYD_FC_INIT, filePath) open "sample set" file
* sydSSFFunc(pSspec, pSChan, SYD_FC_OPEN, NULL) chanName already in pSChan
* sydSSFFunc(pSspec, pSChan, SYD_FC_READ, NULL)
* sydSSFFunc(pSspec, pSChan, SYD_FC_POSITION, &stamp)
@@ -362,6 +363,7 @@ void *pArg; /* I pointer to arg, as required by funcCode */
assertAlways(0);
dbf_text_to_type(pField, type);
assert(type >= 0);
pSChan->dbfType = type;
pSChan->dbrType = dbf_type_to_DBR_TIME(type);
pSChan->dbrGrType = dbf_type_to_DBR_GR(type);
stat = sscanf(pRecord, "%*d %*d %d", &elCount);