CreateChunkFeature
Top  Previous  Next

Description

Creates a GenICam feature associated with the chunk data field.

[C++]
int
 CreateChunkFeature (unsigned int chunkId, const char* name , const char* category ,
   unsigned short
 type, unsigned int length, const char* description = NULL);


Parameters
[C/C++]

[in] unsigned int chunkID  
Integer value specifying the numerical ID of the chunk.  
 
[in] const char* name  
Name of the data field in the chunk. Must not be NULL or empty.  
 
[in] const char* category  
Parent chunk category under which the chunk feature will be created. The category must be created by a prior call to CreateChunkCategory.  
 
[in] unsigned short type  
Type of the feature to be created. Can be one of the following values:  
FEATURE_TYPE_UINTEGER - unsigned 32-bit integer feature, maps to a slider with value, minimum, maximum and increment  
FEATURE_TYPE_INTEGER - signed 32-bit integer feature, maps to a slider with value, min, maximum, increment and physical unit  
FEATURE_TYPE_INTEGER64 - signed 62-bit integer feature, maps to a slider with value, min, maximum, increment and physical unit  
FEATURE_TYPE_FLOAT - floating point 32-bit feature, maps to a slider with value, minimum, maximum and physical unit  
FEATURE_TYPE_STRING - string feature, maps to an edit box showing a string of text  
FEATURE_TYPE_BOOLEAN - boolean feature, maps to a check box  
FEATURE_TYPE_ENUMERATION - enumeration feature, maps to dropdown box with a list of selectable items  
 
unsigned int length  
[in] Integer value specifying the length (in bytes) of the data field associated with the chunk feature.  
 
const char* description  
[in] String containing the description of the feature.  
 

Return Values

S_OK  
Success  
E_FAIL  
Failure  
E_NOINTERFACE  
Category does not exist  
E_INVALIDARG  
Wrong feature type  
 
 
Example

This fragment of code creates the "OffsetY" chunk feature:

m_pCamera->CreateChunkFeature (0xa8dc50e0, "ChunkOffsetY", "ChunkDataControl", FEATURE_TYPE_INTEGER, 4, "Vertical offset");  
 
As a result, the following code will be added to the XML file:

    <Enumeration Name="ChunkSelector" NameSpace="Standard">
<EnumEntry Name="ChunkOffsetY">
<Value>0</Value>
</EnumEntry>
<pValue>regChunkSelector</pValue>
</Enumeration>

<Integer Name="ChunkOffsetY" NameSpace="Standard">
<Description>Vertical offset </Description>
<pValue>regChunkOffsetY</pValue>
<Min>0</Min>
<Max>4294967295</Max>
</Integer>

<IntReg Name="regChunkOffsetY" NameSpace="Custom">
<Address>0x0</Address>
<Length>4</Length>
<AccessMode>RO</AccessMode>
<pPort>ChunkOffsetYPort</pPort>
<Cachable>NoCache</Cachable>
<Sign>Unsigned</Sign>
<Endianess>BigEndian</Endianess>
</IntReg>

<Port Name="ChunkOffsetYPort">
<ChunkID>a8dc50e0</ChunkID>
</Port>


Remarks

This method is used in conjunction with CreateChunkCategory to automate the process of adding GenICam compliant chunk features to the virtual camera. Per GenICam standard, each chunk data field included in a frame should be associated with a feature grouped under the chunk category. In the example above a single call to CreateChunkFeature creates the ChunkOffsetY feature, maps it to a virtual port and adds a corresponding entry into the ChunkSelector feature.

Note that this method does not insert chunk data into frame buffers, but only adds chunk-related members to the camera's XML file. To add chunk data to a frame buffer, use AddChunkData.

The camera must be in the disconnected state in order for this method to work.