checkDISP

This commit is contained in:
Michael Davidsaver
2020-07-03 10:09:19 -07:00
parent e894ae753f
commit 8e7a1ad295
2 changed files with 17 additions and 3 deletions

View File

@ -400,7 +400,7 @@ void PDBSinglePut::put(pvd::PVStructure::shared_pointer const & value,
p2p::auto_ptr<PVIF> putpvif(channel->pv->builder->attach(channel->pv->chan, value, FieldName()));
try{
DBScanLocker L(chan);
putpvif->get(*changed, doProc);
ret = putpvif->get(*changed, doProc);
}catch(std::runtime_error& e){
ret = pvd::Status::error(e.what());

View File

@ -641,6 +641,14 @@ void findFormat(pvTimeAlarm& pvmeta, pdbRecordIterator& info, const epics::pvDat
}
}
pvd::Status checkDISP(dbChannel *chan)
{
dbCommon *prec = dbChannelRecord(chan);
pvd::Status ret;
if(prec->disp && dbChannelField(chan)!=&prec->disp)
ret = pvd::Status::error("Put Disabled");
return ret;
}
template<typename PVX, typename META>
struct PVIFScalarNumeric : public PVIF
@ -698,7 +706,10 @@ struct PVIFScalarNumeric : public PVIF
virtual pvd::Status get(const epics::pvData::BitSet& mask, proc_t proc, bool permit) OVERRIDE FINAL
{
pvd::Status ret;
pvd::Status ret = checkDISP(chan);
if(!ret)
return ret;
bool newval = mask.logical_and(pvmeta.maskVALUEPut);
if(newval) {
if(permit)
@ -906,7 +917,10 @@ struct PVIFPlain : public PVIF
virtual pvd::Status get(const epics::pvData::BitSet& mask, proc_t proc, bool permit) OVERRIDE FINAL
{
pvd::Status ret;
pvd::Status ret = checkDISP(chan);
if(!ret)
return ret;
bool newval = mask.get(fieldOffset);
if(newval) {
if(permit)