SetEnumElement
Top  Previous  Next

Description

Creates and/or sets an element associated with an entry in the enumeration feature.

[C++]
int
 SetEnumElement(const char* feature, const char* enumName, const char* element, const char* value, bool forceNew = false);


Parameters
[C/C++]

[in] const char* feature  
Name of the enumerated feature. to assign the element to.  
 
[in] const char* enumName  
Name of the entry to assign the element to.  
 
[in] const char* element  
Name of the element.  
 
[in] const char* value  
String representing the value of the element.  
 
[in] bool* forceNew  
This parameter should be used only if the element with the same name already exists. If TRUE, the new element will be created regardless. If FALSE, the method will not create a new element, but will only modify the value of the existing element.  


Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_NOINTERFACE  
Feature does not exist  
 

Example


The following fragment of code creates an enumerated feature with several entries and sets up associated elements:  
 
m_pCamera->CreateFeature(FEATURE_TYPE_ENUMERATION, "LineSource", "DigitalControl", REG_ACCESS_RW);  
m_pCamera->SetFeatureDescription("LineSource""Selects output signal on digital line");  
m_pCamera->AddEnumEntry("LineSource", "AcquisitionTrigger",0);  
m_pCamera->AddEnumEntry("LineSource", "UserOutput",1);  
m_pCamera->SetFeatureElement("LineSource", "Streamable", "Yes", true);  
m_pCamera->SetEnumElement("LineSource", "AcquisitionTrigger", "Description", "Line source is acquisition trigger", true);  
m_pCamera->SetEnumElement("LineSource", "UserOutput", "Description", "Line source is user output", true);  
m_pCamera->SetEnumElement("LineSource", "AcquisitionTrigger", "pIsAvailable", "TriggerMode", true);  
 
As a result, the following feature description will appear in the camera XML file:
   
<Emumeration Name="LineSourceNameSpace="Standard">  
<Description>Selects output signal on digital line</Description>  
<pStreamable>Yes</pStreamable>  
   <
EnumEntry Name
="AcquisitionTrigger" NameSpace
="Standard">

        <
Description
>Line source is acquisition trigger</
Description
>
     <
pIsAvailable
>TriggerMode</
pIsAvailable
>

        <
Value
>
0</
Value
>

      <
/EnumEntry>
   
<EnumEntry Name="UserOutput" NameSpace="Standard">
        <
Description>Line source is user output</Description>
     <
Value>1</Value>
      <
/EnumEntry>
     <
Value>regLineSource</Value>  
</Enumeration>  
     

Remarks

This method allows you to directly program an XML-file linked to the virtual camera object. An element is part of the XML-file encapsulated between a starting and ending tag. In the example above those elements are Streamable, Description and pIsAvailable.

Elements can contain one or several attributes. See CreateElementAttribute for more details.

The use of this method requires an advanced knowledge of the GenICam standard and XML syntax. For more information please refer to the description of the GenICam standard available at www.genicam.org
.

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