本文整理汇总了C++中ParameterNameValueType::GetValueUInt16方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterNameValueType::GetValueUInt16方法的具体用法?C++ ParameterNameValueType::GetValueUInt16怎么用?C++ ParameterNameValueType::GetValueUInt16使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterNameValueType
的用法示例。
在下文中一共展示了ParameterNameValueType::GetValueUInt16方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDatHeader
/*
* Get the DAT header from the DAT file header object.
*/
string CELConversionUtilities::GetDatHeader(CelFileData &inFile)
{
std::wstring datHeader;
GenDataHdrVectorIt begin, end;
inFile.GetFileHeader()->GetGenericDataHdr()->GetParentIterators(begin, end);
// Find the DAT generic header
for (GenDataHdrVectorIt ii = begin; ii != end; ++ii)
{
std::string s = ii->GetFileTypeId();
if (ii->GetFileTypeId() == SCAN_ACQUISITION_DATA_TYPE)
{
// found the right header, now look for the parameter
ParameterNameValueType nvt;
if (ii->FindNameValParam(DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
datHeader = nvt.GetValueText();
}
else if (ii->FindNameValParam(PARTIAL_DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
{
std::wstring partialDatHeader = nvt.GetValueText();
u_int16_t min = 0;
u_int16_t max = 0;
// Find the max and min parameters and append to the string.
if (ii->FindNameValParam(MAX_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
max = nvt.GetValueUInt16();
}
if (ii->FindNameValParam(MIN_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
min = nvt.GetValueUInt16();
}
wchar_t buf[30];
FormatString2(buf, 30, L"[%d..%d]", min, max);
datHeader = buf;
datHeader += partialDatHeader;
}
}
break;
}
}
return StringUtils::ConvertWCSToMBS(datHeader);
}
示例2: GetDatHeader
std::wstring CalvinCELDataAdapter::GetDatHeader()
{
std::wstring datHeader;
//GenDataHdrVectorIt begin, end;
GenericDataHeader* gdh = calvinCel.GetFileHeader()->GetGenericDataHdr()->FindParent(SCAN_ACQUISITION_DATA_TYPE);
if (gdh)
{
// found the right header, now look for the parameter
ParameterNameValueType nvt;
if (gdh->FindNameValParam(DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
datHeader = nvt.GetValueText();
}
else if (gdh->FindNameValParam(PARTIAL_DAT_HEADER_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::TextType)
{
std::wstring partialDatHeader = nvt.GetValueText();
u_int16_t min = 0;
u_int16_t max = 0;
// Find the max and min parameters and append to the string.
if (gdh->FindNameValParam(MAX_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
max = nvt.GetValueUInt16();
}
if (gdh->FindNameValParam(MIN_PIXEL_INTENSITY_PARAM_NAME, nvt))
{
if (nvt.GetParameterType() == ParameterNameValueType::UInt16Type)
min = nvt.GetValueUInt16();
}
wchar_t buf[30]=L"";
FormatString2(buf, 30, L"[%d..%d]", min, max);
datHeader = buf;
datHeader += partialDatHeader;
}
}
}
return datHeader;
}
示例3: GetCellMargin
int CalvinCELDataAdapter::GetCellMargin()
{
ParameterNameValueType nvt;
if (calvinCel.FindAlgorithmParameter(CELLMARGIN_PARAM_NAME, nvt))
{
switch(nvt.GetParameterType())
{
case ParameterNameValueType::Int32Type:
return nvt.GetValueInt32();
break;
case ParameterNameValueType::Int16Type:
return (int)nvt.GetValueInt16();
break;
case ParameterNameValueType::Int8Type:
return (int)nvt.GetValueInt8();
break;
case ParameterNameValueType::UInt32Type:
return (int)nvt.GetValueUInt32();
break;
case ParameterNameValueType::UInt16Type:
return (int)nvt.GetValueUInt16();
break;
case ParameterNameValueType::UInt8Type:
return (int)nvt.GetValueUInt8();
break;
case ParameterNameValueType::AsciiType:
return (int)atoi(nvt.GetValueAscii().c_str());
default:
return 0;
break;
}
}
else
{
return 0;
}
}