allow writing pvCopy plugins for the master field
This commit is contained in:
@ -88,7 +88,6 @@ PVCopyPtr PVCopy::create(
|
|||||||
bool result = pvCopy->init(pvStructure);
|
bool result = pvCopy->init(pvStructure);
|
||||||
if(!result) return PVCopyPtr();
|
if(!result) return PVCopyPtr();
|
||||||
pvCopy->traverseMasterInitPlugin();
|
pvCopy->traverseMasterInitPlugin();
|
||||||
//cout << pvCopy->dump() << endl;
|
|
||||||
return pvCopy;
|
return pvCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,10 +432,19 @@ bool PVCopy::init(epics::pvData::PVStructurePtr const &pvRequest)
|
|||||||
PVStructurePtr pvMasterStructure = pvMaster;
|
PVStructurePtr pvMasterStructure = pvMaster;
|
||||||
size_t len = pvRequest->getPVFields().size();
|
size_t len = pvRequest->getPVFields().size();
|
||||||
bool entireMaster = false;
|
bool entireMaster = false;
|
||||||
if(len==0) entireMaster = true;
|
|
||||||
PVStructurePtr pvOptions;
|
PVStructurePtr pvOptions;
|
||||||
if(len==1) {
|
if(len==0) {
|
||||||
pvOptions = pvRequest->getSubField<PVStructure>("_options");
|
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) {
|
if(entireMaster) {
|
||||||
structure = pvMasterStructure->getStructure();
|
structure = pvMasterStructure->getStructure();
|
||||||
|
@ -418,7 +418,10 @@ void PVRecordField::postParent(PVRecordFieldPtr const & subField)
|
|||||||
listener->dataPut(pvrs,subField);
|
listener->dataPut(pvrs,subField);
|
||||||
}
|
}
|
||||||
PVRecordStructurePtr parent(this->parent.lock());
|
PVRecordStructurePtr parent(this->parent.lock());
|
||||||
if(parent) parent->postParent(subField);
|
if(parent) {
|
||||||
|
parent->postParent(subField);
|
||||||
|
parent->callListener();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PVRecordField::postSubField()
|
void PVRecordField::postSubField()
|
||||||
|
Reference in New Issue
Block a user