本文整理汇总了C++中NDAttribute::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ NDAttribute::getName方法的具体用法?C++ NDAttribute::getName怎么用?C++ NDAttribute::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NDAttribute
的用法示例。
在下文中一共展示了NDAttribute::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fromAttributes
void NTNDArrayConverter::fromAttributes (NDArray *src)
{
PVStructureArrayPtr dest(m_array->getAttribute());
NDAttributeList *srcList = src->pAttributeList;
NDAttribute *attr = NULL;
StructureConstPtr structure(dest->getStructureArray()->getStructure());
PVStructureArray::svector destVec(dest->reuse());
destVec.resize(srcList->count());
size_t i = 0;
while((attr = srcList->next(attr)))
{
if(!destVec[i].get() || !destVec[i].unique())
destVec[i] = PVDC->createPVStructure(structure);
PVStructurePtr pvAttr(destVec[i]);
pvAttr->getSubField<PVString>("name")->put(attr->getName());
pvAttr->getSubField<PVString>("descriptor")->put(attr->getDescription());
pvAttr->getSubField<PVString>("source")->put(attr->getSource());
NDAttrSource_t sourceType;
attr->getSourceInfo(&sourceType);
pvAttr->getSubField<PVInt>("sourceType")->put(sourceType);
switch(attr->getDataType())
{
case NDAttrInt8: fromAttribute <PVByte, int8_t> (pvAttr, attr); break;
case NDAttrUInt8: fromAttribute <PVUByte, uint8_t> (pvAttr, attr); break;
case NDAttrInt16: fromAttribute <PVShort, int16_t> (pvAttr, attr); break;
case NDAttrUInt16: fromAttribute <PVUShort, uint16_t>(pvAttr, attr); break;
case NDAttrInt32: fromAttribute <PVInt, int32_t> (pvAttr, attr); break;
case NDAttrUInt32: fromAttribute <PVUInt, uint32_t>(pvAttr, attr); break;
case NDAttrFloat32: fromAttribute <PVFloat, float> (pvAttr, attr); break;
case NDAttrFloat64: fromAttribute <PVDouble, double> (pvAttr, attr); break;
case NDAttrString: fromStringAttribute(pvAttr, attr); break;
case NDAttrUndefined: fromUndefinedAttribute(pvAttr); break;
default: throw std::runtime_error("invalid attribute data type");
}
++i;
}
dest->replace(freeze(destVec));
}
示例2: openFile
//.........这里部分代码省略.........
TIFFSetField(this->output, TIFFTAG_MAKE, "Unknown");
}
TIFFSetField(this->output, TIFFTAG_SOFTWARE, "EPICS areaDetector");
int count = 0;
int tagId = TIFFTAG_START_;
numAttributes_ = this->pFileAttributes->count();
asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW,
"%s:%s this->pFileAttributes->count(): %d\n",
driverName, functionName, numAttributes_);
fieldInfo_ = (TIFFFieldInfo**) malloc(numAttributes_ * sizeof(TIFFFieldInfo *));
if (fieldInfo_ == NULL) {
asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR,
"%s:%s error, fieldInfo_ malloc failed. file: %s\n",
driverName, functionName, fileName);
return asynError;
}
for (int i=0; i<numAttributes_; ++i) {
asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW,
"%s:%s Initializing %d fieldInfo_ entry.\n",
driverName, functionName, i);
fieldInfo_[i] = NULL;
}
asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW,
"%s:%s Looping over attributes...\n",
driverName, functionName);
pAttribute = this->pFileAttributes->next(NULL);
while (pAttribute) {
const char *attributeName = pAttribute->getName();
//const char *attributeDescription = pAttribute->getDescription();
const char *attributeSource = pAttribute->getSource();
asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW,
"%s:%s : attribute: %s, source: %s\n",
driverName, functionName, attributeName, attributeSource);
NDAttrDataType_t attrDataType;
size_t attrSize;
NDAttrValue value;
pAttribute->getValueInfo(&attrDataType, &attrSize);
memset(tagString, 0, MAX_ATTRIBUTE_STRING_SIZE);
switch (attrDataType) {
case NDAttrInt8:
case NDAttrUInt8:
case NDAttrInt16:
case NDAttrUInt16:
case NDAttrInt32:
case NDAttrUInt32: {
pAttribute->getValue(attrDataType, &value.i32);
epicsSnprintf(tagString, MAX_ATTRIBUTE_STRING_SIZE, "%s:%d", attributeName, value.i32);
break;
}
case NDAttrFloat32: {
pAttribute->getValue(attrDataType, &value.f32);
epicsSnprintf(tagString, MAX_ATTRIBUTE_STRING_SIZE, "%s:%f", attributeName, value.f32);
break;
}
case NDAttrFloat64: {
pAttribute->getValue(attrDataType, &value.f64);
epicsSnprintf(tagString, MAX_ATTRIBUTE_STRING_SIZE, "%s:%f", attributeName, value.f64);