If the type is unclear for a particular feature some more complex code is needed:
mvIMPACT.acquire.Device pDev = getTheDevicePointerFromSomewhere();
mvIMPACT.acquire.DeviceComponentLocator locator = new mvIMPACT.acquire.DeviceComponentLocator( pDev, TDeviceListType.dltSetting, "Base" );
mvIMPACT.acquire.Component feature = new mvIMPACT.acquire.Component();
locator.bindComponent( feature, "Feature" );
if( feature.isValid() )
{
System.out.println( String.format( "Feature %s is a %s", feature.name(), feature.typeAsString() );
final int featureType = feature.type();
if( featureType == TComponentType.ctPropString )
{
mvIMPACT.acquire.PropertyS stringProp = new mvIMPACT.acquire.PropertyS( feature.hObj() );
doStringPropAction( stringProp );
}
else if( featureType == TComponentType.ctPropInt )
{
mvIMPACT.acquire.PropertyI intProp = new mvIMPACT.acquire.PropertyI( feature.hObj() );
doIntPropAction( intProp );
}
else if( featureType == TComponentType.ctPropInt64 )
{
mvIMPACT.acquire.PropertyI64 longProp = new mvIMPACT.acquire.PropertyI64( feature.hObj() );
doLongPropAction( longProp );
}
else if( featureType == TComponentType.ctPropFloat )
{
mvIMPACT.acquire.PropertyF floatProp = new mvIMPACT.acquire.PropertyF( feature.hObj() );
doFloatPropAction( floatProp );
}
else
{
}
}
else
{
}