afafa09547
ioc: check for mis-matched onStartSubscription()/onDisableSubscription() ioc: fix subscription lifetime ioc: catch exceptions in dbEvent callbacks ioc: avoid unnecessary virtual ioc: minor ioc: fix qsrv -S ioc: qsrvGroupSourceInit() catch+log ioc: runOnServer avoid std::function ioc: cleanup and simplifications. Avoid some redundant std::map lookups. Make Group partially const to prevent implicit ctor. ioc: avoid typedefs only used once ioc: overhaul Group::show(). shows triggers ioc: MappingType ioc: pvxsgl -> pvxgl ioc: separate group config singleton from server singleton ioc: remove unnecessary forward declarations ioc: restructure pvxsInitHook ioc: qsrv runtime disable by default ioc: compat w/ older Base ioc: link pvxsIoc w/ DB libs ioc: Channel proper detection of invalid PV ioc: no need to keep vector<dbCommon*> around ioc: fix initial group update for mappings w/o dbChannel ioc: redo testing split out group tests, only run with Base >= 7.0 ioc: minor ioc: loc_bad_alloc ioc: avoid symbol/DTYP clash with pva2pva ioc: test record alias in group json ioc: test put failure when SPC_NOMOD and DISP=1 ioc: test channel filters ioc: unnecessary capture ioc: avoid sharing Value between multiple subscriptions It is possible to create two subscriptions through the same channel. ioc: group subscription include queueSize ioc: eliminate unused atomicMonitor ioc: consolidate GroupSource::get() avoid some indirection ioc: pvRequest override of atomicPutGet ioc: fix group non-atomic put ioc: test asTrap hooks ioc: test putOrder also sets field order ioc: simplify GroupConfigProcessor::loadConfigFiles() Also ensure that groupMapMutex is held ioc: testqgroup cover JSON def. ioc: dbLoadGroup() use macros ioc: pvxsl() take integer argument ioc: display.form and info(Q:form ioc: "NO_ALARM" -> "" ioc: use dbServer at least for informational callbacks. ioc: consolidate createRequestAndSubscriptionHandlers() ioc: eliminate ChannelAndLock properties dbChannel doesn't need a separate DBManyLock ioc: test that putOrder also controls field order ioc: MappingType -> MappingInfo Handle info(Q:time:tag Add +type:"const" ioc: cleanup includes ioc: test dbNotifyCancel() ioc: inline checkForTrailingCommentsAtEnd()
87 lines
1.8 KiB
C++
87 lines
1.8 KiB
C++
|
|
#include <epicsMath.h>
|
|
#include <dbAccess.h>
|
|
#include <dbScan.h>
|
|
#include <dbLink.h>
|
|
#include <recGbl.h>
|
|
#include <alarm.h>
|
|
|
|
#include <longinRecord.h>
|
|
#include <waveformRecord.h>
|
|
#include <menuFtype.h>
|
|
|
|
#include <epicsExport.h>
|
|
|
|
namespace {
|
|
|
|
// pi/180
|
|
static const double pi_180 = 0.017453292519943295;
|
|
|
|
int dummy;
|
|
|
|
long init_spin(waveformRecord* prec) {
|
|
if (prec->ftvl == menuFtypeDOUBLE)
|
|
prec->dpvt = &dummy;
|
|
return 0;
|
|
}
|
|
|
|
long process_spin(waveformRecord* prec) {
|
|
if (prec->dpvt != &dummy) {
|
|
(void)recGblSetSevr(prec, COMM_ALARM, INVALID_ALARM);
|
|
return 0;
|
|
}
|
|
|
|
const double freq = 360.0 * pi_180 / 100; // rad/sample
|
|
double phase = 0;
|
|
double* val = static_cast<double*>(prec->bptr);
|
|
|
|
long ret = dbGetLink(&prec->inp, DBF_DOUBLE, &phase, 0, 0);
|
|
if (ret) {
|
|
(void)recGblSetSevr(prec, LINK_ALARM, INVALID_ALARM);
|
|
return ret;
|
|
}
|
|
|
|
phase *= pi_180; // deg -> rad
|
|
|
|
for (size_t i = 0, N = prec->nelm; i < N; i++)
|
|
val[i] = sin(freq * i + phase);
|
|
|
|
prec->nord = prec->nelm;
|
|
|
|
#ifdef DBRutag
|
|
prec->utag = (prec->utag + 1u) & 0x7fffffff;
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
|
|
long process_utag(longinRecord* prec) {
|
|
long status = dbGetLink(&prec->inp, DBR_LONG, &prec->val, 0, 0);
|
|
#ifdef DBRutag
|
|
prec->utag = prec->val;
|
|
#else
|
|
(void)recGblSetSevr(prec, COMM_ALARM, INVALID_ALARM);
|
|
#endif
|
|
return status;
|
|
}
|
|
|
|
template<typename REC>
|
|
struct dset5 {
|
|
long count;
|
|
long (* report)(int);
|
|
long (* init)(int);
|
|
long (* init_record)(REC*);
|
|
long (* get_ioint_info)(int, REC*, IOSCANPVT*);
|
|
long (* process)(REC*);
|
|
};
|
|
|
|
dset5<waveformRecord> devWfPDBQ2Demo = { 5, 0, 0, &init_spin, 0, &process_spin };
|
|
dset5<longinRecord> devLoPDBQ2UTag = { 5, 0, 0, 0, 0, &process_utag };
|
|
|
|
} // namespace
|
|
|
|
extern "C" {
|
|
epicsExportAddress(dset, devWfPDBQ2Demo);
|
|
epicsExportAddress(dset, devLoPDBQ2UTag);
|
|
}
|