encorporate latest SAFE (hop[efully) changes on 09JUL99
This commit is contained in:
+5
-4
@@ -114,7 +114,11 @@ static long asInitCommon(void)
|
||||
firstTime = FALSE;
|
||||
if(!pacf) return(0); /*access security will NEVER be turned on*/
|
||||
} else {
|
||||
if(!asActive) return(S_asLib_asNotActive);
|
||||
if(!asActive) {
|
||||
printf("Access security is NOT enabled."
|
||||
" Was asSetFilename specified before iocInit?\n");
|
||||
return(S_asLib_asNotActive);
|
||||
}
|
||||
if(pacf) {
|
||||
asCaStop();
|
||||
} else { /*Just leave everything as is */
|
||||
@@ -131,9 +135,6 @@ static long asInitCommon(void)
|
||||
|
||||
int asInit(void)
|
||||
{
|
||||
|
||||
/*If no access configuration file defined return success*/
|
||||
if(!pacf) return(0);
|
||||
return(asInitCommon());
|
||||
}
|
||||
|
||||
|
||||
+7
-16
@@ -50,28 +50,19 @@ extern struct dbBase *pdbbase;
|
||||
|
||||
static brkTable *findBrkTable(short linr)
|
||||
{
|
||||
brkTable *pbrkTable;
|
||||
dbMenu *pdbMenu;
|
||||
char name[50];
|
||||
char *pname = name;
|
||||
int len,ind;
|
||||
|
||||
|
||||
pdbMenu = dbFindMenu(pdbbase,"menuConvert");
|
||||
len = strlen(pdbMenu->papChoiceValue[linr]);
|
||||
if(len>=sizeof(name)) {
|
||||
epicsPrintf("Break Tables(findBrkTable) choice name too long\n");
|
||||
if(!pdbMenu) {
|
||||
epicsPrintf("findBrkTable: menuConvert does not exist\n");
|
||||
return(0);
|
||||
}
|
||||
strcpy(pname,pdbMenu->papChoiceValue[linr]);
|
||||
for(ind=0; ind<strlen(pname); ind++) {
|
||||
if(!isalnum(pname[ind])) {
|
||||
pname[ind] = '\0';
|
||||
break;
|
||||
}
|
||||
if(linr<0 || linr>=pdbMenu->nChoice) {
|
||||
epicsPrintf("findBrkTable linr %d but menuConvert has %d choices\n",
|
||||
linr,pdbMenu->nChoice);
|
||||
return(0);
|
||||
}
|
||||
pbrkTable = dbFindBrkTable(pdbbase,pname);
|
||||
return(pbrkTable);
|
||||
return(dbFindBrkTable(pdbbase,pdbMenu->papChoiceValue[linr]));
|
||||
}
|
||||
|
||||
long cvtRawToEngBpt(double *pval,short linr,short init, void **ppbrk,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* Author Jeffrey O. Hill
|
||||
* (string hash alg by Marty Kraimer and Peter K. Pearson)
|
||||
*
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*
|
||||
@@ -29,6 +31,19 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.22 1999/01/29 23:03:02 jhill
|
||||
* doc
|
||||
*
|
||||
* Revision 1.21 1999/01/29 22:51:09 jhill
|
||||
* reinstalled const cast away
|
||||
*
|
||||
* Revision 1.20 1999/01/29 22:36:53 jhill
|
||||
* removed const cast away
|
||||
*
|
||||
* Revision 1.19 1998/10/23 19:23:46 jhill
|
||||
* fixed problem associated with deleting "const char *"
|
||||
* on the solaris compiler
|
||||
*
|
||||
* Revision 1.18 1998/10/23 00:20:40 jhill
|
||||
* attempted to clean up HP-UX warnings
|
||||
*
|
||||
@@ -692,13 +707,16 @@ stringId::~stringId()
|
||||
//
|
||||
// the HP-UX compiler gives us a warning on
|
||||
// each cast away of const, but in this case
|
||||
// it cant be avoided
|
||||
// it cant be avoided.
|
||||
//
|
||||
// The DEC compiler complains that const isnt
|
||||
// really significant in a cast if it is present.
|
||||
//
|
||||
// I hope that deleting a pointer to "char"
|
||||
// is the same as deleting a pointer to
|
||||
// "const char" on all compilers
|
||||
//
|
||||
delete [] (char * const) this->pStr;
|
||||
delete [] (char *) this->pStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+52
-50
@@ -22,6 +22,8 @@ public:
|
||||
T * const pNewSeg;
|
||||
};
|
||||
|
||||
template <class T> class tsBTree;
|
||||
|
||||
//
|
||||
// tsBTreeNode
|
||||
//
|
||||
@@ -53,16 +55,18 @@ private:
|
||||
T *pLeft;
|
||||
T *pRight;
|
||||
|
||||
static void traverse(T &self, void (T::*pCB)())
|
||||
//
|
||||
// run callback for evey item in the B-Treee in sort order
|
||||
//
|
||||
static void traverse (T &item, void (T::*pCallBack)())
|
||||
{
|
||||
if (self.tsBTreeNode<T>::pLeft) {
|
||||
tsBTreeNode<T>::traverse
|
||||
(*self.tsBTreeNode<T>::pLeft, pCB);
|
||||
tsBTreeNode<T> &node = item;
|
||||
if (node.pLeft) {
|
||||
tsBTreeNode<T>::traverse (*node.pLeft, pCallBack);
|
||||
}
|
||||
(self.*pCB)();
|
||||
if (self.tsBTreeNode<T>::pRight) {
|
||||
tsBTreeNode<T>::traverse
|
||||
(*self.tsBTreeNode<T>::pRight, pCB);
|
||||
(item.*pCallBack)();
|
||||
if (node.pRight) {
|
||||
tsBTreeNode<T>::traverse (*node.pRight, pCallBack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,23 +77,22 @@ private:
|
||||
//
|
||||
static void insert(T &self, T &item)
|
||||
{
|
||||
tsBTreeNode<T> &node = self;
|
||||
btCmp result = item.tsBTreeCompare(self);
|
||||
if (result==btLessOrEqual) {
|
||||
if (self.tsBTreeNode<T>::pLeft) {
|
||||
tsBTreeNode<T>::insert
|
||||
(*self.tsBTreeNode<T>::pLeft, item);
|
||||
if (node.pLeft) {
|
||||
tsBTreeNode<T>::insert (*node.pLeft, item);
|
||||
}
|
||||
else {
|
||||
self.tsBTreeNode<T>::pLeft = &item;
|
||||
node.pLeft = &item;
|
||||
}
|
||||
}
|
||||
else if(result==btGreater) {
|
||||
if (self.tsBTreeNode<T>::pRight) {
|
||||
tsBTreeNode<T>::insert
|
||||
(*self.tsBTreeNode<T>::pRight, item);
|
||||
if (node.pRight) {
|
||||
tsBTreeNode<T>::insert (*node.pRight, item);
|
||||
}
|
||||
else {
|
||||
self.tsBTreeNode<T>::pRight = &item;
|
||||
node.pRight = &item;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -104,51 +107,50 @@ private:
|
||||
//
|
||||
static tsBTreeRMRet<T> remove(T &self, T &item)
|
||||
{
|
||||
tsBTreeNode<T> &node = self;
|
||||
if (&self == &item) {
|
||||
if (self.tsBTreeNode<T>::pLeft) {
|
||||
if (self.tsBTreeNode<T>::pRight) {
|
||||
T *pR = self.tsBTreeNode<T>::pLeft->tsBTreeNode<T>::pRight;
|
||||
if (node.pLeft) {
|
||||
if (node.pRight) {
|
||||
tsBTreeNode<T> *pLeftNode = node.pLeft;
|
||||
tsBTreeNode<T> *pRightNode = node.pRight;
|
||||
T *pR = pLeftNode->pRight;
|
||||
if (pR) {
|
||||
tsBTreeNode<T>::insert
|
||||
(*pR, *self.tsBTreeNode<T>::pRight);
|
||||
tsBTreeNode<T>::insert (*pR, *node.pRight);
|
||||
}
|
||||
else {
|
||||
self.tsBTreeNode<T>::pLeft->tsBTreeNode<T>::pRight =
|
||||
self.tsBTreeNode<T>::pRight;
|
||||
pLeftNode->pRight = node.pRight;
|
||||
}
|
||||
}
|
||||
return tsBTreeRMRet<T>(tsbtrrFound, self.tsBTreeNode<T>::pLeft); // found it
|
||||
return tsBTreeRMRet<T>(tsbtrrFound, node.pLeft); // found it
|
||||
}
|
||||
else {
|
||||
return tsBTreeRMRet<T>(tsbtrrFound, self.tsBTreeNode<T>::pRight); // found it
|
||||
return tsBTreeRMRet<T>(tsbtrrFound, node.pRight); // found it
|
||||
}
|
||||
}
|
||||
|
||||
btCmp result = item.tsBTreeCompare(self);
|
||||
if (result==btLessOrEqual) {
|
||||
if (self.tsBTreeNode<T>::pLeft) {
|
||||
tsBTreeRMRet<T> ret = tsBTreeNode<T>::
|
||||
remove(*self.tsBTreeNode<T>::pLeft, item);
|
||||
if (node.pLeft) {
|
||||
tsBTreeRMRet<T> ret = tsBTreeNode<T>::remove(*node.pLeft, item);
|
||||
if (ret.foundIt==tsbtrrFound) {
|
||||
self.tsBTreeNode<T>::pLeft= ret.pNewSeg;
|
||||
return tsBTreeRMRet<T>(tsbtrrFound,&self); // TRUE - found it
|
||||
node.pLeft= ret.pNewSeg;
|
||||
return tsBTreeRMRet<T> (tsbtrrFound, &self); // TRUE - found it
|
||||
}
|
||||
}
|
||||
return tsBTreeRMRet<T>(tsbtrrNotFound, 0u); // not found
|
||||
}
|
||||
else if(result==btGreater) {
|
||||
if (self.tsBTreeNode<T>::pRight) {
|
||||
tsBTreeRMRet<T> ret = tsBTreeNode<T>::
|
||||
remove(*self.tsBTreeNode<T>::pRight, item);
|
||||
if (node.pRight) {
|
||||
tsBTreeRMRet<T> ret = tsBTreeNode<T>::remove(*node.pRight, item);
|
||||
if (ret.foundIt==tsbtrrFound) {
|
||||
self.tsBTreeNode<T>::pRight = ret.pNewSeg;
|
||||
node.pRight = ret.pNewSeg;
|
||||
return tsBTreeRMRet<T>(tsbtrrFound,&self); // TRUE - found it
|
||||
}
|
||||
}
|
||||
return tsBTreeRMRet<T>(tsbtrrNotFound, 0u); // not found
|
||||
}
|
||||
else {
|
||||
assert(0);
|
||||
return tsBTreeRMRet<T>(tsbtrrNotFound, 0u); // not found
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -156,30 +158,30 @@ private:
|
||||
//
|
||||
static unsigned verify(const T &self, const T &item)
|
||||
{
|
||||
const tsBTreeNode<T> &node = self;
|
||||
|
||||
if (&self == &item) {
|
||||
return 1u; // TRUE -item is present
|
||||
}
|
||||
btCmp result = item.tsBTreeCompare(self);
|
||||
if (result==btLessOrEqual) {
|
||||
if (self.tsBTreeNode<T>::pLeft) {
|
||||
return tsBTreeNode<T>::verify
|
||||
(*self.tsBTreeNode<T>::pLeft, item);
|
||||
if (node.pLeft) {
|
||||
return tsBTreeNode<T>::verify (*node.pLeft, item);
|
||||
}
|
||||
else {
|
||||
return 0u; // FALSE - not found
|
||||
}
|
||||
}
|
||||
else if(result==btGreater) {
|
||||
if (self.tsBTreeNode<T>::pRight) {
|
||||
return tsBTreeNode<T>::verify
|
||||
(*self.tsBTreeNode<T>::pRight, item);
|
||||
if (node.pRight) {
|
||||
return tsBTreeNode<T>::verify (*node.pRight, item);
|
||||
}
|
||||
else {
|
||||
return 0u; // FALSE - not found
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(0);
|
||||
return 0u; // FALSE - not found
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -242,14 +244,14 @@ public:
|
||||
return 0u; // FALSE - not found
|
||||
}
|
||||
}
|
||||
//
|
||||
// Call (pT->*pCB) () for each item in the table
|
||||
//
|
||||
// where pT is a pointer to type T and pCB is
|
||||
// a pointer to a memmber function of T with
|
||||
// no parameters and returning void
|
||||
//
|
||||
void traverse(void (T::*pCB)())
|
||||
//
|
||||
// Call (pT->*pCB) () for each item in the table
|
||||
//
|
||||
// where pT is a pointer to type T and pCB is
|
||||
// a pointer to a memmber function of T with
|
||||
// no parameters and returning void
|
||||
//
|
||||
void traverse(void (T::*pCB)())
|
||||
{
|
||||
if (this->pRoot) {
|
||||
tsBTreeNode<T>::traverse(*this->pRoot, pCB);
|
||||
|
||||
+21
-14
@@ -31,6 +31,15 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.16 1999/05/03 15:39:57 jhill
|
||||
* made compatible with visual C++ 6.0
|
||||
*
|
||||
* Revision 1.15 1999/02/01 21:49:04 jhill
|
||||
* removed redundant API
|
||||
*
|
||||
* Revision 1.14 1998/10/23 00:20:41 jhill
|
||||
* attempted to clean up HP-UX warnings
|
||||
*
|
||||
* Revision 1.13 1998/06/16 03:01:44 jhill
|
||||
* cosmetic
|
||||
*
|
||||
@@ -206,9 +215,6 @@ public:
|
||||
T *first(void) const { return this->pFirst; }
|
||||
T *last(void) const { return this->pLast; }
|
||||
|
||||
protected:
|
||||
T *getFirst(void) const { return pFirst; }
|
||||
T *getLast(void) const { return pLast; }
|
||||
private:
|
||||
T *pFirst;
|
||||
T *pLast;
|
||||
@@ -244,7 +250,17 @@ public:
|
||||
tsDLIterBD (T *pInitialEntry) :
|
||||
pEntry(pInitialEntry) {}
|
||||
|
||||
tsDLIterBD (const class tsDLIterBD<T> ©In);
|
||||
//
|
||||
// This is apparently required by some compiler, causes
|
||||
// trouble with MS Visual C 6.0, but should not be
|
||||
// required by any compiler. I am assuming that the
|
||||
// other compiler is a past version of MS Visual C.
|
||||
//
|
||||
# if defined(_MSC_VER) && _MSC_VER < 1200
|
||||
template <class T>
|
||||
tsDLIterBD (const class tsDLIterBD<T> ©In) :
|
||||
pEntry(copyIn.pEntry) {}
|
||||
# endif
|
||||
|
||||
tsDLIterBD<T> & operator = (T *pNewEntry)
|
||||
{
|
||||
@@ -325,7 +341,7 @@ public:
|
||||
private:
|
||||
T *pEntry;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// tsDLIter<T>
|
||||
//
|
||||
@@ -498,15 +514,6 @@ public:
|
||||
void remove ();
|
||||
};
|
||||
|
||||
//
|
||||
// MS Visual C 6.0 requires that this code is not provided in
|
||||
// the class definition because the class isnt fully defined yet
|
||||
//
|
||||
template <class T>
|
||||
inline tsDLIterBD<T>::tsDLIterBD(const class tsDLIterBD<T> ©In) :
|
||||
pEntry(copyIn.pEntry) {}
|
||||
|
||||
|
||||
//
|
||||
// tsDLList<T>::remove ()
|
||||
//
|
||||
|
||||
+23
-16
@@ -31,6 +31,14 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.15 1998/12/18 19:02:46 jhill
|
||||
* Changed the remove() function in tsSLList class because users were
|
||||
* confused by it. The name is now removeNextItem() and it is now a private
|
||||
* member of class tsSLNode.
|
||||
*
|
||||
* Revision 1.14 1998/10/23 16:40:47 jhill
|
||||
* fixed missing new line at EOF
|
||||
*
|
||||
* Revision 1.13 1998/10/23 00:20:41 jhill
|
||||
* attempted to clean up HP-UX warnings
|
||||
*
|
||||
@@ -105,6 +113,20 @@ public:
|
||||
|
||||
private:
|
||||
T *pNext;
|
||||
|
||||
//
|
||||
// removeNextItem ()
|
||||
//
|
||||
// removes the item after this node
|
||||
//
|
||||
void removeNextItem ()
|
||||
{
|
||||
T *pItem = this->pNext;
|
||||
if (pItem) {
|
||||
tsSLNode<T> *pNode = pItem;
|
||||
this->pNext = pNode->pNext;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -136,21 +158,6 @@ public:
|
||||
this->insert (item, *this);
|
||||
}
|
||||
|
||||
//
|
||||
// remove ()
|
||||
// **** removes item after "itemBefore" ****
|
||||
// (itemBefore might be the list header object and therefore
|
||||
// will not always be of type T)
|
||||
//
|
||||
void remove (tsSLNode<T> &itemBefore)
|
||||
{
|
||||
T *pItem = itemBefore.pNext;
|
||||
if (pItem) {
|
||||
tsSLNode<T> *pNode = pItem;
|
||||
itemBefore.pNext = pNode->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// get ()
|
||||
//
|
||||
@@ -158,7 +165,7 @@ public:
|
||||
{
|
||||
tsSLNode<T> *pThisNode = this;
|
||||
T *pItem = pThisNode->pNext;
|
||||
this->remove(*this);
|
||||
pThisNode->removeNextItem();
|
||||
return pItem;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ static void ProcessCallback(CALLBACK *pCallback)
|
||||
|
||||
callbackGetUser(pRec, pCallback);
|
||||
dbScanLock(pRec);
|
||||
(*((struct rset *)pRec->rset)->process)(pRec);
|
||||
(*pRec->rset->process)(pRec);
|
||||
dbScanUnlock(pRec);
|
||||
}
|
||||
void callbackRequestProcessCallback(CALLBACK *pCallback,
|
||||
|
||||
+3
-3
@@ -531,8 +531,8 @@ void dbScanFwdLink(struct link *plink)
|
||||
*/
|
||||
long dbProcess(dbCommon *precord)
|
||||
{
|
||||
struct rset *prset = (struct rset *)precord->rset;
|
||||
dbRecordType *pdbRecordType = (dbRecordType *)precord->rdes;
|
||||
struct rset *prset = precord->rset;
|
||||
dbRecordType *pdbRecordType = precord->rdes;
|
||||
unsigned char tpro=precord->tpro;
|
||||
unsigned long lset;
|
||||
long status = 0;
|
||||
@@ -624,7 +624,7 @@ long dbProcess(dbCommon *precord)
|
||||
|
||||
/* locate record processing routine */
|
||||
/* put this in iocInit() !!! */
|
||||
if (!(prset=(struct rset *)precord->rset) || !(prset->process)) {
|
||||
if (!(prset=precord->rset) || !(prset->process)) {
|
||||
precord->pact=1;/*set pact TRUE so error is issued only once*/
|
||||
recGblRecordError(S_db_noRSET, (void *)precord, "dbProcess");
|
||||
status = S_db_noRSET;
|
||||
|
||||
+7
-6
@@ -118,6 +118,7 @@
|
||||
}
|
||||
field(ACKT,DBF_MENU) {
|
||||
prompt("Alarm Ack Transient")
|
||||
promptgroup(GUI_ALARMS)
|
||||
special(SPC_NOMOD)
|
||||
interest(2)
|
||||
menu(menuYesNo)
|
||||
@@ -159,25 +160,25 @@
|
||||
prompt("addr of PUTNOTIFY")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void *ppn")
|
||||
extra("struct putNotify *ppn")
|
||||
}
|
||||
field(PPNN,DBF_NOACCESS) {
|
||||
prompt("next record PUTNOTIFY")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void *ppnn")
|
||||
extra("struct pnWaitNode *ppnn")
|
||||
}
|
||||
field(SPVT,DBF_NOACCESS) {
|
||||
prompt("Scan Private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void *spvt")
|
||||
extra("struct scan_element *spvt")
|
||||
}
|
||||
field(RSET,DBF_NOACCESS) {
|
||||
prompt("Address of RSET")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void *rset")
|
||||
extra("struct rset *rset")
|
||||
}
|
||||
field(DSET,DBF_NOACCESS) {
|
||||
prompt("DSET address")
|
||||
@@ -195,13 +196,13 @@
|
||||
prompt("Address of dbRecordType")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void *rdes")
|
||||
extra("struct dbRecordType *rdes")
|
||||
}
|
||||
field(LSET,DBF_NOACCESS) {
|
||||
prompt("Lock Set")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("void *lset")
|
||||
extra("struct lockRecord *lset")
|
||||
}
|
||||
field(PRIO,DBF_MENU) {
|
||||
prompt("Scheduling Priority")
|
||||
|
||||
+12
-12
@@ -175,7 +175,7 @@ void dbLockSetGblUnlock(void)
|
||||
|
||||
void dbLockSetRecordLock(dbCommon *precord)
|
||||
{
|
||||
lockRecord *plockRecord = (lockRecord *)precord->lset;
|
||||
lockRecord *plockRecord = precord->lset;
|
||||
lockSet *plockSet;
|
||||
STATUS status;
|
||||
|
||||
@@ -212,7 +212,7 @@ void dbScanLock(dbCommon *precord)
|
||||
lockSet *plockSet;
|
||||
STATUS status;
|
||||
|
||||
if(!(plockRecord= (lockRecord *)precord->lset)) {
|
||||
if(!(plockRecord= precord->lset)) {
|
||||
epicsPrintf("dbScanLock plockRecord is NULL record %s\n",
|
||||
precord->name);
|
||||
taskSuspend(0);
|
||||
@@ -235,7 +235,7 @@ void dbScanLock(dbCommon *precord)
|
||||
|
||||
void dbScanUnlock(dbCommon *precord)
|
||||
{
|
||||
lockRecord *plockRecord = (lockRecord *)precord->lset;
|
||||
lockRecord *plockRecord = precord->lset;
|
||||
|
||||
if(!plockRecord || !plockRecord->plockSet) {
|
||||
epicsPrintf("dbScanUnlock plockRecord or plockRecord->plockSet NULL\n");
|
||||
@@ -247,7 +247,7 @@ void dbScanUnlock(dbCommon *precord)
|
||||
|
||||
unsigned long dbLockGetLockId(dbCommon *precord)
|
||||
{
|
||||
lockRecord *plockRecord = (lockRecord *)precord->lset;
|
||||
lockRecord *plockRecord = precord->lset;
|
||||
lockSet *plockSet;
|
||||
|
||||
if(!plockRecord) return(0);
|
||||
@@ -312,7 +312,7 @@ void dbLockInitRecords(dbBase *pdbbase)
|
||||
&& pdbAddr->no_elements<=1) continue;
|
||||
dbLockSetMerge(precord,pdbAddr->precord);
|
||||
}
|
||||
plockRecord = (lockRecord *)precord->lset;
|
||||
plockRecord = precord->lset;
|
||||
if(!plockRecord->plockSet) allocLock(plockRecord);
|
||||
}
|
||||
}
|
||||
@@ -320,8 +320,8 @@ void dbLockInitRecords(dbBase *pdbbase)
|
||||
|
||||
void dbLockSetMerge(dbCommon *pfirst,dbCommon *psecond)
|
||||
{
|
||||
lockRecord *p1lockRecord = (lockRecord *)pfirst->lset;
|
||||
lockRecord *p2lockRecord = (lockRecord *)psecond->lset;
|
||||
lockRecord *p1lockRecord = pfirst->lset;
|
||||
lockRecord *p2lockRecord = psecond->lset;
|
||||
lockSet *p1lockSet;
|
||||
lockSet *p2lockSet;
|
||||
|
||||
@@ -368,7 +368,7 @@ void dbLockSetSplit(dbCommon *psource)
|
||||
int nrecordsInSet,i;
|
||||
dbCommon **paprecord;
|
||||
|
||||
plockRecord = (lockRecord *)psource->lset;
|
||||
plockRecord = psource->lset;
|
||||
if(!plockRecord) {
|
||||
errMessage(-1,"dbLockSetSplit called before lockRecord allocated");
|
||||
return;
|
||||
@@ -390,9 +390,9 @@ void dbLockSetSplit(dbCommon *psource)
|
||||
/*Now recompute lock sets */
|
||||
for(i=0; i<nrecordsInSet; i++) {
|
||||
precord = paprecord[i];
|
||||
plockRecord = (lockRecord *)precord->lset;
|
||||
plockRecord = precord->lset;
|
||||
if(!(precord->name[0])) continue;
|
||||
pdbRecordType = (dbRecordType *)precord->rdes;
|
||||
pdbRecordType = precord->rdes;
|
||||
for(link=0; link<pdbRecordType->no_links; link++) {
|
||||
DBADDR *pdbAddr;
|
||||
|
||||
@@ -442,7 +442,7 @@ long dblsr(char *recordname,int level)
|
||||
}
|
||||
precord = pdbentry->precnode->precord;
|
||||
dbFinishEntry(pdbentry);
|
||||
plockRecord = (lockRecord *)precord->lset;
|
||||
plockRecord = precord->lset;
|
||||
if(!plockRecord) return(0);
|
||||
plockSet = plockRecord->plockSet;
|
||||
} else {
|
||||
@@ -473,7 +473,7 @@ long dblsr(char *recordname,int level)
|
||||
for(plockRecord = (lockRecord *)ellFirst(&plockSet->recordList);
|
||||
plockRecord; plockRecord = (lockRecord *)ellNext(&plockRecord->node)) {
|
||||
precord = plockRecord->precord;
|
||||
pdbRecordType = (dbRecordType *)precord->rdes;
|
||||
pdbRecordType = precord->rdes;
|
||||
printf("%s\n",precord->name);
|
||||
if(level<=1) continue;
|
||||
for(link=0; (link<pdbRecordType->no_links) ; link++) {
|
||||
|
||||
+5
-6
@@ -53,7 +53,7 @@
|
||||
#include "recGbl.h"
|
||||
|
||||
/*NODE structure attached to ppnn field of each record in list*/
|
||||
typedef struct {
|
||||
typedef struct pnWaitNode {
|
||||
ELLNODE node;
|
||||
struct dbCommon *precord;
|
||||
} PNWAITNODE;
|
||||
@@ -114,7 +114,7 @@ static void waitAdd(struct dbCommon *precord,PUTNOTIFY *ppn)
|
||||
PNWAITNODE *ppnnode;
|
||||
|
||||
if(!precord->ppnn) precord->ppnn = dbCalloc(1,sizeof(PNWAITNODE));
|
||||
ppnnode = (PNWAITNODE *)precord->ppnn;
|
||||
ppnnode = precord->ppnn;
|
||||
ppnnode->precord = precord;
|
||||
precord->ppn = ppn;
|
||||
ellAdd(&ppn->waitList,&ppnnode->node);
|
||||
@@ -206,7 +206,6 @@ static long putNotify(PUTNOTIFY *ppn)
|
||||
status=dbProcess(precord);
|
||||
if(status!=0) {
|
||||
ppn->status = status;
|
||||
issueCallback(ppn);
|
||||
}
|
||||
ret_pending:
|
||||
return(S_db_Pending);
|
||||
@@ -303,8 +302,8 @@ static void notifyCancel(PUTNOTIFY *ppn)
|
||||
|
||||
void dbNotifyCompletion(struct dbCommon *precord)
|
||||
{
|
||||
PUTNOTIFY *ppn = (PUTNOTIFY *)precord->ppn;
|
||||
PNWAITNODE *ppnnode = (PNWAITNODE *)precord->ppnn;;
|
||||
PUTNOTIFY *ppn = precord->ppn;
|
||||
PNWAITNODE *ppnnode = precord->ppnn;;
|
||||
|
||||
ellDelete(&ppn->waitList,&ppnnode->node);
|
||||
precord->ppn = NULL;
|
||||
@@ -314,7 +313,7 @@ void dbNotifyCompletion(struct dbCommon *precord)
|
||||
|
||||
void dbNotifyAdd(struct dbCommon *pfrom, struct dbCommon *pto)
|
||||
{
|
||||
PUTNOTIFY *pfromppn = (PUTNOTIFY *)pfrom->ppn;
|
||||
PUTNOTIFY *pfromppn = pfrom->ppn;
|
||||
PUTNOTIFY *ppn=NULL;
|
||||
|
||||
if(pto->ppn == pfrom->ppn) return; /*Aready in same set*/
|
||||
|
||||
+3
-3
@@ -676,10 +676,10 @@ static void addToList(struct dbCommon *precord,scan_list *psl)
|
||||
scan_element *pse,*ptemp;
|
||||
|
||||
FASTLOCK(&psl->lock);
|
||||
pse = (scan_element *)(precord->spvt);
|
||||
pse = precord->spvt;
|
||||
if(pse==NULL) {
|
||||
pse = dbCalloc(1,sizeof(scan_element));
|
||||
precord->spvt = (void *)pse;
|
||||
precord->spvt = pse;
|
||||
pse->precord = precord;
|
||||
}
|
||||
pse ->pscan_list = psl;
|
||||
@@ -707,7 +707,7 @@ static void deleteFromList(struct dbCommon *precord,scan_list *psl)
|
||||
FASTUNLOCK(&psl->lock);
|
||||
return;
|
||||
}
|
||||
pse = (scan_element *)(precord->spvt);
|
||||
pse = precord->spvt;
|
||||
if(pse==NULL || pse->pscan_list!=psl) {
|
||||
FASTUNLOCK(&psl->lock);
|
||||
errMessage(-1,"deleteFromList failed");
|
||||
|
||||
+3
-1
@@ -1175,11 +1175,13 @@ static int dbpr_report(
|
||||
char *ptemp_buf = &temp_buf[0];
|
||||
short n = pdbFldDes->size;
|
||||
short i;
|
||||
unsigned int value;
|
||||
|
||||
strcpy(ptemp_buf,"0x"); ptemp_buf+=2;
|
||||
if(n>(sizeof(temp_buf)-2)/2) n = (sizeof(temp_buf)-2)/2;
|
||||
for (i=0; i<n; i++, (ptemp_buf+=2), pchar++) {
|
||||
sprintf(ptemp_buf,"%02x",*pchar);
|
||||
value = (unsigned int)(*(unsigned char *)pchar);
|
||||
sprintf(ptemp_buf,"%02x",value);
|
||||
}
|
||||
*ptemp_buf = 0;
|
||||
sprintf(pmsg, "%s: %s", pfield_name,temp_buf);
|
||||
|
||||
@@ -41,7 +41,6 @@ struct drvet { /* driver entry table */
|
||||
long number; /*number of support routines*/
|
||||
DRVSUPFUN report; /*print report*/
|
||||
DRVSUPFUN init; /*init support*/
|
||||
DRVSUPFUN reboot; /*reboot support*/
|
||||
/*other functions are device dependent*/
|
||||
};
|
||||
#define DRVETNUMBER ( (sizeof(struct drvet) -sizeof(long))/sizeof(DRVSUPFUN) )
|
||||
|
||||
+6
-1
@@ -12,6 +12,12 @@ of this distribution.
|
||||
**********************************************************************/
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.29 1999/02/11 17:02:34 jhill
|
||||
* removed potential infinite recursion from tsForceSoftSync()
|
||||
*
|
||||
* Revision 1.28 1998/10/06 18:09:28 mrk
|
||||
* fixed sync bugs
|
||||
*
|
||||
* Revision 1.27 1998/09/29 14:11:02 mrk
|
||||
* TSsetClockFromUnix was made global
|
||||
*
|
||||
@@ -1733,7 +1739,6 @@ static long TSgetCurrentTime(struct timespec* ts)
|
||||
static long TSforceSoftSync(int Card)
|
||||
{
|
||||
semGive(TSdata.sync_occurred);
|
||||
TSforceSync(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ of this distribution.
|
||||
#include "special.h"
|
||||
#include "dbmf.h"
|
||||
#include "postfix.h"
|
||||
#include "sCalcPostfix.h"
|
||||
#include "osiFileName.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
@@ -1445,17 +1446,21 @@ long epicsShareAPI dbCreateRecord(DBENTRY *pdbentry,char *precordName)
|
||||
if((status = dbAllocRecord(pdbentry,precordName))) return(status);
|
||||
pNewRecNode->recordname = dbRecordName(pdbentry);
|
||||
/* install record node in list in sorted postion */
|
||||
precnode = (dbRecordNode *)ellFirst(preclist);
|
||||
while(precnode && strcmp(precordName,(char*)precnode->precord) > 0)
|
||||
precnode = (dbRecordNode *)ellNext(&precnode->node);
|
||||
if(precnode)
|
||||
status = dbFirstRecord(pdbentry);
|
||||
while(status==0) {
|
||||
if(strcmp(precordName,dbGetRecordName(pdbentry)) < 0) break;
|
||||
status = dbNextRecord(pdbentry);
|
||||
}
|
||||
if(status==0) {
|
||||
precnode = pdbentry->precnode;
|
||||
ellInsert(preclist,ellPrevious(&precnode->node),&pNewRecNode->node);
|
||||
else
|
||||
ellAdd(preclist,&pNewRecNode->node);
|
||||
} else {
|
||||
ellAdd(preclist,&pNewRecNode->node);
|
||||
}
|
||||
pdbentry->precnode = pNewRecNode;
|
||||
ppvd = dbPvdAdd(pdbentry->pdbbase,precordType,pNewRecNode);
|
||||
if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);}
|
||||
return(status);
|
||||
return(0);
|
||||
}
|
||||
|
||||
long epicsShareAPI dbDeleteRecord(DBENTRY *pdbentry)
|
||||
@@ -1940,9 +1945,14 @@ long epicsShareAPI dbPutString(DBENTRY *pdbentry,char *pstring)
|
||||
strncpy((char *)pfield, pstring,pflddes->size);
|
||||
if((pflddes->special == SPC_CALC) && !stringHasMacro) {
|
||||
char rpcl[RPCL_LEN];
|
||||
char *psCalcrpcl = 0;
|
||||
short error_number;
|
||||
|
||||
status = postfix(pstring,rpcl,&error_number);
|
||||
if(status) {
|
||||
status = sCalcPostfix(pstring,&psCalcrpcl,&error_number);
|
||||
free((void *)psCalcrpcl);
|
||||
}
|
||||
if(status) status = S_dbLib_badField;
|
||||
}
|
||||
if((short)strlen(pstring) >= pflddes->size) status = S_dbLib_strLen;
|
||||
@@ -2310,10 +2320,15 @@ char * epicsShareAPI dbVerify(DBENTRY *pdbentry,char *pstring)
|
||||
}
|
||||
if((pflddes->special == SPC_CALC) && !stringHasMacro) {
|
||||
char rpcl[RPCL_LEN];
|
||||
char *psCalcrpcl = 0;
|
||||
short error_number;
|
||||
long status;
|
||||
|
||||
status = postfix(pstring,rpcl,&error_number);
|
||||
if(status) {
|
||||
status = sCalcPostfix(pstring,&psCalcrpcl,&error_number);
|
||||
free((void *)psCalcrpcl);
|
||||
}
|
||||
if(status) {
|
||||
sprintf(message,"Illegal Calculation String");
|
||||
return(message);
|
||||
|
||||
@@ -193,6 +193,7 @@ int epicsShareAPI dbIsDefaultValue(DBENTRY *pdbentry)
|
||||
void *pfield = pdbentry->pfield;
|
||||
|
||||
if(!pflddes) return(FALSE);
|
||||
if(pflddes->field_type==DBF_DEVICE) return(FALSE);
|
||||
if(!pfield) return(TRUE);
|
||||
switch (pflddes->field_type) {
|
||||
case DBF_STRING:
|
||||
@@ -231,7 +232,7 @@ int epicsShareAPI dbIsDefaultValue(DBENTRY *pdbentry)
|
||||
if(!pinitial) return(FALSE);
|
||||
return(strcmp(pinitial,pfield)==0);
|
||||
}
|
||||
case DBF_DEVICE:
|
||||
case DBF_DEVICE: /*Should never reach this state*/
|
||||
return(FALSE);
|
||||
case DBF_INLINK:
|
||||
case DBF_OUTLINK:
|
||||
|
||||
@@ -219,13 +219,16 @@ long ErRegisterErrorHandler(int Card, ERROR_FUNC func)
|
||||
******************************************************************************/
|
||||
long ErGetTicks(int Card, unsigned long *Ticks)
|
||||
{
|
||||
int key;
|
||||
if (ErHaveReceiver(Card) < 0)
|
||||
return(-1);
|
||||
|
||||
/* BUG -- Do we read the HI first or the low? */
|
||||
|
||||
key = intLock();
|
||||
*Ticks = ErLink[Card].pEr->EventCounterLo;
|
||||
*Ticks += ErLink[Card].pEr->EventCounterHi << 16;
|
||||
intUnlock(key);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/07/07 20:07:13 mrk
|
||||
* sscanf response now checked to be equal to 1 rather than just not zero.
|
||||
*
|
||||
* Revision 1.1 1998/01/21 20:46:55 mrk
|
||||
* restructure; new Symb support
|
||||
*
|
||||
* Revision 1.36 1998/01/20 22:08:59 mrk
|
||||
* cleanup includes
|
||||
*
|
||||
@@ -1441,13 +1447,16 @@ struct gpibDpvt *pdpvt;
|
||||
else /* interpret msg with predefined format and write into .val */
|
||||
{
|
||||
/* scan response string, return value will be 1 if successful */
|
||||
if(sscanf(pdpvt->msg,pCmd->format,&value))
|
||||
if(sscanf(pdpvt->msg,pCmd->format,&value)==1)
|
||||
{
|
||||
pai->val = value;
|
||||
pai->udf = FALSE;
|
||||
}
|
||||
else /* sscanf did not find or assign the parameter */
|
||||
{
|
||||
if(ibSrqDebug)
|
||||
printf("error %s msg %s lenmsg %d\n",
|
||||
pai->name,pdpvt->msg,strlen(pdpvt->msg));
|
||||
devGpibLib_setPvSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
@@ -1603,13 +1612,16 @@ struct gpibDpvt *pdpvt;
|
||||
else /* interpret msg with predefined format and write into .val */
|
||||
{
|
||||
/* scan response string, return value will be 1 if successful */
|
||||
if(sscanf(pdpvt->msg,pCmd->format,&value))
|
||||
if(sscanf(pdpvt->msg,pCmd->format,&value)==1)
|
||||
{
|
||||
pli->val = value;
|
||||
pli->udf = FALSE;
|
||||
}
|
||||
else /* sscanf did not find or assign the parameter */
|
||||
{
|
||||
if(ibSrqDebug)
|
||||
printf("error %s msg %s lenmsg %d\n",
|
||||
pli->name,pdpvt->msg,strlen(pdpvt->msg));
|
||||
devGpibLib_setPvSevr(pli,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
@@ -1766,10 +1778,14 @@ struct gpibDpvt *pdpvt;
|
||||
}
|
||||
else
|
||||
{ /* Scan response string, return value will be 1 if successful */
|
||||
if(sscanf(pdpvt->msg,pCmd->format, &value))
|
||||
if(sscanf(pdpvt->msg,pCmd->format, &value)==1) {
|
||||
pbi->rval = value;
|
||||
else /* sscanf did not find or assign the parameter */
|
||||
} else { /* sscanf did not find or assign the parameter */
|
||||
if(ibSrqDebug)
|
||||
printf("error %s msg %s lenmsg %d\n",
|
||||
pbi->name,pdpvt->msg,strlen(pdpvt->msg));
|
||||
devGpibLib_setPvSevr(pbi,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
}
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
@@ -1927,10 +1943,14 @@ struct gpibDpvt *pdpvt;
|
||||
}
|
||||
else
|
||||
{ /* Scan response string, return value will be 1 if successful */
|
||||
if(sscanf(pdpvt->msg, pCmd->format, &value))
|
||||
if(sscanf(pdpvt->msg,pCmd->format, &value)==1) {
|
||||
pmbbi->rval = value;
|
||||
else /* sscanf did not find or assign the parameter */
|
||||
} else { /* sscanf did not find or assign the parameter */
|
||||
if(ibSrqDebug)
|
||||
printf("error %s msg %s lenmsg %d\n",
|
||||
pmbbi->name,pdpvt->msg,strlen(pdpvt->msg));
|
||||
devGpibLib_setPvSevr(pmbbi,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
}
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
|
||||
@@ -5,7 +5,7 @@ USR_INCLUDES = -I../../drv
|
||||
|
||||
SRCS.c += ../devAnalytekGpib.c
|
||||
SRCS.c += ../devXxDg535Gpib.c
|
||||
SRCS.c += ../devBBInteract.c
|
||||
#SRCS.c += ../devBBInteract.c
|
||||
SRCS.c += ../devGpibInteract.c
|
||||
SRCS.c += ../devXxSr620Gpib.c
|
||||
SRCS.c += ../devK486Gpib.c
|
||||
|
||||
@@ -553,34 +553,6 @@ static struct gpibCmd gpibCmds[] =
|
||||
/* The following is the number of elements in the command array above. */
|
||||
#define NUMPARAMS sizeof(gpibCmds)/sizeof(struct gpibCmd)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
*
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
*
|
||||
* If the parm is specified on a non-passive record, it will NOT be processed
|
||||
* when an unsolicited SRQ is detected.
|
||||
*
|
||||
******************************************************************************/
|
||||
static struct devGpibParmBlock devSupParms = {
|
||||
&AnalytekDebug, /* debugging flag pointer */
|
||||
-1, /* set to -1 if the device does NOT respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
-1, /* magic SRQ param number (-1 if none) */
|
||||
"devXxAnalytekGpib", /* device support module type name */
|
||||
DMA_TIME, /* # of clock ticks to wait for DMA completions */
|
||||
|
||||
NULL, /* pointer to SRQ handler function (NULL if none) */
|
||||
NULL /* pointer to secondary conversion routine */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialization for device support
|
||||
@@ -594,8 +566,22 @@ static struct devGpibParmBlock devSupParms = {
|
||||
STATIC long
|
||||
init_dev_sup(int parm)
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &AnalytekDebug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = -1;
|
||||
devSupParms.name = "devXxAnalytekGpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = 0;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm, &DSET_AI));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
||||
+13
-29
@@ -265,35 +265,6 @@ static struct gpibCmd gpibCmds[] =
|
||||
/* The following is the number of elements in the command array above. */
|
||||
#define NUMPARAMS sizeof(gpibCmds)/sizeof(struct gpibCmd)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
*
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
*
|
||||
* If the parm is specified on a non-passive record, it will NOT be processed
|
||||
* when an unsolicited SRQ is detected.
|
||||
*
|
||||
******************************************************************************/
|
||||
static struct devGpibParmBlock devSupParms =
|
||||
{
|
||||
&K486Debug, /* debugging flag pointer */
|
||||
-1, /* set to -1 if the device does NOT respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
-1, /* magic SRQ param number (-1 if none) */
|
||||
"devXxK486Gpib", /* device support module type name */
|
||||
DMA_TIME, /* # of clock ticks to wait for DMA completions */
|
||||
|
||||
NULL, /* pointer to SRQ handler function (NULL if none) */
|
||||
NULL /* pointer to secondary conversion routine */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialization for device support
|
||||
@@ -308,6 +279,19 @@ static long
|
||||
init_dev_sup(parm)
|
||||
int parm;
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &K486Debug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = -1;
|
||||
devSupParms.name = "devXxK486Gpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = 0;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm, &DSET_AI));
|
||||
}
|
||||
|
||||
|
||||
@@ -266,38 +266,6 @@ static struct gpibCmd gpibCmds[] =
|
||||
/* The following is the number of elements in the command array above. */
|
||||
#define NUMPARAMS sizeof(gpibCmds)/sizeof(struct gpibCmd)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
*
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
*
|
||||
* If the parm is specified on a non-passive record, it will NOT be processed
|
||||
* when an unsolicited SRQ is detected.
|
||||
*
|
||||
* In the future, the magic SRQ parm records will be processed as "I/O event
|
||||
* scanned"... not passive.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC struct devGpibParmBlock devSupParms = {
|
||||
&Dc5009Debug, /* debugging flag pointer */
|
||||
-1, /* device does not respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
4, /* magic SRQ param number (-1 if none) */
|
||||
"devXxDc5009Gpib", /* device support module type name */
|
||||
DMA_TIME, /* # of clock ticks to wait for DMA completions */
|
||||
|
||||
srqHandler, /* SRQ handler function (NULL if none) */
|
||||
|
||||
NULL /* secondary conversion routine (NULL if none) */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialization for device support
|
||||
@@ -309,6 +277,19 @@ STATIC struct devGpibParmBlock devSupParms = {
|
||||
STATIC long
|
||||
init_dev_sup(int parm)
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &Dc5009Debug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = 4;
|
||||
devSupParms.name = "devXxDc5009Gpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = srqHandler;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm,&DSET_AI));
|
||||
}
|
||||
|
||||
|
||||
+13
-28
@@ -664,34 +664,6 @@ static struct gpibCmd gpibCmds[] =
|
||||
/* The following is the number of elements in the command array above. */
|
||||
#define NUMPARAMS sizeof(gpibCmds)/sizeof(struct gpibCmd)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
*
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
*
|
||||
* If the parm is specified on a non-passive record, it will NOT be processed
|
||||
* when an unsolicited SRQ is detected.
|
||||
*
|
||||
******************************************************************************/
|
||||
static struct devGpibParmBlock devSupParms = {
|
||||
&Dg535Debug, /* debugging flag pointer */
|
||||
-1, /* set to -1 if the device does NOT respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
-1, /* magic SRQ param number (-1 if none) */
|
||||
"devXxDg535Gpib", /* device support module type name */
|
||||
DMA_TIME, /* # of clock ticks to wait for DMA completions */
|
||||
|
||||
NULL, /* pointer to SRQ handler function (NULL if none) */
|
||||
NULL /* pointer to secondary conversion routine */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialization for device support
|
||||
@@ -703,6 +675,19 @@ static struct devGpibParmBlock devSupParms = {
|
||||
STATIC long
|
||||
init_dev_sup(int parm)
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &Dg535Debug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = -1;
|
||||
devSupParms.name = "devXxDg535Gpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = 0;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm, &DSET_AI));
|
||||
}
|
||||
|
||||
|
||||
+13
-28
@@ -240,34 +240,6 @@ static struct gpibCmd gpibCmds[] =
|
||||
/* The following is the number of elements in the command array above. */
|
||||
#define NUMPARAMS sizeof(gpibCmds)/sizeof(struct gpibCmd)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
*
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
*
|
||||
* If the parm is specified on a non-passive record, it will NOT be processed
|
||||
* when an unsolicited SRQ is detected.
|
||||
*
|
||||
******************************************************************************/
|
||||
static struct devGpibParmBlock devSupParms = {
|
||||
&K196Debug, /* debugging flag pointer */
|
||||
-1, /* set to -1 if the device does NOT respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
-1, /* magic SRQ param number (-1 if none) */
|
||||
"devXxK196Gpib", /* device support module type name */
|
||||
DMA_TIME, /* # of clock ticks to wait for DMA completions */
|
||||
|
||||
NULL, /* pointer to SRQ handler function (NULL if none) */
|
||||
NULL /* pointer to secondary conversion routine */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialization for device support
|
||||
@@ -281,6 +253,19 @@ static struct devGpibParmBlock devSupParms = {
|
||||
static long
|
||||
init_dev_sup(int parm)
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &K196Debug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = -1;
|
||||
devSupParms.name = "devXxK196Gpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = 0;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm, &DSET_AI));
|
||||
}
|
||||
|
||||
|
||||
+13
-28
@@ -176,34 +176,6 @@ static struct gpibCmd gpibCmds[] =
|
||||
/* The following is the number of elements in the command array above. */
|
||||
#define NUMPARAMS sizeof(gpibCmds)/sizeof(struct gpibCmd)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
*
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
*
|
||||
* If the parm is specified on a non-passive record, it will NOT be processed
|
||||
* when an unsolicited SRQ is detected.
|
||||
*
|
||||
******************************************************************************/
|
||||
static struct devGpibParmBlock devSupParms = {
|
||||
&K263Debug, /* debugging flag pointer */
|
||||
-1, /* set to -1 if the device does NOT respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
-1, /* magic SRQ param number (-1 if none) */
|
||||
"devXxK263Gpib", /* device support module type name */
|
||||
DMA_TIME, /* # of clock ticks to wait for DMA completions */
|
||||
|
||||
NULL, /* pointer to SRQ handler function (NULL if none) */
|
||||
NULL /* pointer to secondary conversion routine */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialization for device support
|
||||
@@ -217,6 +189,19 @@ static struct devGpibParmBlock devSupParms = {
|
||||
static long
|
||||
init_dev_sup(int parm)
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &K263Debug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = -1;
|
||||
devSupParms.name = "devXxK263Gpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = 0;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm, &DSET_AI));
|
||||
}
|
||||
|
||||
|
||||
@@ -274,9 +274,13 @@ static struct gpibCmd gpibCmds[] =
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
* Initialization for device support
|
||||
* This is called one time before any records are initialized with a parm
|
||||
* value of 0. And then again AFTER all record-level init is complete
|
||||
* with a param value of 1.
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
@@ -287,32 +291,23 @@ static struct gpibCmd gpibCmds[] =
|
||||
* In the future, the magic SRQ parm records will be processed as "I/O event
|
||||
* scanned"... not passive.
|
||||
*
|
||||
******************************************************************************/
|
||||
static struct devGpibParmBlock devSupParms = {
|
||||
&SkeletonDebug, /* debugging flag pointer */
|
||||
-1, /* device does not respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
-1, /* magic SRQ param number (-1 if none) */
|
||||
"devXxSkeletonGpib", /* device support module type name */
|
||||
DMA_TIME, /* # of clock ticks to wait for DMA completions */
|
||||
NULL, /* SRQ handler function (NULL if none) */
|
||||
NULL /* secondary conversion routine (NULL if none) */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Initialization for device support
|
||||
* This is called one time before any records are initialized with a parm
|
||||
* value of 0. And then again AFTER all record-level init is complete
|
||||
* with a param value of 1.
|
||||
*
|
||||
******************************************************************************/
|
||||
*****************************************************************************/
|
||||
STATIC long
|
||||
init_dev_sup(int parm)
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &SkeletonDebug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = -1;
|
||||
devSupParms.name = "devXxSkeletonGpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = 0;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm,&DSET_AI));
|
||||
}
|
||||
|
||||
|
||||
+13
-29
@@ -204,35 +204,6 @@ static struct gpibCmd gpibCmds[] =
|
||||
/* The following is the number of elements in the command array above. */
|
||||
#define NUMPARAMS sizeof(gpibCmds)/sizeof(struct gpibCmd)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Structure containing the user's functions and operating parameters needed
|
||||
* by the gpib library functions.
|
||||
*
|
||||
* The magic SRQ parm is the parm number that, if specified on a passive
|
||||
* record, will cause the record to be processed automatically when an
|
||||
* unsolicited SRQ interrupt is detected from the device.
|
||||
*
|
||||
* If the parm is specified on a non-passive record, it will NOT be processed
|
||||
* when an unsolicited SRQ is detected.
|
||||
*
|
||||
******************************************************************************/
|
||||
static struct devGpibParmBlock devSupParms = {
|
||||
&sr620Debug, /* debugging flag pointer */
|
||||
-1, /* device does not respond to writes */
|
||||
TIME_WINDOW, /* # of clock ticks to skip after a device times out */
|
||||
NULL, /* hwpvt list head */
|
||||
gpibCmds, /* GPIB command array */
|
||||
NUMPARAMS, /* number of supported parameters */
|
||||
-1, /* magic SRQ param number */
|
||||
"devXxSr620Gpib", /* device support module type name */
|
||||
DMA_TIME,
|
||||
|
||||
srqHandler, /* pointer to SRQ handler function */
|
||||
|
||||
NULL /* pointer to secondary converstion routine */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This is invoked by the linkTask when an SRQ is detected from a device
|
||||
@@ -308,6 +279,19 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
STATIC long
|
||||
init_dev_sup(int parm)
|
||||
{
|
||||
if(parm==0) {
|
||||
devSupParms.debugFlag = &sr620Debug;
|
||||
devSupParms.respond2Writes = -1;
|
||||
devSupParms.timeWindow = TIME_WINDOW;
|
||||
devSupParms.hwpvtHead = 0;
|
||||
devSupParms.gpibCmds = gpibCmds;
|
||||
devSupParms.numparams = NUMPARAMS;
|
||||
devSupParms.magicSrq = -1;
|
||||
devSupParms.name = "devXxSr620Gpib";
|
||||
devSupParms.dmaTimeout = DMA_TIME;
|
||||
devSupParms.srqHandler = srqHandler;
|
||||
devSupParms.wrConversion = 0;
|
||||
}
|
||||
return(devGpibLib_initDevSup(parm, &DSET_AI));
|
||||
}
|
||||
|
||||
|
||||
+14
-9
@@ -12,27 +12,34 @@ else
|
||||
USR_CFLAGS = -fshared-data -fvolatile
|
||||
endif
|
||||
|
||||
INC += drvBB232.h
|
||||
INC += drvBitBus.h
|
||||
#The following have been unbundled. DONT USE THESE
|
||||
#INC += drvBB232.h
|
||||
#INC += drvBitBus.h
|
||||
INC += drvBitBusErr.h
|
||||
#INC += drvMsg.h
|
||||
#drvBitBusInterface APPEARS HERE AND IN UNBUNDLED - BIG PROBLEM
|
||||
INC += drvBitBusInterface.h
|
||||
#SRCS.c += ../drvBB232.c
|
||||
#SRCS.c += ../drvBitBus.c
|
||||
#SRCS.c += ../drvMsg.c
|
||||
#SRCS.c += ../drvTranServ.c
|
||||
|
||||
#The following have not been used
|
||||
#INC += drvRs232.h
|
||||
#INC += drvTy232.h
|
||||
|
||||
INC += drvGpib.h
|
||||
INC += drvGpibErr.h
|
||||
INC += drvGpibInterface.h
|
||||
INC += drvHiDEOSGpib.h
|
||||
INC += drvJgvtr1.h
|
||||
INC += drvMsg.h
|
||||
INC += drvOms.h
|
||||
INC += drvRs232.h
|
||||
INC += drvTy232.h
|
||||
INC += steppermotor.h
|
||||
|
||||
|
||||
SRCS.c += ../module_types.c
|
||||
SRCS.c += ../drvBB232.c
|
||||
SRCS.c += ../drvBb902.c
|
||||
SRCS.c += ../drvBb910.c
|
||||
SRCS.c += ../drvBitBus.c
|
||||
SRCS.c += ../drvComet.c
|
||||
SRCS.c += ../drvCompuSm.c
|
||||
SRCS.c += ../drvDvx.c
|
||||
@@ -40,9 +47,7 @@ SRCS.c += ../drvFp.c
|
||||
SRCS.c += ../drvFpm.c
|
||||
SRCS.c += ../drvGpib.c
|
||||
SRCS.c += ../drvJgvtr1.c
|
||||
SRCS.c += ../drvMsg.c
|
||||
SRCS.c += ../drvOms.c
|
||||
#SRCS.c += ../drvTranServ.c
|
||||
SRCS.c += ../drvVmi4100.c
|
||||
SRCS.c += ../drvXy010.c
|
||||
SRCS.c += ../drvXy210.c
|
||||
|
||||
@@ -15,7 +15,7 @@ typedef struct /* ERRSYMBOL - entry in symbol table */
|
||||
} ERRSYMBOL;
|
||||
typedef struct /* ERRSYMTAB - symbol table */
|
||||
{
|
||||
short nsymbols; /* current number of symbols in table */
|
||||
int nsymbols; /* current number of symbols in table */
|
||||
ERRSYMBOL *symbols; /* ptr to array of symbol entries */
|
||||
} ERRSYMTAB;
|
||||
typedef ERRSYMTAB *ERRSYMTAB_ID;
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INCpostfixh
|
||||
#define INCpostfixh
|
||||
#ifndef INCsCalcPostfixH
|
||||
#define INCsCalcPostfixH
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
@@ -44,5 +44,5 @@ epicsShareFunc long epicsShareAPI
|
||||
char **psarg, int numSArgs, double *presult,
|
||||
char *psresult, int lenSresult, char *post);
|
||||
|
||||
#endif /* INCpostfixh */
|
||||
#endif /* INCsCalcPostfixH */
|
||||
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ extern "C" {
|
||||
*
|
||||
*----------------------------------------------------------------------------
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct TS_STAMP {
|
||||
epicsUInt32 secPastEpoch; /* seconds since 0000 Jan 1, 1990 */
|
||||
epicsUInt32 nsec; /* nanoseconds within second */
|
||||
} TS_STAMP;
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
|
||||
#define INC_tsDefs_h
|
||||
#if defined(vxWorks)
|
||||
|
||||
@@ -11,23 +11,50 @@ $arch = $ARGV[0];
|
||||
unlink("cdCommands");
|
||||
open(OUT,">cdCommands") or die "$! opening cdCommands";
|
||||
print OUT "startup = \"$cwd\"\n";
|
||||
|
||||
#appbin is kept for compatibility with 3.13.1
|
||||
$appbin = $cwd;
|
||||
$appbin =~ s/iocBoot.*//;
|
||||
$appbin = $appbin . "/bin/${arch}";
|
||||
print OUT "appbin = \"$appbin\"\n";
|
||||
#look for SHARE in <top>/config/RELEASE
|
||||
$release = $cwd;
|
||||
$release =~ s/iocBoot.*//;
|
||||
$release = $release . "config/RELEASE";
|
||||
|
||||
$top = $cwd;
|
||||
$top =~ s/\/iocBoot.*//;
|
||||
print OUT "top = \"$top\"\n";
|
||||
$topbin = "${top}/bin/${arch}";
|
||||
#skip check that top/bin/${arch} exists; src may not have been builT
|
||||
print OUT "topbin = \"$topbin\"\n";
|
||||
$release = "$top/config/RELEASE";
|
||||
if (-r "$release") {
|
||||
open(IN, "$release") or die "Cannot open $release\n";
|
||||
while (<IN>) {
|
||||
chomp;
|
||||
s/^SHARE\s*=\s*// and $share = $_, break;
|
||||
while ($line = <IN>) {
|
||||
next if ( $line =~ /\s*#/ );
|
||||
chomp($line);
|
||||
$_ = $line;
|
||||
#the following looks for
|
||||
# prefix = $(macro)post
|
||||
($prefix,$macro,$post) = /(.*)\s*=\s*\$\((.*)\)(.*)/;
|
||||
if ($macro eq "") { # true if no macro is present
|
||||
# the following looks for
|
||||
# prefix = post
|
||||
($prefix,$post) = /(.*)\s*=\s*(.*)/;
|
||||
} else {
|
||||
$base = $applications{$macro};
|
||||
if ($base eq "") {
|
||||
print "error: $macro was not previously defined\n";
|
||||
} else {
|
||||
$post = $base . $post;
|
||||
}
|
||||
}
|
||||
$applications{$prefix} = $post;
|
||||
$app = lc($prefix);
|
||||
if ( -d "$post") { #check that directory exists
|
||||
print OUT "$app = \"$post\"\n";
|
||||
}
|
||||
if ( -d "$post/bin/$arch") { #check that directory exists
|
||||
print OUT "${app}bin = \"$post/bin/$arch\"\n";
|
||||
}
|
||||
}
|
||||
close IN;
|
||||
}
|
||||
if ( "$share" ) {
|
||||
print OUT "share = \"$share\"\n";
|
||||
}
|
||||
close OUT;
|
||||
|
||||
@@ -4,7 +4,7 @@ record(calc, "$(USER):calcExample$(NO)")
|
||||
field(SCAN,"$(SCAN)")
|
||||
field(FLNK, "$(USER):aiExample$(NO)")
|
||||
field(CALC, "(A<B)?(A+C):D")
|
||||
field(INPA, "$(USER):calcExample.VAL NPP NMS")
|
||||
field(INPA, "$(USER):calcExample$(NO).VAL NPP NMS")
|
||||
field(INPB, "9")
|
||||
field(INPC, "1")
|
||||
field(INPD, "0")
|
||||
|
||||
@@ -237,6 +237,7 @@ static long special(DBADDR *paddr,int after)
|
||||
return(S_db_noMod);
|
||||
}
|
||||
pai->init=TRUE;
|
||||
pai->eoff = pai->egul;
|
||||
if(!(pdset->special_linconv)) return(0);
|
||||
return((*pdset->special_linconv)(pai,after));
|
||||
default:
|
||||
|
||||
@@ -300,6 +300,7 @@ static long special(paddr,after)
|
||||
return(S_db_noMod);
|
||||
}
|
||||
pao->init=TRUE;
|
||||
pao->eoff = pao->egul;
|
||||
if(!(pdset->special_linconv)) return(0);
|
||||
return((*pdset->special_linconv)(pao,after));
|
||||
default:
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
* .16 07-15-92 jba changed VALID_ALARM to INVALID alarm
|
||||
* .17 07-16-92 jba added invalid alarm fwd link test and chngd fwd lnk to macro
|
||||
* .18 05-09-94 jba Fixed the updating of pcompress->inx in array_average
|
||||
* .19 03-16-99 wfl Added "N to 1 Median" algorithm (implemented
|
||||
* only for array inputs; regular "Median" is not
|
||||
* implemented)
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
@@ -162,6 +165,17 @@ static void put_value(compressRecord *pcompress,double *psource, long n)
|
||||
return;
|
||||
}
|
||||
|
||||
/* qsort comparison function (for median calculation) */
|
||||
static int compare(const void *arg1, const void *arg2)
|
||||
{
|
||||
double a = *(double *)arg1;
|
||||
double b = *(double *)arg2;
|
||||
|
||||
if ( a < b ) return -1;
|
||||
else if ( a == b ) return 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
static int compress_array(compressRecord *pcompress,
|
||||
double *psource,long no_elements)
|
||||
{
|
||||
@@ -219,7 +233,16 @@ static int compress_array(compressRecord *pcompress,
|
||||
put_value(pcompress,&value,1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (compressALG_N_to_1_Median):
|
||||
/* compress N to 1 keeping the median value */
|
||||
/* note: sorts source array (OK; it's a work pointer) */
|
||||
for (i = 0; i < nnew; i++, psource+=nnew){
|
||||
qsort(psource,n,sizeof(double),compare);
|
||||
value=psource[n/2];
|
||||
put_value(pcompress,&value,1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -285,7 +308,9 @@ static int compress_scalar(struct compressRecord *pcompress,double *psource)
|
||||
if ((value > *pdest) || (inx == 0))
|
||||
*pdest = value;
|
||||
break;
|
||||
/* for scalars, Median not implemented => use average */
|
||||
case (compressALG_N_to_1_Average):
|
||||
case (compressALG_N_to_1_Median):
|
||||
if (inx == 0)
|
||||
*pdest = value;
|
||||
else {
|
||||
|
||||
@@ -4,6 +4,7 @@ menu(compressALG) {
|
||||
choice(compressALG_N_to_1_Average,"N to 1 Average")
|
||||
choice(compressALG_Average,"Average")
|
||||
choice(compressALG_Circular_Buffer,"Circular Buffer")
|
||||
choice(compressALG_N_to_1_Median,"N to 1 Median")
|
||||
}
|
||||
recordtype(compress) {
|
||||
include "dbCommon.dbd"
|
||||
|
||||
+26
-31
@@ -108,27 +108,34 @@ static long readValue();
|
||||
|
||||
#define NUM_BITS 16
|
||||
|
||||
/* refreshes all the bit fields based on a hardware value */
|
||||
static void refresh_bits(pmbbiDirect)
|
||||
/* refreshes all the bit fields based on a hardware value
|
||||
and sends monitors if the bit's value or the record's
|
||||
severity/status have changed */
|
||||
static void refresh_bits(pmbbiDirect, monitor_mask)
|
||||
struct mbbiDirectRecord *pmbbiDirect;
|
||||
unsigned short monitor_mask;
|
||||
{
|
||||
int i, mask = 1;
|
||||
unsigned short i;
|
||||
unsigned short mask = 1;
|
||||
unsigned short momask;
|
||||
unsigned char *bit;
|
||||
|
||||
bit = &(pmbbiDirect->b0);
|
||||
for (i=0; i<NUM_BITS; i++, mask = mask << 1, bit++) {
|
||||
momask = monitor_mask;
|
||||
if (pmbbiDirect->val & mask) {
|
||||
if (*bit == 0) {
|
||||
*bit = 1;
|
||||
db_post_events(pmbbiDirect,bit,DBE_VALUE|DBE_LOG);
|
||||
momask |= DBE_VALUE | DBE_LOG;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (*bit != 0) {
|
||||
*bit = 0;
|
||||
db_post_events(pmbbiDirect,bit,DBE_VALUE|DBE_LOG);
|
||||
momask |= DBE_VALUE | DBE_LOG;
|
||||
}
|
||||
}
|
||||
if (momask)
|
||||
db_post_events(pmbbiDirect,bit,momask);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +176,7 @@ static long init_record(pmbbiDirect,pass)
|
||||
}
|
||||
if( pdset->init_record ) {
|
||||
if((status=(*pdset->init_record)(pmbbiDirect))) return(status);
|
||||
refresh_bits(pmbbiDirect);
|
||||
refresh_bits(pmbbiDirect, 0);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -204,9 +211,6 @@ static long process(pmbbiDirect)
|
||||
}
|
||||
else if(status == 2) status = 0;
|
||||
|
||||
/* Thomas Birke of BESSY suggested */
|
||||
refresh_bits(pmbbiDirect);
|
||||
|
||||
/* check event list */
|
||||
monitor(pmbbiDirect);
|
||||
|
||||
@@ -222,13 +226,11 @@ static void monitor(pmbbiDirect)
|
||||
{
|
||||
unsigned short monitor_mask;
|
||||
|
||||
/*
|
||||
* Monitors for Bit Fields are done in the refresh_bits()
|
||||
* routine.
|
||||
*/
|
||||
|
||||
monitor_mask = recGblResetAlarms(pmbbiDirect);
|
||||
|
||||
/* send out bit field monitors (value change and sevr change) */
|
||||
refresh_bits(pmbbiDirect, monitor_mask);
|
||||
|
||||
/* check for value change */
|
||||
if (pmbbiDirect->mlst != pmbbiDirect->val) {
|
||||
/* post events for value change and archive change */
|
||||
@@ -256,7 +258,6 @@ static long readValue(pmbbiDirect)
|
||||
|
||||
if (pmbbiDirect->pact == TRUE){
|
||||
status=(*pdset->read_mbbi)(pmbbiDirect);
|
||||
refresh_bits(pmbbiDirect);
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -267,23 +268,17 @@ static long readValue(pmbbiDirect)
|
||||
|
||||
if (pmbbiDirect->simm == NO){
|
||||
status=(*pdset->read_mbbi)(pmbbiDirect);
|
||||
refresh_bits(pmbbiDirect);
|
||||
return(status);
|
||||
}
|
||||
if (pmbbiDirect->simm == YES){
|
||||
status=dbGetLink(&(pmbbiDirect->siol),
|
||||
DBR_USHORT,&(pmbbiDirect->sval),0,0);
|
||||
if (status==0){
|
||||
pmbbiDirect->val=pmbbiDirect->sval;
|
||||
pmbbiDirect->udf=FALSE;
|
||||
refresh_bits(pmbbiDirect);
|
||||
}
|
||||
status=2; /* dont convert */
|
||||
} else {
|
||||
status=-1;
|
||||
recGblSetSevr(pmbbiDirect,SOFT_ALARM,INVALID_ALARM);
|
||||
return(status);
|
||||
|
||||
status=dbGetLink(&(pmbbiDirect->siol),
|
||||
DBR_USHORT,&(pmbbiDirect->sval),0,0);
|
||||
if (status==0){
|
||||
pmbbiDirect->val=pmbbiDirect->sval;
|
||||
pmbbiDirect->udf=FALSE;
|
||||
}
|
||||
status=2; /* don't convert */
|
||||
|
||||
recGblSetSevr(pmbbiDirect,SIMM_ALARM,pmbbiDirect->sims);
|
||||
|
||||
return(status);
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
use File::Path;
|
||||
use Getopt::Std;
|
||||
getopt();
|
||||
getopt "";
|
||||
|
||||
foreach $dir ( @ARGV )
|
||||
{
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ use File::Path;
|
||||
use File::Find;
|
||||
use Getopt::Std;
|
||||
|
||||
getopt();
|
||||
getopt "";
|
||||
|
||||
foreach $arg ( @ARGV )
|
||||
{
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
# Solaris rc2 script for EPICS IOC Log Server process.
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.2 1999/05/17 15:09:59 anj
|
||||
# Moved export statements to the right place.
|
||||
#
|
||||
# Revision 1.1 1995/03/30 23:17:59 jba
|
||||
# Added solaris scripts for starting caRepeater and iocLogServer - anj
|
||||
#
|
||||
#
|
||||
|
||||
INSTALL_BIN=:INSTALL_BIN:
|
||||
@@ -11,12 +17,9 @@ EPICS=:EPICS:
|
||||
# To change the default values for the EPICS Environment parameters,
|
||||
# uncomment and modify the relevant lines below.
|
||||
|
||||
# export EPICS_IOC_LOG_PORT
|
||||
# export EPICS_IOC_LOG_FILE_NAME
|
||||
# export EPICS_IOC_LOG_FILE_LIMIT
|
||||
# EPICS_IOC_LOG_PORT="6500"
|
||||
# EPICS_IOC_LOG_FILE_NAME="$EPICS/logs/iocLog"
|
||||
# EPICS_IOC_LOG_FILE_LIMIT="1000000"
|
||||
# EPICS_IOC_LOG_PORT="6500"; export EPICS_IOC_LOG_PORT
|
||||
# EPICS_IOC_LOG_FILE_NAME="$EPICS/logs/iocLog"; export EPICS_IOC_LOG_FILE_NAME
|
||||
# EPICS_IOC_LOG_FILE_LIMIT="1000000"; export EPICS_IOC_LOG_FILE_LIMIT
|
||||
|
||||
if [ $1 = "start" ]; then
|
||||
if [ -x $INSTALL_BIN/iocLogServer ]; then
|
||||
|
||||
Reference in New Issue
Block a user