MATLAB IMAGE ACQUISITION TOOLBOX - RELEASE NOTES Guide de l'utilisateur Page 117

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 172
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 116
Creating Device Properties
6-5
Creating Device Properties
To define properties for a device, follow this procedure:
1
Create the property using the appropriate IPropFactory member function for
the data type. The engine passes in a handle to a IPropFactory object to the
getDeviceAttributes() function.
For example, to create a property of type double, use the
createDoubleProperty() method of the IPropFactory object, specifying the
property name and default value as arguments.
hprop = devicePropFact->createDoubleProperty("Brightness",100)
The IPropFactory class supports functions to create properties of various data
types — see “Selecting the Property Creation Function” on page 6-5.
2
Specify if a user can modify the property, using the setPropReadOnly()
method of the IPropFactory object. Use one of the following constants
(defined in IEngine.h): READONLY_ALWAYS, READONLY_NEVER, and
READONLY_WHILE_RUNNING. For example,
devicePropFact->setPropReadOnly(hProp,
imaqkit::propreadonly::READONLY_WHILE_RUNNING);
3
Add the property to the device-specific property container, using the
addProperty() method of the IPropFactory object. For example,
devicePropFact->addProperty(hProp);
where hProp is a handle to the property you created in step 1.
Selecting the Property Creation Function
The IPropFactory() object supports functions that you can use to create properties of
various data types, including:
int
double
string
Enumerated types
Vue de la page 116
1 2 ... 112 113 114 115 116 117 118 119 120 121 122 ... 171 172

Commentaires sur ces manuels

Pas de commentaire