PDA

View Full Version : CLI device setup



nikkadim
September 5, 2012, 19:15:39
Is it possible tro setup device without setupDeviceFromFile method? I need to create a server which can able to enumerate all connected cameras without manual setup and manage them, is it possible?

Thank you.

Stefan Geissler
September 6, 2012, 10:43:30
Hello,

Of course this is possible. Please look at: http://www.imagingcontrol.com/en_US/library/cpp/
Also you may look in the documentation of IC Imaging Control Classlibrary installed on your computer or at: http://www.imagingcontrol.com/en_US/support/documentation/

nikkadim
September 6, 2012, 17:41:15
Thank you.
Could you please explain, why when I tried to get the Gain value like this pGainRange->getValue() I got the exception in this function?

Camera: 72BUC02


bool SetGainAbsolute( DShowLib::Grabber *pGrabber, double dGain )
{
bool bOK = false;
DShowLib::tIVCDAbsoluteValuePropertyPtr pGainRange;
pGainRange = NULL;

tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
if( pItems != 0 )
{
// Try to find the exposure item.
tIVCDPropertyItemPtr pGainItem = pItems->findItem( VCDID_Gain );
if( pGainItem != 0 )
{
// Try to find the value and auto elements
tIVCDPropertyElementPtr pGainValueElement = pGainItem->findElement( VCDElement_Value );


// If a value element exists, try to acquire a range interface
if( pGainValueElement != 0 )
{
pGainValueElement->getInterfacePtr( pGainRange );

//double min = pGainRange->getValue();
//double min = pGainRange->getRangeMin();
//double max = pGainRange->getRangeMax();
/*printf("Gain min=%f\n", min);

if ( dGain < min )
{
dGain = min;
}
else if( dGain > max )
{
dGain = max;
}
*/
// Here we set the the exposure value.
//pGainRange->setValue( dGain);
bOK = true;
}
}
}
return bOK;
}

Stefan Geissler
September 6, 2012, 17:50:01
Hi

The camera has no AbsoluteValues for Gain. It has a range only. Also it may is a good idea to check for "pGainRange" not being null, before using it. Not all properties are AbsoluteValues properties. Usually its Exposure only, that supports this.