allow writing pvCopy plugins for the master field

This commit is contained in:
Sinisa Veseli
2021-11-30 08:54:57 -06:00
parent 0cf706511e
commit 9dfebf1897
2 changed files with 16 additions and 5 deletions

View File

@ -88,7 +88,6 @@ PVCopyPtr PVCopy::create(
bool result = pvCopy->init(pvStructure);
if(!result) return PVCopyPtr();
pvCopy->traverseMasterInitPlugin();
//cout << pvCopy->dump() << endl;
return pvCopy;
}
@ -433,10 +432,19 @@ bool PVCopy::init(epics::pvData::PVStructurePtr const &pvRequest)
PVStructurePtr pvMasterStructure = pvMaster;
size_t len = pvRequest->getPVFields().size();
bool entireMaster = false;
if(len==0) entireMaster = true;
PVStructurePtr pvOptions;
if(len==1) {
pvOptions = pvRequest->getSubField<PVStructure>("_options");
if(len==0) {
entireMaster = true;
}
else {
// If masterField is in the request, but not in the master structure,
// then assume entire master is requested
PVStructurePtr masterFieldPtr = pvMaster->getSubField<PVStructure>("masterField");
PVStructurePtr requestFieldPtr = pvRequest->getSubField<PVStructure>("masterField");
if (!masterFieldPtr && requestFieldPtr) {
entireMaster = true;
pvOptions = requestFieldPtr->getSubField<PVStructure>("_options");
}
}
if(entireMaster) {
structure = pvMasterStructure->getStructure();

View File

@ -418,7 +418,10 @@ void PVRecordField::postParent(PVRecordFieldPtr const & subField)
listener->dataPut(pvrs,subField);
}
PVRecordStructurePtr parent(this->parent.lock());
if(parent) parent->postParent(subField);
if(parent) {
parent->postParent(subField);
parent->callListener();
}
}
void PVRecordField::postSubField()