diff --git a/pdbApp/pvalink_lset.cpp b/pdbApp/pvalink_lset.cpp index 653b33d..7b2c573 100644 --- a/pdbApp/pvalink_lset.cpp +++ b/pdbApp/pvalink_lset.cpp @@ -4,6 +4,8 @@ #include #include // redirect stdout/stderr +#include + #include #include "pvalink.h" @@ -215,6 +217,31 @@ long pvaGetValue(DBLINK *plink, short dbrType, void *pbuffer, return -1; } + if(dbrType==DBR_VFIELD) { + if(!self->lchan->op_mon.root) + return -1; + + VField *vfield = static_cast(pbuffer); + if(vfield->vtype==&vfStructure) { + VSharedStructure *vstruct = static_cast(pbuffer); + *vstruct->value = self->lchan->op_mon.root->getStructure(); + return 0; + + } else if(vfield->vtype==&vfPVStructure) { + VSharedPVStructure *vinst = static_cast(pbuffer); + if((*vinst->value)->getStructure()!=self->lchan->op_mon.root->getStructure()) { + // TODO: how to handle type change? + return S_db_badDbrtype; + } + (*vinst->value)->copy(*self->lchan->op_mon.root); + (*vinst->changed) |= self->lchan->op_mon.changed; + return 0; + + } else { + return S_db_badDbrtype; + } + } + if(self->fld_value) { long status = copyPVD2DBF(self->fld_value, pbuffer, dbrType, pnRequest); if(status) {