in prog??

This commit is contained in:
Michael Davidsaver
2016-08-31 20:48:13 -04:00
parent 3c7cd0fab4
commit c6d1f6e194
2 changed files with 39 additions and 4 deletions

View File

@ -182,7 +182,35 @@ PDBSinglePut::PDBSinglePut(const PDBSingleChannel::shared_pointer &channel,
,changed(new pvd::BitSet(channel->fielddesc->getNumberFields()))
,pvf(pvd::getPVDataCreate()->createPVStructure(channel->fielddesc))
,pvif(PVIF::attach(channel->pv->chan, pvf))
{}
,doProc(true)
,doProcForce(false)
,doWait(false)
{
dbChannel *chan = channel->pv->chan;
dbCommon *precord = dbChannelRecord(chan);
doProc = dbChannelField(chan) == &precord->proc ||
(dbChannelFldDes(chan)->process_passive &&
precord->scan == 0);
pvd::boolean wait;
getS(pvReq, "_record.options.block", wait);
doWait = wait;
std::string proccmd;
if(getS(pvReq, "_record.options.process", proccmd)) {
if(proccmd=="yes" || proccmd=="1") {
doProc = true;
doProcForce = true;
} else if(proccmd=="no" || proccmd=="0") {
doProc = false;
doProcForce = true;
} else if(proccmd=="passive") {
doProcForce = false;
}
}
memset((void*)&notify, 0, sizeof(notify));
notify.usrPvt = (void*)this;
}
void PDBSinglePut::put(pvd::PVStructure::shared_pointer const & value,
pvd::BitSet::shared_pointer const & changed)
@ -210,9 +238,11 @@ void PDBSinglePut::put(pvd::PVStructure::shared_pointer const & value,
putpvif->get(*changed);
dbCommon *precord = dbChannelRecord(chan);
if (dbChannelField(chan) == &precord->proc ||
(dbChannelFldDes(chan)->process_passive &&
precord->scan == 0)) {
bool tryproc = doProcForce ? doProc : dbChannelField(chan) == &precord->proc ||
(dbChannelFldDes(chan)->process_passive &&
precord->scan == 0);
if (tryproc) {
if (precord->pact) {
if (precord->tpro)
printf("%s: Active %s\n",

View File

@ -4,6 +4,7 @@
#include <deque>
#include <dbAccess.h>
#include <dbNotify.h>
#include <dbEvent.h>
@ -114,6 +115,10 @@ struct PDBSinglePut : public epics::pvAccess::ChannelPut,
epics::pvData::BitSetPtr changed;
epics::pvData::PVStructurePtr pvf;
std::auto_ptr<PVIF> pvif;
processNotify notify;
bool doProc, doProcForce, doWait;
std::tr1::shared_ptr<PDBSinglePut> procself; // make ref. loop while notify is active
PDBSinglePut(const PDBSingleChannel::shared_pointer& channel,
const epics::pvAccess::ChannelPutRequester::shared_pointer& requester,