14 #include <epicsExport.h> 22 #include <longoutRecord.h> 23 #include <stringinRecord.h> 68 static long add_lo(dbCommon* praw)
71 longoutRecord *prec = (longoutRecord*)praw;
73 assert(prec->out.type==INST_IO);
76 priv->last_code=prec->val;
78 if (
linkOptionsStore(eventdef, priv.get(), prec->out.value.instio.string, 0))
79 throw std::runtime_error(
"Couldn't parse link string");
83 errlogPrintf(
"%s: failed to find object '%s'\n", praw->name, priv->obj);
86 priv->pulser=
dynamic_cast<Pulser*
>(O);
88 throw std::runtime_error(
"Failed to lookup device");
90 if(priv->last_code>0 && priv->last_code<=255)
91 priv->pulser->sourceSetMap(priv->last_code,priv->func);
93 prec->dpvt=(
void*)priv.release();
97 }
catch(std::runtime_error& e) {
98 recGblRecordError(S_dev_noDevice, (
void*)prec, e.what());
100 }
catch(std::exception& e) {
101 recGblRecordError(S_db_noMemory, (
void*)prec, e.what());
108 long del_lo(dbCommon* praw)
113 mrf::auto_ptr<map_priv>
priv(static_cast<map_priv*>(praw->dpvt));
115 if(priv->last_code>0 && priv->last_code<=255)
119 }
catch(std::exception& e) {
120 recGblRecordError(S_db_noMemory, (
void*)praw, e.what());
122 (void)recGblSetSevr(praw, WRITE_ALARM, INVALID_ALARM);
123 return S_db_noMemory;
126 static long write_lo(longoutRecord* plo)
134 epicsUInt32
code=plo->val;
137 (void)recGblSetSevr((dbCommon *)plo, WRITE_ALARM, INVALID_ALARM);
155 }
catch(std::exception& e) {
158 (void)recGblSetSevr((dbCommon *)plo, WRITE_ALARM, INVALID_ALARM);
159 recGblRecordError(S_db_noMemory, (
void*)plo, e.what());
160 return S_db_noMemory;
173 dset_cast(&init_dset<&dxtLOEVRPulserMap>),
174 (DEVSUPFUN) &init_record_empty,
176 (DEVSUPFUN) &write_lo,
virtual void sourceSetMap(epicsUInt32 src, MapType::type action)=0
Set mapping of source 'src'.
static Object * getObject(const std::string &name)
int epicsShareAPI linkOptionsStore(const linkOptionDef *opts, void *user, const char *str, int options)
Parse a string a store the result.
A programmable delay unit.
#define linkEnum(Struct, Member, Name, Req, Over, Enums)
Hardware link parsing and storage.
epicsExportAddress(dset, devLOEVRPulserMap)
#define linkString(Struct, Member, Name, Req, Over)