Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "meta" at member top of array of struct #52

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions iocBoot/iocimagedemo/image.db
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,17 @@ record(mbbi, "$(N):ColorMode") {
}
})
}

record(bo, "$(N):extra") {
field(ZNAM, "foo")
field(ONAM, "bar")
info(Q:group, {
"$(N):Array":{
"attribute[1].value":{+type:"any",
+channel:"VAL",
+putorder:0,
+trigger:"attribute[1].value"},
"attribute[1]":{+type:"meta", +channel:"SEVR"}
}
})
}
9 changes: 6 additions & 3 deletions pdbApp/pdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ PDBProvider::PDBProvider(const epics::pvAccess::Configuration::const_shared_poin
else
builder = builder->addNestedStructure(parts[j].name);
}
if(parts.back().isArray()) {
builder = builder->addNestedStructureArray(parts.back().name);
}
}

if(!mem.structID.empty())
Expand All @@ -457,14 +460,16 @@ PDBProvider::PDBProvider(const epics::pvAccess::Configuration::const_shared_poin

std::tr1::shared_ptr<PVIFBuilder> pvifbuilder(PVIFBuilder::create(mem.type, chan.chan));

if(!parts.empty())
if(!parts.empty() && !parts.back().isArray())
builder = pvifbuilder->dtype(builder, parts.back().name);
else
builder = pvifbuilder->dtype(builder, "");

if(!parts.empty()) {
for(size_t j=0; j<parts.size()-1; j++)
builder = builder->endNested();
if(parts.back().isArray())
builder = builder->endNested();
}

if(!mem.pvname.empty()) {
Expand Down Expand Up @@ -744,8 +749,6 @@ FieldName::FieldName(const std::string& pv)
}
if(parts.empty())
throw std::runtime_error("Empty field name");
if(parts.back().isArray())
throw std::runtime_error("leaf field may not have sub-script : "+pv);
}

epics::pvData::PVFieldPtr
Expand Down