User`s guide

6 Defining Device-Specific Properties
6-6
For example, use the createDoubleProperty() function to create a property whose
value is of type double.
hprop = devicePropFact->createDoubleProperty("MyDoubleProp",2.5)
For the int and double types, you can also specify properties that have pairs of values
or values within a defined range. For example, this code creates an integer property with
upper and lower bounds.
hprop = devicePropFact->createIntProperty("MyBoundedIntProp",
0,100,50)
To create a property with enumerated values, use createEnumProperty(), specifying
the property name, and one enumeration, for example,
hprop = devicePropFact->createEnumProperty("MyEnum",
"green",1)
You then add additional properties using addEnumValue().
For more information about the IPropFactory class, see the Image Acquisition Toolbox
Adaptor Kit API Reference documentation.
Creating Property Help
You can use IMDF files to define help text for the device-specific properties you create.
For more information, see “Specifying Help in an IMDF File” on page 7-5.
Example getDeviceAttributes() Function
The following example presents a skeletal implementation of a
getDeviceAttributes() function. The intent of this example is to show how to use
adaptor kit objects to specify video sources and properties of various types.
This code does not read source, property, or trigger information from an IMDF file. For
information about this topic, see “Using the IMDF Markup Language” on page 7-2.
1
Add the following code to the getDeviceAttributes() function in the adaptor.
You created a skeletal version of this function in “Identifying Video Sources” on page
4-9. This code creates several properties of various types.
void* hProp; // Declare a handle to a property object.