Merge pull request #10 from dhickin/replace_calls_getScalarArrayField
Replace calls of deprecated PVStructure::getScalarArrayField
This commit is contained in:
+4
-4
@@ -328,7 +328,7 @@ void formatTable(std::ostream& o,
|
||||
|
||||
void formatNTTable(std::ostream& o, PVStructurePtr const & pvStruct)
|
||||
{
|
||||
PVStringArrayPtr labels = dynamic_pointer_cast<PVStringArray>(pvStruct->getScalarArrayField("labels", pvString));
|
||||
PVStringArrayPtr labels = pvStruct->getSubField<PVStringArray>("labels");
|
||||
if (labels.get() == 0)
|
||||
{
|
||||
std::cerr << "no string[] 'labels' field in NTTable" << std::endl;
|
||||
@@ -371,7 +371,7 @@ void formatNTTable(std::ostream& o, PVStructurePtr const & pvStruct)
|
||||
|
||||
void formatNTMatrix(std::ostream& o, PVStructurePtr const & pvStruct)
|
||||
{
|
||||
PVDoubleArrayPtr value = dynamic_pointer_cast<PVDoubleArray>(pvStruct->getScalarArrayField("value", pvDouble));
|
||||
PVDoubleArrayPtr value = pvStruct->getSubField<PVDoubleArray>("value");
|
||||
if (value.get() == 0)
|
||||
{
|
||||
std::cerr << "no double[] 'value' field in NTMatrix" << std::endl;
|
||||
@@ -380,7 +380,7 @@ void formatNTMatrix(std::ostream& o, PVStructurePtr const & pvStruct)
|
||||
|
||||
int32 rows, cols;
|
||||
|
||||
PVIntArrayPtr dim = dynamic_pointer_cast<PVIntArray>(pvStruct->getScalarArrayField("dim", pvInt));
|
||||
PVIntArrayPtr dim = pvStruct->getSubField<PVIntArray>("dim");
|
||||
if (dim.get() != 0)
|
||||
{
|
||||
// dim[] = { rows, columns }
|
||||
@@ -479,7 +479,7 @@ void formatNTMatrix(std::ostream& o, PVStructurePtr const & pvStruct)
|
||||
// TODO use formatNTTable
|
||||
void formatNTNameValue(std::ostream& o, PVStructurePtr const & pvStruct)
|
||||
{
|
||||
PVStringArrayPtr name = dynamic_pointer_cast<PVStringArray>(pvStruct->getScalarArrayField("name", pvString));
|
||||
PVStringArrayPtr name = pvStruct->getSubField<PVStringArray>("name");
|
||||
if (name.get() == 0)
|
||||
{
|
||||
std::cerr << "no string[] 'name' field in NTNameValue" << std::endl;
|
||||
|
||||
+63
-69
@@ -107,8 +107,7 @@ static PVStructure::shared_pointer createPVStructure(CAChannel::shared_pointer c
|
||||
PVStructure::shared_pointer pvStructure = getPVDataCreate()->createPVStructure(createStructure(channel, properties));
|
||||
if (channel->getNativeType() == DBR_ENUM)
|
||||
{
|
||||
|
||||
PVScalarArrayPtr pvScalarArray = pvStructure->getScalarArrayField("value.choices", pvString);
|
||||
PVScalarArrayPtr pvScalarArray = pvStructure->getSubField<PVStringArray>("value.choices");
|
||||
|
||||
// TODO avoid getting labels if DBR_GR_ENUM or DBR_CTRL_ENUM is used in subsequent get
|
||||
int result = ca_array_get_callback(DBR_GR_ENUM, 1, channel->getChannelID(), ca_get_labels_handler, pvScalarArray.get());
|
||||
@@ -558,8 +557,8 @@ static void ca_get_handler(struct event_handler_args args)
|
||||
typedef void (*copyDBRtoPVStructure)(const void * from, unsigned count, PVStructure::shared_pointer const & to);
|
||||
|
||||
|
||||
// template<primitive type, ScalarType, scalar Field, array Field>
|
||||
template<typename pT, epics::pvData::ScalarType sT, typename sF, typename aF>
|
||||
// template<primitive type, scalar Field, array Field>
|
||||
template<typename pT, typename sF, typename aF>
|
||||
void copy_DBR(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
if (count == 1)
|
||||
@@ -569,8 +568,7 @@ void copy_DBR(const void * dbr, unsigned count, PVStructure::shared_pointer cons
|
||||
}
|
||||
else
|
||||
{
|
||||
std::tr1::shared_ptr<aF> value =
|
||||
std::tr1::static_pointer_cast<aF>(pvStructure->getScalarArrayField("value", sT));
|
||||
std::tr1::shared_ptr<aF> value = pvStructure->getSubField<aF>("value");
|
||||
typename aF::svector temp(value->reuse());
|
||||
temp.resize(count);
|
||||
std::copy(static_cast<const pT*>(dbr), static_cast<const pT*>(dbr) + count, temp.begin());
|
||||
@@ -580,9 +578,9 @@ void copy_DBR(const void * dbr, unsigned count, PVStructure::shared_pointer cons
|
||||
|
||||
#if defined(__vxworks) || defined(__rtems__)
|
||||
// dbr_long_t is defined as "int", pvData uses int32 which can be defined as "long int" (32-bit)
|
||||
// template<primitive type, ScalarType, scalar Field, array Field>
|
||||
// template<primitive type, scalar Field, array Field>
|
||||
template<>
|
||||
void copy_DBR<dbr_long_t, pvInt, PVInt, PVIntArray>(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
void copy_DBR<dbr_long_t, PVInt, PVIntArray>(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
if (count == 1)
|
||||
{
|
||||
@@ -591,8 +589,7 @@ void copy_DBR<dbr_long_t, pvInt, PVInt, PVIntArray>(const void * dbr, unsigned c
|
||||
}
|
||||
else
|
||||
{
|
||||
std::tr1::shared_ptr<PVIntArray> value =
|
||||
std::tr1::static_pointer_cast<PVIntArray>(pvStructure->getScalarArrayField("value", pvInt));
|
||||
std::tr1::shared_ptr<PVIntArray> value = pvStructure->getSubField<PVIntArray>("value");
|
||||
PVIntArray::svector temp(value->reuse());
|
||||
temp.resize(count);
|
||||
std::copy(static_cast<const int32*>(dbr), static_cast<const int32*>(dbr) + count, temp.begin());
|
||||
@@ -603,7 +600,7 @@ void copy_DBR<dbr_long_t, pvInt, PVInt, PVIntArray>(const void * dbr, unsigned c
|
||||
|
||||
// string specialization
|
||||
template<>
|
||||
void copy_DBR<string, pvString, PVString, PVStringArray>(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
void copy_DBR<string, PVString, PVStringArray>(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
if (count == 1)
|
||||
{
|
||||
@@ -612,8 +609,7 @@ void copy_DBR<string, pvString, PVString, PVStringArray>(const void * dbr, unsig
|
||||
}
|
||||
else
|
||||
{
|
||||
std::tr1::shared_ptr<PVStringArray> value =
|
||||
std::tr1::static_pointer_cast<PVStringArray>(pvStructure->getScalarArrayField("value", pvString));
|
||||
std::tr1::shared_ptr<PVStringArray> value = pvStructure->getSubField<PVStringArray>("value");
|
||||
const dbr_string_t* dbrStrings = static_cast<const dbr_string_t*>(dbr);
|
||||
PVStringArray::svector sA(value->reuse());
|
||||
sA.resize(count);
|
||||
@@ -624,7 +620,7 @@ void copy_DBR<string, pvString, PVString, PVStringArray>(const void * dbr, unsig
|
||||
|
||||
// enum specialization
|
||||
template<>
|
||||
void copy_DBR<dbr_enum_t, pvString, PVString, PVStringArray>(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
void copy_DBR<dbr_enum_t, PVString, PVStringArray>(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
if (count == 1)
|
||||
{
|
||||
@@ -638,8 +634,8 @@ void copy_DBR<dbr_enum_t, pvString, PVString, PVStringArray>(const void * dbr, u
|
||||
}
|
||||
}
|
||||
|
||||
// template<DBR type, primitive type, ScalarType, scalar Field, array Field>
|
||||
template<typename T, typename pT, epics::pvData::ScalarType sT, typename sF, typename aF>
|
||||
// template<DBR type, primitive type, scalar Field, array Field>
|
||||
template<typename T, typename pT, typename sF, typename aF>
|
||||
void copy_DBR_STS(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
const T* data = static_cast<const T*>(dbr);
|
||||
@@ -649,11 +645,11 @@ void copy_DBR_STS(const void * dbr, unsigned count, PVStructure::shared_pointer
|
||||
alarm->getSubField<PVInt>("severity")->put(data->severity);
|
||||
alarm->getSubField<PVString>("message")->put(dbrStatus2alarmMessage[data->status]);
|
||||
|
||||
copy_DBR<pT, sT, sF, aF>(&data->value, count, pvStructure);
|
||||
copy_DBR<pT, sF, aF>(&data->value, count, pvStructure);
|
||||
}
|
||||
|
||||
// template<DBR type, primitive type, ScalarType, scalar Field, array Field>
|
||||
template<typename T, typename pT, epics::pvData::ScalarType sT, typename sF, typename aF>
|
||||
// template<DBR type, primitive type, scalar Field, array Field>
|
||||
template<typename T, typename pT, typename sF, typename aF>
|
||||
void copy_DBR_TIME(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
const T* data = static_cast<const T*>(dbr);
|
||||
@@ -664,7 +660,7 @@ void copy_DBR_TIME(const void * dbr, unsigned count, PVStructure::shared_pointer
|
||||
ts->getSubField<PVLong>("secondsPastEpoch")->put(spe);
|
||||
ts->getSubField<PVInt>("nanoseconds")->put(data->stamp.nsec);
|
||||
|
||||
copy_DBR_STS<T, pT, sT, sF, aF>(dbr, count, pvStructure);
|
||||
copy_DBR_STS<T, pT, sF, aF>(dbr, count, pvStructure);
|
||||
}
|
||||
|
||||
|
||||
@@ -705,8 +701,8 @@ COPY_FORMAT_FOR(dbr_ctrl_double)
|
||||
|
||||
#undef COPY_FORMAT_FOR
|
||||
|
||||
// template<DBR type, primitive type, ScalarType, scalar Field, array Field>
|
||||
template<typename T, typename pT, epics::pvData::ScalarType sT, typename sF, typename aF>
|
||||
// template<DBR type, primitive type, scalar Field, array Field>
|
||||
template<typename T, typename pT, typename sF, typename aF>
|
||||
void copy_DBR_GR(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
const T* data = static_cast<const T*>(dbr);
|
||||
@@ -729,22 +725,22 @@ void copy_DBR_GR(const void * dbr, unsigned count, PVStructure::shared_pointer c
|
||||
va->getSubField<PVDouble>("lowWarningLimit")->put(data->lower_warning_limit);
|
||||
va->getSubField<PVDouble>("lowAlarmLimit")->put(data->lower_alarm_limit);
|
||||
|
||||
copy_DBR<pT, sT, sF, aF>(&data->value, count, pvStructure);
|
||||
copy_DBR<pT, sF, aF>(&data->value, count, pvStructure);
|
||||
}
|
||||
|
||||
// enum specialization
|
||||
template<>
|
||||
void copy_DBR_GR<dbr_gr_enum, dbr_enum_t, pvString, PVString, PVStringArray>
|
||||
void copy_DBR_GR<dbr_gr_enum, dbr_enum_t, PVString, PVStringArray>
|
||||
(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
const dbr_gr_enum* data = static_cast<const dbr_gr_enum*>(dbr);
|
||||
|
||||
copy_DBR_STS<dbr_gr_enum, dbr_enum_t, pvString, PVString, PVStringArray>(data, count, pvStructure);
|
||||
copy_DBR_STS<dbr_gr_enum, dbr_enum_t, PVString, PVStringArray>(data, count, pvStructure);
|
||||
}
|
||||
|
||||
|
||||
// template<DBR type, primitive type, ScalarType, scalar Field, array Field>
|
||||
template<typename T, typename pT, epics::pvData::ScalarType sT, typename sF, typename aF>
|
||||
// template<DBR type, primitive type, scalar Field, array Field>
|
||||
template<typename T, typename pT, typename sF, typename aF>
|
||||
void copy_DBR_CTRL(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
const T* data = static_cast<const T*>(dbr);
|
||||
@@ -771,61 +767,61 @@ void copy_DBR_CTRL(const void * dbr, unsigned count, PVStructure::shared_pointer
|
||||
ctrl->getSubField<PVDouble>("limitHigh")->put(data->upper_ctrl_limit);
|
||||
ctrl->getSubField<PVDouble>("limitLow")->put(data->lower_ctrl_limit);
|
||||
|
||||
copy_DBR<pT, sT, sF, aF>(&data->value, count, pvStructure);
|
||||
copy_DBR<pT, sF, aF>(&data->value, count, pvStructure);
|
||||
}
|
||||
|
||||
// enum specialization
|
||||
template<>
|
||||
void copy_DBR_CTRL<dbr_ctrl_enum, dbr_enum_t, pvString, PVString, PVStringArray>
|
||||
void copy_DBR_CTRL<dbr_ctrl_enum, dbr_enum_t, PVString, PVStringArray>
|
||||
(const void * dbr, unsigned count, PVStructure::shared_pointer const & pvStructure)
|
||||
{
|
||||
const dbr_ctrl_enum* data = static_cast<const dbr_ctrl_enum*>(dbr);
|
||||
|
||||
copy_DBR_STS<dbr_ctrl_enum, dbr_enum_t, pvString, PVString, PVStringArray>(data, count, pvStructure);
|
||||
copy_DBR_STS<dbr_ctrl_enum, dbr_enum_t, PVString, PVStringArray>(data, count, pvStructure);
|
||||
}
|
||||
|
||||
|
||||
static copyDBRtoPVStructure copyFuncTable[] =
|
||||
{
|
||||
copy_DBR<string, pvString, PVString, PVStringArray>, // DBR_STRING
|
||||
copy_DBR<dbr_short_t, pvShort, PVShort, PVShortArray>, // DBR_INT, DBR_SHORT
|
||||
copy_DBR<dbr_float_t, pvFloat, PVFloat, PVFloatArray>, // DBR_FLOAT
|
||||
copy_DBR<dbr_enum_t, pvString, PVString, PVStringArray>, // DBR_ENUM
|
||||
copy_DBR<int8 /*dbr_char_t*/, pvByte, PVByte, PVByteArray>, // DBR_CHAR
|
||||
copy_DBR<dbr_long_t, pvInt, PVInt, PVIntArray>, // DBR_LONG
|
||||
copy_DBR<dbr_double_t, pvDouble, PVDouble, PVDoubleArray>, // DBR_DOUBLE
|
||||
copy_DBR<string, PVString, PVStringArray>, // DBR_STRING
|
||||
copy_DBR<dbr_short_t, PVShort, PVShortArray>, // DBR_INT, DBR_SHORT
|
||||
copy_DBR<dbr_float_t, PVFloat, PVFloatArray>, // DBR_FLOAT
|
||||
copy_DBR<dbr_enum_t, PVString, PVStringArray>, // DBR_ENUM
|
||||
copy_DBR<int8 /*dbr_char_t*/, PVByte, PVByteArray>, // DBR_CHAR
|
||||
copy_DBR<dbr_long_t, PVInt, PVIntArray>, // DBR_LONG
|
||||
copy_DBR<dbr_double_t, PVDouble, PVDoubleArray>, // DBR_DOUBLE
|
||||
|
||||
copy_DBR_STS<dbr_sts_string, string, pvString, PVString, PVStringArray>, // DBR_STS_STRING
|
||||
copy_DBR_STS<dbr_sts_short, dbr_short_t, pvShort, PVShort, PVShortArray>, // DBR_STS_INT, DBR_STS_SHORT
|
||||
copy_DBR_STS<dbr_sts_float, dbr_float_t, pvFloat, PVFloat, PVFloatArray>, // DBR_STS_FLOAT
|
||||
copy_DBR_STS<dbr_sts_enum, dbr_enum_t, pvString, PVString, PVStringArray>, // DBR_STS_ENUM
|
||||
copy_DBR_STS<dbr_sts_char, int8 /*dbr_char_t*/, pvByte, PVByte, PVByteArray>, // DBR_STS_CHAR
|
||||
copy_DBR_STS<dbr_sts_long, dbr_long_t, pvInt, PVInt, PVIntArray>, // DBR_STS_LONG
|
||||
copy_DBR_STS<dbr_sts_double, dbr_double_t, pvDouble, PVDouble, PVDoubleArray>, // DBR_STS_DOUBLE
|
||||
copy_DBR_STS<dbr_sts_string, string, PVString, PVStringArray>, // DBR_STS_STRING
|
||||
copy_DBR_STS<dbr_sts_short, dbr_short_t, PVShort, PVShortArray>, // DBR_STS_INT, DBR_STS_SHORT
|
||||
copy_DBR_STS<dbr_sts_float, dbr_float_t, PVFloat, PVFloatArray>, // DBR_STS_FLOAT
|
||||
copy_DBR_STS<dbr_sts_enum, dbr_enum_t, PVString, PVStringArray>, // DBR_STS_ENUM
|
||||
copy_DBR_STS<dbr_sts_char, int8 /*dbr_char_t*/, PVByte, PVByteArray>, // DBR_STS_CHAR
|
||||
copy_DBR_STS<dbr_sts_long, dbr_long_t, PVInt, PVIntArray>, // DBR_STS_LONG
|
||||
copy_DBR_STS<dbr_sts_double, dbr_double_t, PVDouble, PVDoubleArray>, // DBR_STS_DOUBLE
|
||||
|
||||
copy_DBR_TIME<dbr_time_string, string, pvString, PVString, PVStringArray>, // DBR_TIME_STRING
|
||||
copy_DBR_TIME<dbr_time_short, dbr_short_t, pvShort, PVShort, PVShortArray>, // DBR_TIME_INT, DBR_TIME_SHORT
|
||||
copy_DBR_TIME<dbr_time_float, dbr_float_t, pvFloat, PVFloat, PVFloatArray>, // DBR_TIME_FLOAT
|
||||
copy_DBR_TIME<dbr_time_enum, dbr_enum_t, pvString, PVString, PVStringArray>, // DBR_TIME_ENUM
|
||||
copy_DBR_TIME<dbr_time_char, int8 /*dbr_char_t*/, pvByte, PVByte, PVByteArray>, // DBR_TIME_CHAR
|
||||
copy_DBR_TIME<dbr_time_long, dbr_long_t, pvInt, PVInt, PVIntArray>, // DBR_TIME_LONG
|
||||
copy_DBR_TIME<dbr_time_double, dbr_double_t, pvDouble, PVDouble, PVDoubleArray>, // DBR_TIME_DOUBLE
|
||||
copy_DBR_TIME<dbr_time_string, string, PVString, PVStringArray>, // DBR_TIME_STRING
|
||||
copy_DBR_TIME<dbr_time_short, dbr_short_t, PVShort, PVShortArray>, // DBR_TIME_INT, DBR_TIME_SHORT
|
||||
copy_DBR_TIME<dbr_time_float, dbr_float_t, PVFloat, PVFloatArray>, // DBR_TIME_FLOAT
|
||||
copy_DBR_TIME<dbr_time_enum, dbr_enum_t, PVString, PVStringArray>, // DBR_TIME_ENUM
|
||||
copy_DBR_TIME<dbr_time_char, int8 /*dbr_char_t*/, PVByte, PVByteArray>, // DBR_TIME_CHAR
|
||||
copy_DBR_TIME<dbr_time_long, dbr_long_t, PVInt, PVIntArray>, // DBR_TIME_LONG
|
||||
copy_DBR_TIME<dbr_time_double, dbr_double_t, PVDouble, PVDoubleArray>, // DBR_TIME_DOUBLE
|
||||
|
||||
copy_DBR_STS<dbr_sts_string, string, pvString, PVString, PVStringArray>, // DBR_GR_STRING -> DBR_STS_STRING
|
||||
copy_DBR_GR<dbr_gr_short, dbr_short_t, pvShort, PVShort, PVShortArray>, // DBR_GR_INT, DBR_GR_SHORT
|
||||
copy_DBR_GR<dbr_gr_float, dbr_float_t, pvFloat, PVFloat, PVFloatArray>, // DBR_GR_FLOAT
|
||||
copy_DBR_GR<dbr_gr_enum, dbr_enum_t, pvString, PVString, PVStringArray>, // DBR_GR_ENUM
|
||||
copy_DBR_GR<dbr_gr_char, int8 /*dbr_char_t*/, pvByte, PVByte, PVByteArray>, // DBR_GR_CHAR
|
||||
copy_DBR_GR<dbr_gr_long, dbr_long_t, pvInt, PVInt, PVIntArray>, // DBR_GR_LONG
|
||||
copy_DBR_GR<dbr_gr_double, dbr_double_t, pvDouble, PVDouble, PVDoubleArray>, // DBR_GR_DOUBLE
|
||||
copy_DBR_STS<dbr_sts_string, string, PVString, PVStringArray>, // DBR_GR_STRING -> DBR_STS_STRING
|
||||
copy_DBR_GR<dbr_gr_short, dbr_short_t, PVShort, PVShortArray>, // DBR_GR_INT, DBR_GR_SHORT
|
||||
copy_DBR_GR<dbr_gr_float, dbr_float_t, PVFloat, PVFloatArray>, // DBR_GR_FLOAT
|
||||
copy_DBR_GR<dbr_gr_enum, dbr_enum_t, PVString, PVStringArray>, // DBR_GR_ENUM
|
||||
copy_DBR_GR<dbr_gr_char, int8 /*dbr_char_t*/, PVByte, PVByteArray>, // DBR_GR_CHAR
|
||||
copy_DBR_GR<dbr_gr_long, dbr_long_t, PVInt, PVIntArray>, // DBR_GR_LONG
|
||||
copy_DBR_GR<dbr_gr_double, dbr_double_t, PVDouble, PVDoubleArray>, // DBR_GR_DOUBLE
|
||||
|
||||
copy_DBR_STS<dbr_sts_string, string, pvString, PVString, PVStringArray>, // DBR_CTRL_STRING -> DBR_STS_STRING
|
||||
copy_DBR_CTRL<dbr_ctrl_short, dbr_short_t, pvShort, PVShort, PVShortArray>, // DBR_CTRL_INT, DBR_CTRL_SHORT
|
||||
copy_DBR_CTRL<dbr_ctrl_float, dbr_float_t, pvFloat, PVFloat, PVFloatArray>, // DBR_CTRL_FLOAT
|
||||
copy_DBR_CTRL<dbr_ctrl_enum, dbr_enum_t, pvString, PVString, PVStringArray>, // DBR_CTRL_ENUM
|
||||
copy_DBR_CTRL<dbr_ctrl_char, int8 /*dbr_char_t*/, pvByte, PVByte, PVByteArray>, // DBR_CTRL_CHAR
|
||||
copy_DBR_CTRL<dbr_ctrl_long, dbr_long_t, pvInt, PVInt, PVIntArray>, // DBR_CTRL_LONG
|
||||
copy_DBR_CTRL<dbr_ctrl_double, dbr_double_t, pvDouble, PVDouble, PVDoubleArray> // DBR_CTRL_DOUBLE
|
||||
copy_DBR_STS<dbr_sts_string, string, PVString, PVStringArray>, // DBR_CTRL_STRING -> DBR_STS_STRING
|
||||
copy_DBR_CTRL<dbr_ctrl_short, dbr_short_t, PVShort, PVShortArray>, // DBR_CTRL_INT, DBR_CTRL_SHORT
|
||||
copy_DBR_CTRL<dbr_ctrl_float, dbr_float_t, PVFloat, PVFloatArray>, // DBR_CTRL_FLOAT
|
||||
copy_DBR_CTRL<dbr_ctrl_enum, dbr_enum_t, PVString, PVStringArray>, // DBR_CTRL_ENUM
|
||||
copy_DBR_CTRL<dbr_ctrl_char, int8 /*dbr_char_t*/, PVByte, PVByteArray>, // DBR_CTRL_CHAR
|
||||
copy_DBR_CTRL<dbr_ctrl_long, dbr_long_t, PVInt, PVIntArray>, // DBR_CTRL_LONG
|
||||
copy_DBR_CTRL<dbr_ctrl_double, dbr_double_t, PVDouble, PVDoubleArray> // DBR_CTRL_DOUBLE
|
||||
};
|
||||
|
||||
void CAChannelGet::getDone(struct event_handler_args &args)
|
||||
@@ -1022,8 +1018,7 @@ int doPut_pvStructure(CAChannel::shared_pointer const & channel, void *usrArg, P
|
||||
}
|
||||
else
|
||||
{
|
||||
std::tr1::shared_ptr<aF> value =
|
||||
std::tr1::static_pointer_cast<aF>(pvStructure->getScalarArrayField("value", sT));
|
||||
std::tr1::shared_ptr<aF> value = pvStructure->getSubField<aF>("value");
|
||||
|
||||
const pT* val = value->view().data();
|
||||
int result = ca_array_put_callback(channel->getNativeType(), static_cast<unsigned long>(value->getLength()),
|
||||
@@ -1063,8 +1058,7 @@ int doPut_pvStructure<string, pvString, PVString, PVStringArray>(CAChannel::shar
|
||||
}
|
||||
else
|
||||
{
|
||||
std::tr1::shared_ptr<PVStringArray> value =
|
||||
std::tr1::static_pointer_cast<PVStringArray>(pvStructure->getScalarArrayField("value", pvString));
|
||||
std::tr1::shared_ptr<PVStringArray> value = pvStructure->getSubField<PVStringArray>("value");
|
||||
|
||||
PVStringArray::const_svector stringArray(value->view());
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ static epics::pvData::PVStructure::shared_pointer createNTHistogram()
|
||||
|
||||
static void generateNTTableDoubleValues(epics::pvData::PVStructure::shared_pointer result)
|
||||
{
|
||||
PVStringArray::shared_pointer pvLabels = (static_pointer_cast<PVStringArray>(result->getScalarArrayField("labels", pvString)));
|
||||
PVStringArray::shared_pointer pvLabels = result->getSubField<PVStringArray>("labels");
|
||||
PVStringArray::const_svector ld(pvLabels->view());
|
||||
|
||||
PVStructure::shared_pointer resultValue = result->getSubField<PVStructure>("value");
|
||||
@@ -2110,7 +2110,7 @@ protected:
|
||||
string allProperties("");
|
||||
// string allProperties("alarm,timeStamp,display,control");
|
||||
m_pvStructure = getStandardPVField()->scalarArray(pvDouble,allProperties);
|
||||
PVDoubleArrayPtr pvField = static_pointer_cast<PVDoubleArray>(m_pvStructure->getScalarArrayField(std::string("value"), pvDouble));
|
||||
PVDoubleArrayPtr pvField = m_pvStructure->getSubField<PVDoubleArray>("value");
|
||||
|
||||
int specCount = 0; char postfix[64];
|
||||
int done = sscanf(m_name.c_str(), "testArray%d%s", &specCount, postfix);
|
||||
|
||||
Reference in New Issue
Block a user