Skip to content

Commit

Permalink
WIP: pva link w/ DBR_VFIELD
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Jul 5, 2022
1 parent 8427d68 commit aba9fa7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pdbApp/pvalink_lset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <recGbl.h>
#include <epicsStdio.h> // redirect stdout/stderr

#include <pvstructinRecord.h>

#include <pv/current_function.h>

#include "pvalink.h"
Expand Down Expand Up @@ -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<VField*>(pbuffer);
if(vfield->vtype==&vfStructure) {
VSharedStructure *vstruct = static_cast<VSharedStructure*>(pbuffer);
*vstruct->value = self->lchan->op_mon.root->getStructure();
return 0;

} else if(vfield->vtype==&vfPVStructure) {
VSharedPVStructure *vinst = static_cast<VSharedPVStructure*>(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) {
Expand Down

0 comments on commit aba9fa7

Please sign in to comment.