Impact Acquire SDK Java
Locating Properties

To bind a mvIMPACT.acquire.Property object to a certain feature offered by the device at runtime the interface can be used in several ways. One possibility is to use a mvIMPACT.acquire.DeviceComponentLocator object. Let's assume an application wants to access a 64 bit integer property that is called Width and is located somewhere in the devices feature tree. In this case, we want to bind the property of the base setting. The code to bind the device feature to an object would look more or less like this:

mvIMPACT.acquire.Device pDev = getTheDevicePointerFromSomewhere();
mvIMPACT.acquire.PropertyI64 width = new mvIMPACT.acquire.PropertyI64();
// create a locator object to find a certain feature
mvIMPACT.acquire.DeviceComponentLocator locator = new mvIMPACT.acquire.DeviceComponentLocator( pDev, TDeviceListType.dltSetting, "Base" );
// find the feature and bind it to the property object
locator.bindComponent( width, "Width" );
// now the property is ready to use when available:
if( width.isValid() )
{
width.write( width.read( TPropertyLimit.plMaxValue ) / 2 ); // set the width to half of its maximum value
}
else
{
// oops... The feature is not offered by this device
}