Merge branch '7.0' into PSI-7.0
This commit is contained in:
commit
15ba5ed863
169 files changed
+1183
-898
No files matched your search
@@ -15,8 +15,8 @@ THESE_RULES := $(IOCDIR)/db/RULES
|
||||
|
||||
dbCommon.h$(DEP): $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES) \
|
||||
$(DBDTORECTYPEH_dep)
|
||||
@$(RM) $@
|
||||
@$(DBTORECORDTYPEH) -D -I ../db -I $(COMMON_DIR) -o $(COMMONDEP_TARGET) $< > $@
|
||||
@$(DBTORECORDTYPEH) -D -I ../db -I $(COMMON_DIR) -o $(COMMONDEP_TARGET) $< > $@.stdout
|
||||
$(MV) $@.stdout $@
|
||||
|
||||
$(COMMON_DIR)/dbCommonRecord.html: ../db/dbCommon.dbd.pod
|
||||
|
||||
|
||||
@@ -193,18 +193,24 @@ DBCORE_API void callbackQueueShow(const int reset);
|
||||
* By default, only one thread is run for each priority (3 in total).
|
||||
*
|
||||
* Calling with count==0 will take the count from the callbackParallelThreadsDefault
|
||||
* global variable (default default is 2).
|
||||
* global variable (initialized to the number of CPU cores initially available to
|
||||
* the main thread).
|
||||
* Calling with count>0 sets the number of worker threads directly.
|
||||
* Calling with count<0 computes the count based on the number of CPU cores on the host.
|
||||
* Calling with count<0 computes the count based on the number of CPU cores
|
||||
* currently available to the calling thread,
|
||||
* eg. Passing -2 on an 8 core system will start 6 worker threads.
|
||||
* In all cases, at least one worker thread will always run.
|
||||
* The iocsh wrapper also accepts positive or negative percentages for count,
|
||||
* which allows to refer to a fraction of the currently available CPU cores,
|
||||
* always rounding the number of created threads down.
|
||||
* In any case, at least one worker thread will always run.
|
||||
*
|
||||
* A special prio name of "*" will modify all priorities.
|
||||
* An empty prio name or the special value "*" will modify all priorities.
|
||||
* Otherwise, only the named priority is modified.
|
||||
* The prio names are case insensitive.
|
||||
*
|
||||
* @param count If zero, reset to default (callbackParallelThreadsDefault global/iocsh variable).
|
||||
* If positive, exact number of worker threads to create.
|
||||
* If negative, number of worker threads less than core count.
|
||||
* If negative, reserve this many CPUs to _not_ run parallel callback threads.
|
||||
* @param prio Priority name. eg. "*", "LOW", "MEDIUM" or "HIGH".
|
||||
* @return zero on success, non-zero if called after iocInit() or with invalid arguments.
|
||||
*
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
/* We can't include dbStaticLib.h here */
|
||||
#define dbCalloc(nobj,size) callocMustSucceed(nobj,size,"dbCalloc")
|
||||
|
||||
#include <epicsAtomic.h>
|
||||
#include "db_access_routines.h"
|
||||
#include "dbCa.h"
|
||||
#include "dbCaPvt.h"
|
||||
@@ -64,6 +65,7 @@ extern int dbServiceIsolate;
|
||||
static ELLLIST workList = ELLLIST_INIT; /* Work list for dbCaTask */
|
||||
static epicsMutexId workListLock; /*Mutual exclusions semaphores for workList*/
|
||||
static epicsEventId workListEvent; /*wakeup event for dbCaTask*/
|
||||
static size_t initOutstanding; // one count for every link with DBCA_CALLBACK_INIT_WAIT
|
||||
static int removesOutstanding = 0;
|
||||
#define removesOutstandingWarning 10000
|
||||
|
||||
@@ -351,7 +353,7 @@ static void dbCaLinkInitImpl(int isolate)
|
||||
dbCaCtl = ctlPause;
|
||||
|
||||
dbCaWorker = epicsThreadCreateOpt("dbCaLink", dbCaTask, NULL, &opts);
|
||||
/* wait for worker to startup and initialize dbCaClientContext */
|
||||
/* wait for worker to startup, initialize dbCaClientContext, and connect local CA */
|
||||
epicsEventMustWait(startStopEvent);
|
||||
}
|
||||
|
||||
@@ -370,6 +372,10 @@ void dbCaRun(void)
|
||||
if (dbCaCtl == ctlPause) {
|
||||
dbCaCtl = ctlRun;
|
||||
epicsEventSignal(workListEvent);
|
||||
|
||||
while(epicsAtomicGetSizeT(&initOutstanding)) {
|
||||
epicsEventMustWait(startStopEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,11 +386,12 @@ void dbCaPause(void)
|
||||
epicsEventSignal(workListEvent);
|
||||
}
|
||||
}
|
||||
|
||||
void dbCaAddLinkCallback(struct link *plink,
|
||||
dbCaCallback connect, dbCaCallback monitor, void *userPvt)
|
||||
void dbCaAddLinkCallbackOpt(struct dbLocker *locker, struct link *plink,
|
||||
dbCaCallback connect, dbCaCallback monitor, void *userPvt,
|
||||
unsigned flags)
|
||||
{
|
||||
caLink *pca;
|
||||
(void)locker; /* Passed for symmetry with dbDbAddLink(). So far unused. */
|
||||
|
||||
assert(!plink->value.pv_link.pvt);
|
||||
|
||||
@@ -396,6 +403,10 @@ void dbCaAddLinkCallback(struct link *plink,
|
||||
pca->connect = connect;
|
||||
pca->monitor = monitor;
|
||||
pca->userPvt = userPvt;
|
||||
pca->flags = flags;
|
||||
|
||||
if(flags & DBCA_CALLBACK_INIT_WAIT)
|
||||
epicsAtomicIncrSizeT(&initOutstanding);
|
||||
|
||||
epicsMutexMustLock(pca->lock);
|
||||
plink->lset = &dbCa_lset;
|
||||
@@ -405,15 +416,22 @@ void dbCaAddLinkCallback(struct link *plink,
|
||||
epicsMutexUnlock(pca->lock);
|
||||
}
|
||||
|
||||
void dbCaAddLinkCallback(struct link *plink,
|
||||
dbCaCallback connect, dbCaCallback monitor, void *userPvt)
|
||||
{
|
||||
dbCaAddLinkCallbackOpt(NULL, plink, connect, monitor, userPvt, 0);
|
||||
}
|
||||
|
||||
long dbCaAddLink(struct dbLocker *locker, struct link *plink, short dbfType)
|
||||
{
|
||||
dbCaAddLinkCallback(plink, 0, 0, NULL);
|
||||
dbCaAddLinkCallbackOpt(locker, plink, 0, 0, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dbCaRemoveLink(struct dbLocker *locker, struct link *plink)
|
||||
{
|
||||
caLink *pca = (caLink *)plink->value.pv_link.pvt;
|
||||
(void)locker; /* Passed for symmetry with dbDbRemoveLink(). So far unused. */
|
||||
|
||||
if (!pca) return;
|
||||
epicsMutexMustLock(pca->lock);
|
||||
@@ -841,6 +859,8 @@ static void connectionCallback(struct connection_handler_args arg)
|
||||
}
|
||||
pca->hasReadAccess = ca_read_access(arg.chid);
|
||||
pca->hasWriteAccess = ca_write_access(arg.chid);
|
||||
if (pca->flags & DBCA_CALLBACK_INIT_WAIT)
|
||||
link_action |= CA_INIT_READY; // declare initialized, unless cleared below
|
||||
|
||||
if (pca->gotFirstConnection) {
|
||||
if (pca->nelements != ca_element_count(arg.chid) ||
|
||||
@@ -875,9 +895,11 @@ static void connectionCallback(struct connection_handler_args arg)
|
||||
pca->dbrType = ca_field_type(arg.chid);
|
||||
if ((plink->value.pv_link.pvlMask & pvlOptInpNative) && !pca->pgetNative) {
|
||||
link_action |= CA_MONITOR_NATIVE;
|
||||
link_action &= ~CA_INIT_READY; // defer to eventCallback()
|
||||
}
|
||||
if ((plink->value.pv_link.pvlMask & pvlOptInpString) && !pca->pgetString) {
|
||||
link_action |= CA_MONITOR_STRING;
|
||||
link_action &= ~CA_INIT_READY; // defer to eventCallback()
|
||||
}
|
||||
if ((plink->value.pv_link.pvlMask & pvlOptOutNative) && pca->gotOutNative) {
|
||||
link_action |= CA_WRITE_NATIVE;
|
||||
@@ -889,6 +911,7 @@ static void connectionCallback(struct connection_handler_args arg)
|
||||
if (pca->dbrType != DBR_STRING) {
|
||||
/* will run connect() callback later */
|
||||
link_action |= CA_GET_ATTRIBUTES;
|
||||
link_action &= ~CA_INIT_READY; // defer to getAttribEventCallback()
|
||||
} else {
|
||||
connect = pca->connect;
|
||||
userPvt = pca->userPvt;
|
||||
@@ -909,6 +932,7 @@ static void eventCallback(struct event_handler_args arg)
|
||||
dbCaCallback monitor = 0;
|
||||
void *userPvt = 0;
|
||||
int doScan = 1;
|
||||
short link_action = 0;
|
||||
|
||||
assert(pca);
|
||||
epicsMutexMustLock(pca->lock);
|
||||
@@ -969,10 +993,13 @@ static void eventCallback(struct event_handler_args arg)
|
||||
if ((ppv_link->pvlMask & pvlOptCP) ||
|
||||
((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0))
|
||||
{
|
||||
addAction(pca, CA_DBPROCESS);
|
||||
link_action |= CA_DBPROCESS;
|
||||
}
|
||||
}
|
||||
if (pca->flags & DBCA_CALLBACK_INIT_WAIT)
|
||||
link_action |= CA_INIT_READY;
|
||||
done:
|
||||
if (link_action) addAction(pca, link_action);
|
||||
epicsMutexUnlock(pca->lock);
|
||||
if (monitor) monitor(userPvt);
|
||||
}
|
||||
@@ -1096,6 +1123,8 @@ static void getAttribEventCallback(struct event_handler_args arg)
|
||||
pca->alarmLimits[3] = pdbr->upper_alarm_limit;
|
||||
pca->precision = pdbr->precision;
|
||||
memcpy(pca->units, pdbr->units, MAX_UNITS_SIZE);
|
||||
if (pca->flags & DBCA_CALLBACK_INIT_WAIT)
|
||||
addAction(pca, CA_INIT_READY);
|
||||
epicsMutexUnlock(pca->lock);
|
||||
if (getAttributes) getAttributes(getAttributesPvt);
|
||||
if (connect) connect(userPvt);
|
||||
@@ -1110,7 +1139,7 @@ static void dbCaTask(void *arg)
|
||||
dbCaClientContext = ca_current_context ();
|
||||
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
|
||||
"ca_add_exception_event");
|
||||
epicsEventSignal(startStopEvent);
|
||||
epicsEventSignal(startStopEvent); /* unblock dbCaLinkInitImpl() */
|
||||
|
||||
/* channel access event loop */
|
||||
while (TRUE){
|
||||
@@ -1266,6 +1295,13 @@ static void dbCaTask(void *arg)
|
||||
db_process(prec);
|
||||
dbScanUnlock(prec);
|
||||
}
|
||||
if ((link_action & CA_INIT_READY) && (pca->flags & DBCA_CALLBACK_INIT_WAIT)) {
|
||||
pca->flags &= ~DBCA_CALLBACK_INIT_WAIT;
|
||||
if (epicsAtomicDecrSizeT(&initOutstanding)==0)
|
||||
{
|
||||
epicsEventSignal(startStopEvent); /* unblock dbCaRun() */
|
||||
}
|
||||
}
|
||||
}
|
||||
SEVCHK(ca_flush_io(), "dbCaTask");
|
||||
}
|
||||
@@ -1275,5 +1311,5 @@ shutdown:
|
||||
ca_context_destroy();
|
||||
else
|
||||
fprintf(stderr, "dbCa: chan_count = %d at shutdown\n", dbca_chan_count);
|
||||
epicsEventSignal(startStopEvent);
|
||||
epicsEventSignal(startStopEvent); /* unblock dbCaShutdown() */
|
||||
}
|
||||
@@ -21,6 +21,19 @@
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsTypes.h"
|
||||
#include "link.h"
|
||||
#include "shareLib.h"
|
||||
#include "libCaAPI.h"
|
||||
|
||||
#ifndef INC_cadef_H
|
||||
/* Copy some definitions so this header to be included from
|
||||
* places where cadef.h and db_access.h can not.
|
||||
*/
|
||||
typedef void * chid;
|
||||
typedef void * evid;
|
||||
LIBCA_API extern const unsigned short dbr_value_size[];
|
||||
LIBCA_API short epicsShareAPI ca_field_type (chid chan);
|
||||
#define MAX_UNITS_SIZE 8
|
||||
#endif
|
||||
|
||||
/* link_action mask */
|
||||
#define CA_CLEAR_CHANNEL 0x1
|
||||
@@ -32,6 +45,7 @@
|
||||
#define CA_GET_ATTRIBUTES 0x40
|
||||
#define CA_SYNC 0x1000
|
||||
#define CA_DBPROCESS 0x2000
|
||||
#define CA_INIT_READY 0x4000
|
||||
/* write type */
|
||||
#define CA_PUT 0x1
|
||||
#define CA_PUT_CALLBACK 0x2
|
||||
@@ -63,6 +77,7 @@ typedef struct caLink
|
||||
dbCaCallback connect;
|
||||
dbCaCallback monitor;
|
||||
void *userPvt;
|
||||
unsigned flags;
|
||||
/* The following are for write request */
|
||||
short putType;
|
||||
dbCaCallback putCallback;
|
||||
@@ -97,4 +112,10 @@ typedef struct caLink
|
||||
unsigned long nUpdate;
|
||||
}caLink;
|
||||
|
||||
#define DBCA_CALLBACK_INIT_WAIT (1)
|
||||
|
||||
void dbCaAddLinkCallbackOpt(struct dbLocker *locker, struct link *plink,
|
||||
dbCaCallback connect, dbCaCallback monitor,
|
||||
void *userPvt, unsigned flags);
|
||||
|
||||
#endif /* INC_dbCaPvt_H */
|
||||
@@ -310,7 +310,7 @@ typedef struct chFilterIf {
|
||||
} chFilterIf;
|
||||
|
||||
/** \brief Filter plugin data
|
||||
*
|
||||
*
|
||||
* A chFilterPlugin object holds data about a filter plugin.
|
||||
*/
|
||||
typedef struct chFilterPlugin {
|
||||
|
||||
@@ -22,7 +22,12 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @brief Make a copy of parts of an array.
|
||||
/**
|
||||
* @file dbExtractArray.h
|
||||
*
|
||||
* @brief Make a copy of parts of an array.
|
||||
*/
|
||||
/** @brief Make a copy of parts of an array
|
||||
*
|
||||
* The source array may or may not be a record field.
|
||||
*
|
||||
|
||||
@@ -1217,7 +1217,7 @@ static long cvt_f_st(const void *f, void *t, const dbAddr *paddr)
|
||||
{
|
||||
const epicsFloat32 *from = (const epicsFloat32 *) f;
|
||||
char *to = (char *) t;
|
||||
|
||||
|
||||
rset *prset = 0;
|
||||
long status = 0;
|
||||
long precision = 6;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
#define EPICS_PRIVATE_API
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "iocsh.h"
|
||||
|
||||
#include "callback.h"
|
||||
@@ -27,6 +29,9 @@
|
||||
#include "dbState.h"
|
||||
#include "db_test.h"
|
||||
#include "dbTest.h"
|
||||
#include "epicsStdlib.h"
|
||||
#include "epicsStdio.h"
|
||||
#include "errlog.h"
|
||||
|
||||
DBCORE_API extern int callbackParallelThreadsDefault;
|
||||
|
||||
@@ -503,7 +508,7 @@ static void callbackQueueShowCallFunc(const iocshArgBuf *args)
|
||||
}
|
||||
|
||||
/* callbackParallelThreads */
|
||||
static const iocshArg callbackParallelThreadsArg0 = { "no of threads", iocshArgInt};
|
||||
static const iocshArg callbackParallelThreadsArg0 = { "no of threads", iocshArgString};
|
||||
static const iocshArg callbackParallelThreadsArg1 = { "priority", iocshArgString};
|
||||
static const iocshArg * const callbackParallelThreadsArgs[2] =
|
||||
{&callbackParallelThreadsArg0,&callbackParallelThreadsArg1};
|
||||
@@ -513,7 +518,25 @@ static const iocshFuncDef callbackParallelThreadsFuncDef = {"callbackParallelThr
|
||||
"or one of LOW, MEDIUM, or HIGH.\n"};
|
||||
static void callbackParallelThreadsCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
iocshSetError(callbackParallelThreads(args[0].ival, args[1].sval));
|
||||
epicsInt32 num = 0;
|
||||
if (args[0].sval) {
|
||||
char* end;
|
||||
long status = epicsParseInt32(args[0].sval, &num, 10, &end);
|
||||
if (status || (end[0] && strcmp(end, "%") != 0))
|
||||
{
|
||||
fprintf(epicsGetStderr(),
|
||||
ANSI_RED("Invalid integer '%s'.\n"), args[0].sval);
|
||||
iocshSetError(-1);
|
||||
return;
|
||||
}
|
||||
if (end[0] == '%') {
|
||||
/* round down, min 1 */
|
||||
if (num < 0) num += 100;
|
||||
if (num > 0) num = num * epicsThreadGetCPUs() / 100;
|
||||
if (num <= 0) num = 1;
|
||||
}
|
||||
}
|
||||
iocshSetError(callbackParallelThreads(num, args[1].sval));
|
||||
}
|
||||
|
||||
/* dbStateCreate */
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "dbAccessDefs.h"
|
||||
#include "dbAddr.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbCa.h"
|
||||
#include "dbCaPvt.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbConstLink.h"
|
||||
#include "dbDbLink.h"
|
||||
@@ -125,7 +125,9 @@ void dbInitLink(struct link *plink, short dbfType)
|
||||
if (dbfType == DBF_INLINK)
|
||||
plink->value.pv_link.pvlMask |= pvlOptInpNative;
|
||||
|
||||
dbCaAddLink(NULL, plink, dbfType);
|
||||
int isLocal = dbChannelTest(plink->value.pv_link.pvname)==0;
|
||||
|
||||
dbCaAddLinkCallbackOpt(NULL, plink, NULL, NULL, NULL, isLocal ? DBCA_CALLBACK_INIT_WAIT : 0);
|
||||
if (dbfType == DBF_FWDLINK) {
|
||||
char *pperiod = strrchr(plink->value.pv_link.pvname, '.');
|
||||
|
||||
|
||||
@@ -24,11 +24,17 @@ extern "C" {
|
||||
|
||||
struct dbCommon;
|
||||
struct dbBase;
|
||||
/** @brief Lock multiple records.
|
||||
/**
|
||||
* @file dbLock.h
|
||||
* @brief Lock one or multiple records.
|
||||
*
|
||||
* A dbLocker allows a caller to simultaneously lock multiple records.
|
||||
* The list of records is provided to dbLockerAlloc().
|
||||
* And the resulting dbLocker can be locked/unlocked repeatedly.
|
||||
* Locking is required to prevent corruption of record fields due to concurrent
|
||||
* access by different threads.
|
||||
*/
|
||||
/** @brief A dbLocker allows a caller to lock a single record or simultaneously
|
||||
* lock multiple records.
|
||||
* The list of records is provided to dbLockerAlloc(). And the resulting
|
||||
* dbLocker can be locked/unlocked repeatedly.
|
||||
*
|
||||
* Each thread can only lock one dbLocker at a time.
|
||||
* While locked, dbScanLock() may be called only on those records
|
||||
@@ -72,37 +78,68 @@ DBCORE_API void dbLockerFree(dbLocker *plocker);
|
||||
|
||||
/** @brief Lock all records of dbLocker
|
||||
*
|
||||
* While locked, caller may access any associated record passed to dbLockerAlloc() .
|
||||
* Locks multiple record. While locked, caller may access any associated record
|
||||
* passed to dbLockerAlloc().
|
||||
* dbScanLockMany() may not be called again (multi-lock is not recursive).
|
||||
* dbScanLock()/dbScanUnlock() may be called on individual record.
|
||||
* The caller must later call dbScanUnlockMany().
|
||||
* @since 3.16.0.1
|
||||
*/
|
||||
DBCORE_API void dbScanLockMany(dbLocker*);
|
||||
/** @brief Unlock all records of dbLocker
|
||||
/** @brief Unlock all records of dbLocker.
|
||||
*
|
||||
* Unlocks the records of dbLocker. A thread must call dbScanUnlockMany with the
|
||||
* same dbLocker* before calling dbScanLockMany again.
|
||||
* @since 3.16.0.1
|
||||
*/
|
||||
DBCORE_API void dbScanUnlockMany(dbLocker*);
|
||||
|
||||
/** @brief Returns ID number of the lockset*/
|
||||
DBCORE_API unsigned long dbLockGetLockId(
|
||||
struct dbCommon *precord);
|
||||
|
||||
/** @brief During IOC startup the complete list of records is iterated by
|
||||
* dbLockInitRecords
|
||||
*
|
||||
* The required locksets are created and populated based on the links defined
|
||||
* at the time of IOC startup*/
|
||||
DBCORE_API void dbLockInitRecords(struct dbBase *pdbbase);
|
||||
|
||||
|
||||
/** @brief Frees up locksets which are no longer in use. If lockset is still active, prints warning and calls `dblsr`*/
|
||||
DBCORE_API void dbLockCleanupRecords(struct dbBase *pdbbase);
|
||||
|
||||
|
||||
/* Lock Set Report */
|
||||
/** @brief Lock Set Report
|
||||
*
|
||||
* Generates a report showing the lock set to which each record belongs.
|
||||
* If recordname is 0, "", "*" all records are shown. Otherwise only records
|
||||
* in the same lock set as recordname are shown. Level can have the following
|
||||
* values:
|
||||
*
|
||||
* 0 - show lock set information only
|
||||
*
|
||||
* 1 - show each record in the lock set
|
||||
*
|
||||
* 2 - show each record and all database links in the lock set
|
||||
*/
|
||||
DBCORE_API long dblsr(char *recordname,int level);
|
||||
/* If recordname NULL then all records*/
|
||||
/* level = (0,1,2) (lock set state, + recordname, +DB links) */
|
||||
|
||||
/** @brief Displays free and active locksets
|
||||
*/
|
||||
DBCORE_API long dbLockShowLocked(int level);
|
||||
|
||||
/*KLUDGE to support field TPRO*/
|
||||
|
||||
/** @brief Support for TPRO field */
|
||||
DBCORE_API int * dbLockSetAddrTrace(struct dbCommon *precord);
|
||||
|
||||
|
||||
/* debugging */
|
||||
|
||||
/** @brief Returns the reference count */
|
||||
DBCORE_API unsigned long dbLockGetRefs(struct dbCommon*);
|
||||
/** @brief Returns the number of active locksets*/
|
||||
DBCORE_API unsigned long dbLockCountSets(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "ellLib.h"
|
||||
#include "epicsAtomic.h"
|
||||
#include "epicsEvent.h"
|
||||
#include "epicsGeneralTime.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "epicsRingBytes.h"
|
||||
@@ -114,7 +115,7 @@ typedef struct event_list {
|
||||
struct event_list *next;
|
||||
char eventname[1]; /* actually arbitrary size */
|
||||
} event_list;
|
||||
static event_list * volatile pevent_list[256];
|
||||
static event_list * volatile pevent_list[NUM_TIME_EVENTS];
|
||||
static epicsMutexId event_lock;
|
||||
|
||||
/* IO_EVENT*/
|
||||
@@ -546,7 +547,7 @@ void postEvent(event_list *pel)
|
||||
/* backward compatibility */
|
||||
void post_event(int event)
|
||||
{
|
||||
if (event <= 0 || event > 255) return;
|
||||
if (event <= 0 || event >= NUM_TIME_EVENTS) return;
|
||||
postEvent(pevent_list[event]);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ static void printFieldsList(DBENTRY *pdbentry, char** papfields, int nfields)
|
||||
printf(", \"%s\"", (pvalue ? pvalue : ""));
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
long dbl(const char *precordTypename, const char *fields)
|
||||
{
|
||||
@@ -422,8 +422,10 @@ long dbpf(const char *pname,const char *pvalue)
|
||||
return -1;
|
||||
}
|
||||
status = dbPutConvertJSON(pvalue, dbrType, array, &n);
|
||||
if (status)
|
||||
if (status) {
|
||||
free(array);
|
||||
return status;
|
||||
}
|
||||
pvalue = array;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,16 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* Current Author: Marty Kraimer
|
||||
* Date: 03-19-92
|
||||
*/
|
||||
|
||||
#ifndef INCdbBaseh
|
||||
#define INCdbBaseh 1
|
||||
|
||||
/** \file dbBase.h
|
||||
* \author Marty Kraimer
|
||||
* \date 03-19-92
|
||||
* \brief Base db structures
|
||||
*/
|
||||
|
||||
#include "epicsTypes.h"
|
||||
#include "dbFldTypes.h"
|
||||
#include "ellLib.h"
|
||||
@@ -44,7 +46,7 @@ typedef struct devSup {
|
||||
int link_type;
|
||||
/*Following only available on run time system*/
|
||||
dset *pdset;
|
||||
struct dsxt *pdsxt; /* Extended device support */
|
||||
struct dsxt *pdsxt; /**< Extended device support */
|
||||
}devSup;
|
||||
|
||||
typedef struct linkSup {
|
||||
@@ -59,50 +61,55 @@ typedef struct dbDeviceMenu {
|
||||
char **papChoice;
|
||||
}dbDeviceMenu;
|
||||
|
||||
/* conversion types*/
|
||||
/** \brief conversion types*/
|
||||
typedef enum {CT_DECIMAL,CT_HEX} ctType;
|
||||
/* access level types */
|
||||
/** \brief access level types */
|
||||
typedef enum {ASL0,ASL1} asLevel;
|
||||
|
||||
/*Breakpoint Tables */
|
||||
typedef struct brkInt{ /* breakpoint interval */
|
||||
double raw; /*raw value for beginning of interval */
|
||||
double slope; /*slope for interval */
|
||||
double eng; /*converted value for beginning of interval*/
|
||||
/* Breakpoint Tables */
|
||||
|
||||
/** \brief breakpoint interval */
|
||||
typedef struct brkInt{
|
||||
double raw; /**< \brief raw value for beginning of interval */
|
||||
double slope; /**< \brief slope for interval */
|
||||
double eng; /**< \brief converted value for beginning of interval*/
|
||||
}brkInt;
|
||||
|
||||
typedef struct brkTable { /* breakpoint table */
|
||||
/** \brief breakpoint table */
|
||||
typedef struct brkTable {
|
||||
ELLNODE node;
|
||||
char *name; /*breakpoint table name */
|
||||
long number; /*number of brkInt in this table */
|
||||
struct brkInt *paBrkInt; /* ptr to array of brkInts */
|
||||
char *name; /**< \brief breakpoint table name */
|
||||
long number; /**< \brief number of brkInt in this table */
|
||||
struct brkInt *paBrkInt; /**< \brief ptr to array of brkInts */
|
||||
}brkTable;
|
||||
|
||||
typedef struct dbFldDes{ /* field description */
|
||||
char *prompt; /*Prompt string for DCT */
|
||||
char *name; /*Field name */
|
||||
char *extra; /*C def for DBF_NOACCESS */
|
||||
/** \brief field description */
|
||||
typedef struct dbFldDes{
|
||||
char *prompt; /**< \brief Prompt string for DCT */
|
||||
char *name; /**< \brief Field name */
|
||||
char *extra; /**< \brief C def for DBF_NOACCESS */
|
||||
struct dbRecordType *pdbRecordType;
|
||||
short indRecordType; /*within dbRecordType.papFldDes */
|
||||
short special; /*Special processing requirements */
|
||||
dbfType field_type; /*Field type as defined in dbFldTypes.h */
|
||||
unsigned int process_passive:1;/*should dbPutField process passive */
|
||||
unsigned int prop:1; /*field is a metadata, post DBE_PROPERTY on change*/
|
||||
unsigned int isDevLink:1; /* true for INP/OUT fields */
|
||||
ctType base; /*base for integer to string conversions*/
|
||||
short promptgroup; /*prompt, i.e. gui group */
|
||||
short interest; /*interest level */
|
||||
asLevel as_level; /*access security level */
|
||||
char *initial; /*initial value */
|
||||
/*If (DBF_MENU,DBF_DEVICE) ftPvt is (pdbMenu,pdbDeviceMenu) */
|
||||
short indRecordType; /**< \brief within dbRecordType.papFldDes */
|
||||
short special; /**< \brief Special processing requirements */
|
||||
dbfType field_type; /**< \brief Field type as defined in dbFldTypes.h */
|
||||
unsigned int process_passive:1;/**< \brief should dbPutField process passive */
|
||||
unsigned int prop:1; /**< \brief field is a metadata, post DBE_PROPERTY on change*/
|
||||
unsigned int isDevLink:1; /**< \brief true for INP/OUT fields */
|
||||
ctType base; /**< \brief base for integer to string conversions*/
|
||||
short promptgroup; /**< \brief prompt, i.e. gui group */
|
||||
short interest; /**< \brief interest level */
|
||||
asLevel as_level; /**< \brief access security level */
|
||||
char *initial; /**< \brief initial value */
|
||||
/** \brief If (DBF_MENU,DBF_DEVICE) ftPvt is (pdbMenu,pdbDeviceMenu) */
|
||||
void *ftPvt;
|
||||
/*On no runtime following only set for STRING */
|
||||
short size; /*length in bytes of a field element */
|
||||
/* On no runtime following only set for STRING */
|
||||
short size; /**< \brief length in bytes of a field element */
|
||||
/*The following are only available on run time system*/
|
||||
unsigned short offset; /*Offset in bytes from beginning of record*/
|
||||
unsigned short offset; /**< \brief Offset in bytes from beginning of record*/
|
||||
}dbFldDes;
|
||||
|
||||
typedef struct dbInfoNode { /*non-field per-record information*/
|
||||
/** non-field per-record information*/
|
||||
typedef struct dbInfoNode {
|
||||
ELLNODE node;
|
||||
char *name;
|
||||
char *string;
|
||||
@@ -117,13 +124,13 @@ typedef struct dbRecordNode {
|
||||
ELLNODE node;
|
||||
void *precord;
|
||||
char *recordname;
|
||||
ELLLIST infoList; /*LIST head of info nodes*/
|
||||
ELLLIST infoList; /**< \brief LIST head of info nodes*/
|
||||
int flags;
|
||||
/** Parse order of this record()
|
||||
* @since 7.0.8.1
|
||||
*/
|
||||
unsigned order;
|
||||
struct dbRecordNode *aliasedRecnode; /* NULL unless flags|DBRN_FLAGS_ISALIAS */
|
||||
struct dbRecordNode *aliasedRecnode; /**< \brief NULL unless flags|DBRN_FLAGS_ISALIAS */
|
||||
}dbRecordNode;
|
||||
|
||||
/*dbRecordAttribute is for "pseudo" fields */
|
||||
@@ -150,24 +157,24 @@ typedef struct dbVariableDef {
|
||||
|
||||
typedef struct dbRecordType {
|
||||
ELLNODE node;
|
||||
ELLLIST attributeList; /*LIST head of attributes*/
|
||||
ELLLIST recList; /*LIST head of sorted dbRecordNodes*/
|
||||
ELLLIST devList; /*List of associated device support*/
|
||||
ELLLIST cdefList; /*LIST of Cdef text items*/
|
||||
ELLLIST attributeList; /**< \brief LIST head of attributes*/
|
||||
ELLLIST recList; /**< \brief LIST head of sorted dbRecordNodes*/
|
||||
ELLLIST devList; /**< \brief List of associated device support*/
|
||||
ELLLIST cdefList; /**< \brief LIST of Cdef text items*/
|
||||
char *name;
|
||||
short no_fields; /* number of fields defined */
|
||||
short no_prompt; /* number of fields to configure*/
|
||||
short no_links; /* number of links */
|
||||
short no_aliases; /* number of aliases in recList */
|
||||
short *link_ind; /* addr of array of ind in papFldDes*/
|
||||
char **papsortFldName;/* ptr to array of ptr to fld names*/
|
||||
short *sortFldInd; /* addr of array of ind in papFldDes*/
|
||||
dbFldDes *pvalFldDes; /*pointer dbFldDes for VAL field*/
|
||||
short indvalFlddes; /*ind in papFldDes*/
|
||||
dbFldDes **papFldDes; /* ptr to array of ptr to fldDes*/
|
||||
short no_fields; /**< \brief number of fields defined */
|
||||
short no_prompt; /**< \brief number of fields to configure*/
|
||||
short no_links; /**< \brief number of links */
|
||||
short no_aliases; /**< \brief number of aliases in recList */
|
||||
short *link_ind; /**< \brief addr of array of ind in papFldDes*/
|
||||
char **papsortFldName;/**< \brief ptr to array of ptr to fld names*/
|
||||
short *sortFldInd; /**< \brief * addr of array of ind in papFldDes*/
|
||||
dbFldDes *pvalFldDes; /**< \brief pointer dbFldDes for VAL field*/
|
||||
short indvalFlddes; /**< \brief ind in papFldDes*/
|
||||
dbFldDes **papFldDes; /**< \brief ptr to array of ptr to fldDes*/
|
||||
/*The following are only available on run time system*/
|
||||
rset *prset;
|
||||
int rec_size; /*record size in bytes */
|
||||
int rec_size; /**< \brief record size in bytes */
|
||||
}dbRecordType;
|
||||
|
||||
struct dbPvd; /* Contents private to dbPvdLib code */
|
||||
|
||||
@@ -77,7 +77,7 @@ static const iocshArg * const dbDumpFieldArgs[] =
|
||||
static const iocshFuncDef dbDumpFieldFuncDef = {"dbDumpField",3,dbDumpFieldArgs,
|
||||
"Dump information about the fieldName in the recordTypeName.\n"
|
||||
"Example: dbDumpField pdbbase calcout A\n"
|
||||
"If last argument(s) are missing, dump information\n"
|
||||
"If last argument(s) are missing, dump information\n"
|
||||
"about all fieldName in all recordTypeName in the database.\n"};
|
||||
static void dbDumpFieldCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
|
||||
@@ -744,7 +744,7 @@ static long dbAddOnePath (DBBASE *pdbbase, const char *path, unsigned length)
|
||||
|
||||
pdbPathNode = (dbPathNode *)dbCalloc(1, sizeof(dbPathNode));
|
||||
pdbPathNode->directory = (char *)dbMalloc(length+1);
|
||||
strncpy(pdbPathNode->directory, path, length+1);
|
||||
memcpy(pdbPathNode->directory, path, length);
|
||||
pdbPathNode->directory[length] = '\0';
|
||||
ellAdd(ppathList, &pdbPathNode->node);
|
||||
return 0;
|
||||
@@ -1447,6 +1447,7 @@ long dbCreateRecord(DBENTRY *pdbentry,const char *precordName)
|
||||
pdbentry->precnode = pNewRecNode;
|
||||
ppvd = dbPvdAdd(pdbentry->pdbbase,precordType,pNewRecNode);
|
||||
if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);}
|
||||
pNewRecNode->order = pdbentry->pdbbase->no_records++;
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1700,6 +1701,7 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
|
||||
}
|
||||
|
||||
ellAdd(&precordType->recList, &pnewnode->node);
|
||||
pnewnode->order = pdbentry->pdbbase->no_records++;
|
||||
precordType->no_aliases++;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ static void iocBuildCallFunc(const iocshArgBuf *args)
|
||||
}
|
||||
|
||||
/* iocRun */
|
||||
static const iocshFuncDef iocRunFuncDef = {"iocRun",0,NULL,
|
||||
static const iocshFuncDef iocRunFuncDef = {"iocRun",0,NULL,
|
||||
"Bring the IOC out of its initial quiescent state to the running state.\n"
|
||||
"See more: iocBuild, iocPause\n"};
|
||||
static void iocRunCallFunc(const iocshArgBuf *args)
|
||||
@@ -85,7 +85,7 @@ static const iocshArg * const systemArgs[] = {&systemArg0};
|
||||
static const iocshFuncDef systemFuncDef = {"system",1,systemArgs,
|
||||
"Send command string to the system command interpreter for execution.\n"
|
||||
"Not available on all OSs.\n"
|
||||
"To enable this command, add registrar(iocshSystemCommand) to an application dbd file,\n"
|
||||
"To enable this command, add registrar(iocshSystemCommand) to an application dbd file,\n"
|
||||
"or include system.dbd\n"};
|
||||
static void systemCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
|
||||
@@ -312,8 +312,7 @@ void rsrv_build_addr_lists(void)
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString (
|
||||
sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
errlogPrintf("CAS: failed to set mcast loopback: %s\n",
|
||||
sockErrBuf);
|
||||
errlogPrintf("rsrv: failed to set mcast loopback: %s (%d)\n", sockErrBuf, errno);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,7 +85,6 @@ static long readLocked(struct link *pinp, void *dummy)
|
||||
|
||||
static long read_aai(aaiRecord *prec)
|
||||
{
|
||||
epicsUInt32 nord = prec->nord;
|
||||
struct link *pinp = prec->simm == menuYesNoYES ? &prec->siol : &prec->inp;
|
||||
long status;
|
||||
|
||||
@@ -96,8 +95,5 @@ static long read_aai(aaiRecord *prec)
|
||||
if (status == S_db_noLSET)
|
||||
status = readLocked(pinp, NULL);
|
||||
|
||||
if (!status && nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ epicsExportAddress(dset, devBiSoft);
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
biRecord *prec = (biRecord *)pcommon;
|
||||
biRecord *prec = (biRecord *)pcommon;
|
||||
|
||||
if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -154,7 +154,7 @@ static long init(int pass)
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
biRecord *prec = (biRecord *)pcommon;
|
||||
biRecord *prec = (biRecord *)pcommon;
|
||||
|
||||
if (recGblInitConstantLink(&prec->inp, DBR_ENUM, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -37,7 +37,7 @@ epicsExportAddress(dset, devBiSoftRaw);
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
biRecord *prec = (biRecord *)pcommon;
|
||||
biRecord *prec = (biRecord *)pcommon;
|
||||
|
||||
recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiDirectSoft);
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon;
|
||||
mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon;
|
||||
|
||||
if (recGblInitConstantLink(&prec->inp, DBR_ULONG, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -154,7 +154,7 @@ static long init(int pass)
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon;
|
||||
mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon;
|
||||
|
||||
if (recGblInitConstantLink(&prec->inp, DBR_ULONG, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiDirectSoftRaw);
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon;
|
||||
mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon;
|
||||
|
||||
recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiSoft);
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
mbbiRecord *prec = (mbbiRecord *)pcommon;
|
||||
mbbiRecord *prec = (mbbiRecord *)pcommon;
|
||||
|
||||
if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -154,7 +154,7 @@ static long init(int pass)
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
mbbiRecord *prec = (mbbiRecord *)pcommon;
|
||||
mbbiRecord *prec = (mbbiRecord *)pcommon;
|
||||
|
||||
if (recGblInitConstantLink(&prec->inp, DBR_ENUM, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiSoftRaw);
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
mbbiRecord *prec = (mbbiRecord *)pcommon;
|
||||
mbbiRecord *prec = (mbbiRecord *)pcommon;
|
||||
|
||||
recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
static long init_record(dbCommon *pcommon)
|
||||
{
|
||||
mbboDirectRecord *prec = (mbboDirectRecord *)pcommon;
|
||||
mbboDirectRecord *prec = (mbboDirectRecord *)pcommon;
|
||||
|
||||
if (prec->nobt == 0)
|
||||
prec->mask = 0xffffffff;
|
||||
|
||||
@@ -93,7 +93,6 @@ static long read_sa(subArrayRecord *prec)
|
||||
{
|
||||
long status;
|
||||
struct sart rt;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
rt.nRequest = prec->indx + prec->nelm;
|
||||
if (rt.nRequest > prec->malm)
|
||||
@@ -118,9 +117,6 @@ static long read_sa(subArrayRecord *prec)
|
||||
|
||||
if (!status) {
|
||||
subset(prec, rt.nRequest);
|
||||
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
@@ -55,9 +55,9 @@ device(stringout,CONSTANT,devSoSoftCallback,"Async Soft Channel")
|
||||
device(ai, INST_IO,devTimestampAI,"Soft Timestamp")
|
||||
device(stringin,INST_IO,devTimestampSI,"Soft Timestamp")
|
||||
|
||||
device(ai, INST_IO,devAiGeneralTime,"General Time")
|
||||
device(bo, INST_IO,devBoGeneralTime,"General Time")
|
||||
device(longin, INST_IO,devLiGeneralTime,"General Time")
|
||||
device(ai, INST_IO,devAiGeneralTime,"General Time")
|
||||
device(bo, INST_IO,devBoGeneralTime,"General Time")
|
||||
device(longin, INST_IO,devLiGeneralTime,"General Time")
|
||||
device(stringin,INST_IO,devSiGeneralTime,"General Time")
|
||||
|
||||
device(lso,INST_IO,devLsoStdio,"stdio")
|
||||
|
||||
@@ -72,7 +72,6 @@ static long read_wf(waveformRecord *prec)
|
||||
{
|
||||
long status;
|
||||
struct wfrt rt;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
rt.nRequest = prec->nelm;
|
||||
rt.ptime = (dbLinkIsConstant(&prec->tsel) &&
|
||||
@@ -88,8 +87,6 @@ static long read_wf(waveformRecord *prec)
|
||||
if (!status) {
|
||||
prec->nord = rt.nRequest;
|
||||
prec->udf = FALSE;
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
# This is a Makefile fragment, see src/ioc/Makefile.
|
||||
|
||||
stdRecords.dbd$(DEP): $(STDDIR)/rec/Makefile $(STDDIR)/rec/RULES
|
||||
@$(RM) $@
|
||||
@echo "$(COMMON_DIR)/stdRecords.dbd:" > $@
|
||||
@echo "$(COMMON_DIR)/stdRecords.dbd:" > $@.stdout
|
||||
$(MV) $@.stdout $@
|
||||
|
||||
$(COMMON_DIR)/stdRecords.dbd: $(STDDIR)/rec/Makefile $(STDDIR)/rec/RULES
|
||||
|
||||
|
||||
@@ -156,8 +156,9 @@ static long process(struct dbCommon *pcommon)
|
||||
{
|
||||
struct aaiRecord *prec = (struct aaiRecord *)pcommon;
|
||||
aaidset *pdset = (aaidset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact = prec->pact;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
long status;
|
||||
|
||||
if (pdset == NULL || pdset->read_aai == NULL) {
|
||||
prec->pact = TRUE;
|
||||
@@ -173,7 +174,11 @@ static long process(struct dbCommon *pcommon)
|
||||
prec->udf = FALSE;
|
||||
recGblGetTimeStampSimm(prec, prec->simm, &prec->siol);
|
||||
|
||||
if (nord != prec->nord) {
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
}
|
||||
monitor(prec);
|
||||
|
||||
/* process the forward scan link record */
|
||||
recGblFwdLink(prec);
|
||||
|
||||
@@ -233,8 +238,9 @@ static long put_array_info(DBADDR *paddr, long nNew)
|
||||
if (prec->nord > prec->nelm)
|
||||
prec->nord = prec->nelm;
|
||||
|
||||
if (nord != prec->nord)
|
||||
if (nord != prec->nord) {
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -303,6 +303,7 @@ Scan forward link if necessary, set PACT FALSE, and return.
|
||||
% long (*read_aai)(struct aaiRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} aaidset;
|
||||
%#define HAS_aaidset
|
||||
%#define AAI_POSTS_NORD
|
||||
%#define AAI_DEVINIT_PASS1 2
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
|
||||
@@ -153,6 +153,7 @@ static long process(struct dbCommon *pcommon)
|
||||
aaodset *pdset = (aaodset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact = prec->pact;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
if (pdset == NULL || pdset->write_aao == NULL) {
|
||||
prec->pact = TRUE;
|
||||
@@ -180,6 +181,9 @@ static long process(struct dbCommon *pcommon)
|
||||
recGblGetTimeStampSimm(prec, prec->simm, NULL);
|
||||
}
|
||||
|
||||
if (nord != prec->nord) {
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
}
|
||||
monitor(prec);
|
||||
/* process the forward scan link record */
|
||||
recGblFwdLink(prec);
|
||||
|
||||
@@ -326,6 +326,7 @@ Scan forward link if necessary, set PACT FALSE, and return.
|
||||
% long (*write_aao)(struct aaoRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} aaodset;
|
||||
%#define HAS_aaodset
|
||||
%#define AAO_POSTS_NORD
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
|
||||
@@ -119,7 +119,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
}
|
||||
|
||||
if (pdset->common.init_record) {
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
long status = pdset->common.init_record(pcommon);
|
||||
if (prec->linr == menuConvertSLOPE) {
|
||||
prec->eoff = eoff;
|
||||
prec->eslo = eslo;
|
||||
|
||||
@@ -76,7 +76,7 @@ rset biRSET={
|
||||
put_enum_str,
|
||||
get_graphic_double,
|
||||
get_control_double,
|
||||
get_alarm_double
|
||||
get_alarm_double
|
||||
};
|
||||
epicsExportAddress(rset,biRSET);
|
||||
|
||||
@@ -105,7 +105,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
if( pdset->common.init_record ) {
|
||||
if((status=(*pdset->common.init_record)(pcommon))) return(status);
|
||||
if((status=(*pdset->common.init_record)(pcommon))) return(status);
|
||||
}
|
||||
prec->mlst = prec->val;
|
||||
prec->lalm = prec->val;
|
||||
|
||||
@@ -96,7 +96,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml);
|
||||
recGblInitConstantLink(&prec->siol, DBF_STRING, &prec->sval);
|
||||
|
||||
if( (pdset=(eventdset *)(prec->dset)) && (pdset->common.init_record) )
|
||||
if( (pdset=(eventdset *)(prec->dset)) && (pdset->common.init_record) )
|
||||
status=(*pdset->common.init_record)(pcommon);
|
||||
|
||||
prec->epvt = eventNameToHandle(prec->val);
|
||||
@@ -111,7 +111,7 @@ static long process(struct dbCommon *pcommon)
|
||||
long status=0;
|
||||
unsigned char pact=prec->pact;
|
||||
|
||||
if((pdset!=NULL) && (pdset->common.number >= 5) && pdset->read_event )
|
||||
if((pdset!=NULL) && (pdset->common.number >= 5) && pdset->read_event )
|
||||
status=readValue(prec); /* read the new value */
|
||||
/* check if device support set pact */
|
||||
if ( !pact && prec->pact ) return(0);
|
||||
|
||||
@@ -111,7 +111,7 @@ static long init_record(dbCommon *pcommon, int pass)
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
if (pdset->common.init_record) {
|
||||
if ((status = pdset->common.init_record(pcommon))) return status;
|
||||
if ((status = pdset->common.init_record(pcommon))) return status;
|
||||
}
|
||||
prec->mlst = prec->val;
|
||||
prec->alst = prec->val;
|
||||
@@ -122,7 +122,7 @@ static long init_record(dbCommon *pcommon, int pass)
|
||||
static long process(dbCommon *pcommon)
|
||||
{
|
||||
int64inRecord *prec = (int64inRecord*)pcommon;
|
||||
int64indset *pdset = (int64indset *)(prec->dset);
|
||||
int64indset *pdset = (int64indset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
epicsTimeStamp timeLast;
|
||||
|
||||
@@ -125,7 +125,7 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
prec->lalm = prec->val;
|
||||
prec->pval = prec->val;
|
||||
prec->outpvt = EXEC_OUTPUT;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -450,14 +450,14 @@ static long conditional_write(longoutRecord *prec)
|
||||
long status = 0;
|
||||
int doDevSupWrite = 0;
|
||||
|
||||
switch (prec->oopt)
|
||||
switch (prec->oopt)
|
||||
{
|
||||
case longoutOOPT_On_Change:
|
||||
/* Forces a write op if a change in the OUT field is detected OR is first process */
|
||||
if (prec->outpvt == EXEC_OUTPUT) {
|
||||
doDevSupWrite = 1;
|
||||
} else {
|
||||
/* Only write if value is different from the previous one */
|
||||
/* Only write if value is different from the previous one */
|
||||
doDevSupWrite = (prec->val != prec->pval);
|
||||
}
|
||||
break;
|
||||
@@ -479,7 +479,7 @@ static long conditional_write(longoutRecord *prec)
|
||||
break;
|
||||
|
||||
case longoutOOPT_Transition_To_Non_zero:
|
||||
doDevSupWrite = ((prec->val != 0)&&(prec->pval == 0));
|
||||
doDevSupWrite = ((prec->val != 0)&&(prec->pval == 0));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -129,6 +129,7 @@ static long process(struct dbCommon *pcommon)
|
||||
sadset *pdset = (sadset *)(prec->dset);
|
||||
long status;
|
||||
unsigned char pact=prec->pact;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
if ((pdset==NULL) || (pdset->read_sa==NULL)) {
|
||||
prec->pact=TRUE;
|
||||
@@ -148,6 +149,9 @@ static long process(struct dbCommon *pcommon)
|
||||
if (status)
|
||||
recGblSetSevr(prec, UDF_ALARM, prec->udfs);
|
||||
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
|
||||
monitor(prec);
|
||||
|
||||
/* process the forward scan link record */
|
||||
|
||||
@@ -319,6 +319,7 @@ INP is expected to point to an array field of a waveform record or similar.
|
||||
% long (*read_sa)(struct subArrayRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} sadset;
|
||||
%#define HAS_sadset
|
||||
%#define SA_POSTS_NORD
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
|
||||
@@ -396,6 +396,7 @@ routine and NORD is also set at that time.
|
||||
% long (*read_wf)(struct waveformRecord *prec); /*returns: (-1,0)=>(failure,success)*/
|
||||
%} wfdset;
|
||||
%#define HAS_wfdset
|
||||
%#define WF_POSTS_NORD
|
||||
%
|
||||
field(VAL,DBF_NOACCESS) {
|
||||
prompt("Value")
|
||||
|
||||
@@ -19,5 +19,5 @@ softMain$(DEP): epicsInstallDir.h
|
||||
|
||||
epicsInstallDir.h: $(TOP)/configure/CONFIG_SITE*
|
||||
$(ECHO) "FINAL_LOCATION=$(FINAL_LOCATION)"
|
||||
$(PERL) $(STDDIR)/softIoc/makeInstallDir.pl "$(FINAL_LOCATION)" > $@
|
||||
|
||||
$(PERL) $(STDDIR)/softIoc/makeInstallDir.pl "$(FINAL_LOCATION)" > $@.stdout
|
||||
$(MV) $@.stdout $@
|
||||
@@ -37,6 +37,6 @@ static long read_string(lsiRecord *prec)
|
||||
}
|
||||
|
||||
static lsidset dev_CSAFEAPPNAME_Version = {
|
||||
{5, NULL, NULL, NULL, NULL}, read_string
|
||||
{5, NULL, NULL, NULL, NULL}, read_string
|
||||
};
|
||||
epicsExportAddress(dset,dev_CSAFEAPPNAME_Version);
|
||||
@@ -102,16 +102,16 @@ $SIG{__DIE__} = sub {
|
||||
};
|
||||
|
||||
sub make_fragment {
|
||||
my $fragment = $_[1];
|
||||
$fragment =~ s/\W+/-/g;
|
||||
$fragment = lc($fragment);
|
||||
$_[1] = $fragment;
|
||||
my $fragment = $_[1];
|
||||
$fragment =~ s/\W+/-/g;
|
||||
$fragment = lc($fragment);
|
||||
$_[1] = $fragment;
|
||||
}
|
||||
|
||||
my $podRst = EPICS::PodMD->new(
|
||||
perldoc_url_prefix => '',
|
||||
perldoc_fragment_format => make_fragment,
|
||||
markdown_fragment_format => make_fragment,
|
||||
perldoc_url_prefix => '',
|
||||
perldoc_fragment_format => make_fragment,
|
||||
markdown_fragment_format => make_fragment,
|
||||
);
|
||||
|
||||
# Parse the Pod text from the root DBD object
|
||||
|
||||
Reference in new issue
Block a user