本文整理汇总了C++中DataGroupHeader::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ DataGroupHeader::SetName方法的具体用法?C++ DataGroupHeader::SetName怎么用?C++ DataGroupHeader::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataGroupHeader
的用法示例。
在下文中一共展示了DataGroupHeader::SetName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadDataGroupName
/*
* Reads the DataGroup name from the file.
*/
void DataGroupHeaderReader::ReadDataGroupName(std::ifstream& fileStream, DataGroupHeader& dch)
{
//DEBUG
//u_int32_t z = fileStream.tellg();
dch.SetName(FileInput::ReadString16(fileStream));
}
示例2: WriteOutGenericDATDataFileNoGrid
void TestFileGenerator::WriteOutGenericDATDataFileNoGrid()
{
GenericDataHeader gdh;
AddStandardGenericDataHeader(gdh);
// Fill the DataGroupHeader
DataGroupHeader dch;
dch.SetName(L"First Data Cube");
// Fill the DataSetHeader
DataSetHeader dph;
dph.SetName(L"acquired data");
ParameterNameValueType nvt;
nvt.SetName(L"Scanner");
nvt.SetValueText(L"M10");
dph.AddNameValParam(nvt);
nvt.SetName(L"Pixel Size");
nvt.SetValueFloat(0.051f);
dph.AddNameValParam(nvt);
dph.AddColumn(UShortColumn(L"Pixel"));
int32_t rows = 100;
dph.SetRowCnt(rows);
dch.AddDataSetHdr(dph);
// Set the FileHeader
FileHeader fh;
fh.SetFilename("test.file.data_dat");
fh.SetGenericDataHdr(gdh);
fh.AddDataGroupHdr(dch);
// Create the generic file writer
GenericFileWriter gfWriter(&fh);
gfWriter.WriteHeader();
DataGroupWriterIt dcwBegin, dcwEnd;
gfWriter.GetDataGroupWriters(dcwBegin, dcwEnd);
DataGroupWriter d = *dcwBegin;
dcwBegin->WriteHeader();
DataSetWriterIt dpwBegin, dpwEnd;
dcwBegin->GetDataSetWriters(dpwBegin, dpwEnd);
dpwBegin->WriteHeader();
// Write out the data
for( int32_t i=0; i < rows; ++i )
{
u_int16_t value = (u_int16_t)(i*10+i);
dpwBegin->Write(value);
}
dpwBegin->UpdateNextDataSetOffset();
dcwBegin->Close();
}
示例3: FindDataGroupHeaderByNameTest
void FileHeaderTest::FindDataGroupHeaderByNameTest()
{
// Create DataGroupHeaders
DataGroupHeader d;
d.SetName(L"Default");
header->AddDataGroupHdr(d);
const DataGroupHeader* dch = header->FindDataGroupHeader(L"none");
CPPUNIT_ASSERT(0 == dch);
dch = header->FindDataGroupHeader(L"default");
CPPUNIT_ASSERT(0 == dch);
dch = header->FindDataGroupHeader(L"Default");
CPPUNIT_ASSERT(0 != dch);
CPPUNIT_ASSERT(dch->GetName() == L"Default");
}
示例4: WriteOutGenericDataFileWithAllColumnTypes
void TestFileGenerator::WriteOutGenericDataFileWithAllColumnTypes()
{
GenericDataHeader gdh;
AddStandardGenericDataHeader(gdh);
// Fill the DataGroupHeader
DataGroupHeader dch;
dch.SetName(L"default"); // default DataGroup
// Fill the all types DataSetHeader
DataSetHeader dphAT;
dphAT.SetName(L"all types");
ParameterNameValueType nvt;
nvt.SetName(L"How many types");
nvt.SetValueText(L"All types");
dphAT.AddNameValParam(nvt);
nvt.SetName(L"Powered by");
nvt.SetValueText(L"Affymetrix");
dphAT.AddNameValParam(nvt);
dphAT.AddColumn(ByteColumn(L"Byte type"));
dphAT.AddColumn(UByteColumn(L"UByte type"));
dphAT.AddColumn(ASCIIColumn(L"ASCII type", 10));
dphAT.AddColumn(ShortColumn(L"Short type"));
dphAT.AddColumn(UShortColumn(L"UShort type"));
dphAT.AddColumn(IntColumn(L"Int type"));
dphAT.AddColumn(UIntColumn(L"UInt type"));
dphAT.AddColumn(UnicodeColumn(L"Unicode type", 15));
dphAT.AddColumn(FloatColumn(L"Float type"));
int32_t rows = 2;
dphAT.SetRowCnt(rows);
dch.AddDataSetHdr(dphAT);
// Set the FileHeader
FileHeader fh;
fh.SetFilename("test.file.data_all_column_types");
fh.SetGenericDataHdr(gdh);
fh.AddDataGroupHdr(dch);
// Create the generic file writer
GenericFileWriter gfWriter(&fh);
gfWriter.WriteHeader();
DataGroupWriterIt dcwBegin, dcwEnd;
gfWriter.GetDataGroupWriters(dcwBegin, dcwEnd);
DataGroupWriter d = *dcwBegin;
dcwBegin->WriteHeader();
DataSetWriterIt dpwBegin, dpwEnd;
dcwBegin->GetDataSetWriters(dpwBegin, dpwEnd);
// Write out the all types DataSet
dpwBegin->WriteHeader();
for( int32_t row = 0; row < rows; ++row )
{
char str[10];
wchar_t wstr[15];
int8_t b = 1+10*row;
u_int8_t ub = 2+10*row;
sprintf(str, "%d", 3+10*row);
int16_t s = 4+10*row;
u_int16_t us = 5+10*row;
int32_t i = 6+10*row;
u_int32_t ui = 7+10*row;
FormatString1(wstr, 15, L"%d", 8+10*row);
float f = 9+10*row;
dpwBegin->Write(b); // btye
dpwBegin->Write(ub); // unsigned byte
dpwBegin->Write(str, 10); // ACSII string
dpwBegin->Write(s); // short
dpwBegin->Write(us); // unsigned short
dpwBegin->Write(i); // int
dpwBegin->Write(ui); // unsigned int
dpwBegin->Write(wstr, 15); // Unicode string
dpwBegin->Write(f); // float
}
dpwBegin->UpdateNextDataSetOffset();
dcwBegin->Close();
}
示例5: WriteOutGenericDATDataFileWithGrid
void TestFileGenerator::WriteOutGenericDATDataFileWithGrid()
{
GenericDataHeader gdh;
AddStandardGenericDataHeader(gdh);
// Fill the DataGroupHeader
DataGroupHeader dch;
dch.SetName(L""); // unnamed DataGroup
// Fill the pixel intensity DataSetHeader
DataSetHeader dphPixel;
dphPixel.SetName(L"acquired data");
ParameterNameValueType nvt;
nvt.SetName(L"Scanner");
nvt.SetValueText(L"M10");
dphPixel.AddNameValParam(nvt);
nvt.SetName(L"Pixel Size");
nvt.SetValueFloat(0.051f);
dphPixel.AddNameValParam(nvt);
dphPixel.AddColumn(UShortColumn(L"Pixel"));
int32_t rows = 1000;
dphPixel.SetRowCnt(rows);
dch.AddDataSetHdr(dphPixel);
// Fill the grid DataSetHeader
DataSetHeader dphGrid;
dphGrid.SetName(L"grid position");
nvt.SetName(L"GhostGrids");
nvt.SetValueText(L"True");
dphGrid.AddNameValParam(nvt);
nvt.SetName(L"Pixel Size");
nvt.SetValueFloat(0.051f);
dphGrid.AddNameValParam(nvt);
dphGrid.AddColumn(FloatColumn(L"Upper left x"));
dphGrid.AddColumn(FloatColumn(L"Upper left y"));
dphGrid.AddColumn(FloatColumn(L"Upper right x"));
dphGrid.AddColumn(FloatColumn(L"Upper right y"));
dphGrid.AddColumn(FloatColumn(L"Lower right x"));
dphGrid.AddColumn(FloatColumn(L"Lower right y"));
dphGrid.AddColumn(FloatColumn(L"Lower left x"));
dphGrid.AddColumn(FloatColumn(L"Lower left y"));
int32_t grids = 5; // first is the global grid with 4 subgrids
dphGrid.SetRowCnt(grids);
dch.AddDataSetHdr(dphGrid);
// Set the FileHeader
FileHeader fh;
fh.SetFilename("test.file.data_dat_with_grid");
fh.SetGenericDataHdr(gdh);
fh.AddDataGroupHdr(dch);
// Create the generic file writer
GenericFileWriter gfWriter(&fh);
gfWriter.WriteHeader();
DataGroupWriterIt dcwBegin, dcwEnd;
gfWriter.GetDataGroupWriters(dcwBegin, dcwEnd);
DataGroupWriter d = *dcwBegin;
dcwBegin->WriteHeader();
DataSetWriterIt dpwBegin, dpwEnd;
dcwBegin->GetDataSetWriters(dpwBegin, dpwEnd);
// Write out the pixel DataSet
dpwBegin->WriteHeader();
for( int32_t i=0; i < rows; ++i )
{
u_int16_t value = (u_int16_t)(i*10+i);
dpwBegin->Write(value);
}
dpwBegin->UpdateNextDataSetOffset();
++dpwBegin;
// Write out the grid DataSet
dpwBegin->WriteHeader();
for( int32_t i=0; i < grids; ++i )
{
for (int32_t corner = 0; corner < 4; ++corner)
{
float value = (float)(i*100 + corner);
dpwBegin->Write(value);
dpwBegin->Write(value);
}
}
dpwBegin->UpdateNextDataSetOffset();
//.........这里部分代码省略.........