fix DBR2PVD() DBF_ENUM handling
must treat DBF_ENUM differently in pvif than in dbf_copy as the storage types used are different.
This commit is contained in:
@ -18,6 +18,22 @@
|
||||
|
||||
namespace pvd = epics::pvData;
|
||||
|
||||
// note that we handle DBF_ENUM differently than in pvif.cpp
|
||||
static
|
||||
pvd::ScalarType DBR2PVD(short dbr)
|
||||
{
|
||||
switch(dbr) {
|
||||
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case DBR_##DBFTYPE: return pvd::pv##PVACODE;
|
||||
#define CASE_SKIP_BOOL
|
||||
#include "pv/typemap.h"
|
||||
#undef CASE_SKIP_BOOL
|
||||
#undef CASE
|
||||
case DBF_ENUM: return pvd::pvUShort;
|
||||
case DBF_STRING: return pvd::pvString;
|
||||
}
|
||||
throw std::invalid_argument("Unsupported DBR code");
|
||||
}
|
||||
|
||||
long copyPVD2DBF(const pvd::PVField::const_shared_pointer& inraw,
|
||||
void *outbuf, short outdbf, long *outnReq)
|
||||
{
|
||||
|
@ -302,6 +302,21 @@ long pvaGetTimeStamp(const DBLINK *plink, epicsTimeStamp *pstamp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// note that we handle DBF_ENUM differently than in pvif.cpp
|
||||
pvd::ScalarType DBR2PVD(short dbr)
|
||||
{
|
||||
switch(dbr) {
|
||||
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case DBR_##DBFTYPE: return pvd::pv##PVACODE;
|
||||
#define CASE_SKIP_BOOL
|
||||
#include "pv/typemap.h"
|
||||
#undef CASE_SKIP_BOOL
|
||||
#undef CASE
|
||||
case DBF_ENUM: return pvd::pvUShort;
|
||||
case DBF_STRING: return pvd::pvString;
|
||||
}
|
||||
throw std::invalid_argument("Unsupported DBR code");
|
||||
}
|
||||
|
||||
long pvaPutValue(DBLINK *plink, short dbrType,
|
||||
const void *pbuffer, long nRequest)
|
||||
{
|
||||
|
@ -623,15 +623,17 @@ struct PVIFScalarNumeric : public PVIF
|
||||
|
||||
} // namespace
|
||||
|
||||
static
|
||||
pvd::ScalarType DBR2PVD(short dbr)
|
||||
{
|
||||
switch(dbr) {
|
||||
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case DBR_##DBFTYPE: return pvd::pv##PVACODE;
|
||||
#define CASE_ENUM
|
||||
#define CASE_SKIP_BOOL
|
||||
#include "pv/typemap.h"
|
||||
#undef CASE_ENUM
|
||||
#undef CASE_SKIP_BOOL
|
||||
#undef CASE
|
||||
case DBF_ENUM: return pvd::pvUShort;
|
||||
case DBF_STRING: return pvd::pvString;
|
||||
}
|
||||
throw std::invalid_argument("Unsupported DBR code");
|
||||
|
@ -29,7 +29,6 @@
|
||||
# define USE_MULTILOCK
|
||||
#endif
|
||||
|
||||
epics::pvData::ScalarType DBR2PVD(short dbr);
|
||||
short PVD2DBR(epics::pvData::ScalarType pvt);
|
||||
|
||||
// copy from PVField (.value sub-field) to DBF buffer
|
||||
|
Reference in New Issue
Block a user