14 #include <epicsExport.h> 22 #include <longoutRecord.h> 23 #include <stringinRecord.h> 80 static long add_lo(dbCommon* praw)
82 longoutRecord *prec=(longoutRecord*)praw;
84 assert(prec->out.type==INST_IO);
88 if (
linkOptionsStore(eventdef, priv.get(), prec->out.value.instio.string, 0))
89 throw std::runtime_error(
"Couldn't parse link string");
91 priv->last_code=prec->val;
95 errlogPrintf(
"%s: failed to find object '%s'\n", praw->name, priv->obj);
98 priv->card=
dynamic_cast<EVR*
>(O);
100 errlogPrintf(
"%s: object '%s' is not an EVR\n", praw->name, priv->obj);
104 if(priv->last_code>0 && priv->last_code<=255)
105 priv->card->specialSetMap(priv->last_code,priv->func,
true);
107 praw->dpvt = (
void*)priv.release();
111 }
catch(std::exception& e) {
112 recGblRecordError(S_db_noMemory, (
void*)prec, e.what());
113 (void)recGblSetSevr(praw, WRITE_ALARM, INVALID_ALARM);
114 return S_db_noMemory;
119 long del_lo(dbCommon* praw)
122 mrf::auto_ptr<map_priv>
priv(static_cast<map_priv*>(praw->dpvt));
127 if(priv->last_code>0 && priv->last_code<=255)
128 priv->card->specialSetMap(priv->last_code,priv->func,
false);
131 }
catch(std::exception& e) {
132 recGblRecordError(S_db_noMemory, (
void*)praw, e.what());
134 (void)recGblSetSevr(praw, WRITE_ALARM, INVALID_ALARM);
135 return S_db_noMemory;
138 static long write_lo(longoutRecord* prec)
148 epicsUInt32
code=prec->val;
151 (void)recGblSetSevr((dbCommon *)prec, WRITE_ALARM, INVALID_ALARM);
168 }
catch(std::exception& e) {
170 recGblRecordError(S_db_noMemory, (
void*)prec, e.what());
171 (void)recGblSetSevr((dbCommon *)prec, WRITE_ALARM, INVALID_ALARM);
172 return S_db_noMemory;
185 dset_cast(&init_dset<&dxtLOEVRMap>),
186 (DEVSUPFUN) init_record_empty,
188 (DEVSUPFUN) write_lo,
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.
virtual void specialSetMap(epicsUInt32 code, epicsUInt32 func, bool set)=0
epicsExportAddress(dset, devLOEVRMap)
#define linkEnum(Struct, Member, Name, Req, Over, Enums)
Hardware link parsing and storage.
#define linkString(Struct, Member, Name, Req, Over)