PDA

View Full Version : New IC Imaging Control 3.0 and IVCDAbsoluteValueProperty.getAvailable



jdbethun
December 1, 2005, 21:40:36
Hey guys,

I've recently upgraded to IC Control 3.0, Newest driver for the DFK31BF03, and IC Capture 2.0. Since you've now deprecated a lot of the previous FrameGrabberSink, and the way to snap images, I've started changing the code now. I finally got it *sorta* working again with the new FrameHandlerSink by using this line during setup:

m_pGrabber->setOverlayBitmapPathPosition( ePP_NONE );

Without this line it was crashing on startLive complaining about there being no frame filter or something. It could be just me, but I didn't find the need for this call very clear in the documentation, so I've included it just in case others had similar problems.

My new problem that I can't seem to shake is that the AbsoluteValue interface is now never available through the getAvailable(). It finds the interface no problem but the getAvailable call always returns false. This was working with the previous version of the control, and now I can't get it to work.

Any help would be much appreciated.

Here's the relevant code:



HRESULT setProperty(GUID property, double value){
tIVCDAbsoluteValuePropertyPtr pAbsVal = 0;
tIVCDPropertyItemsPtr pItems = m_pGrabber->getAvailableVCDProperties();

//now get a pointer to that interface
if( pItems->findInterfacePtr( property, VCDElement_Value, pAbsVal ) != 0 ){
bool avail = pAbsVal->getAvailable();
bool readOnly = pAbsVal->getReadOnly();
if( avail && !readOnly ){

std::string dimType = pAbsVal->getDimType();
IVCDAbsoluteValueProperty::tAbsDimFunction dimFunction = pAbsVal->getDimFunction();
double rangeMin = pAbsVal->getRangeMin();
double rangeMax = pAbsVal->getRangeMax();
//Make sure within limits otherwise use that limit
if(value <= rangeMax && value >= rangeMin) {
pAbsVal->setValue(value);
}
else if (value < rangeMin){
pAbsVal->setValue(rangeMin);
}
else {
pAbsVal->setValue(rangeMax);
}

_tprintf("Property set to: %e \n", pAbsVal->getValue());
}
}
}

Stefan Geissler
December 2, 2005, 12:41:11
Hello,

I tested your code and at first i got the same problem. I solved it by removing the driver for my camera in the device manager. Then i disconnected and reconnected the camera and installed the driver again. It worked, so i got all exposure interfaces back. You may use the VCD Property Inspector of IC Imaging Control to check, whether all interfaces are available.

jdbethun
December 2, 2005, 20:12:38
I tried the driver removal as you suggested and still no dice. What is interesting is the VCD Property Inspector shows that the AbsoluteValue interface is there, but I can't move the slider for that interface at all. There are several other properties that I can't move the sliders either (gain,white balance). Then there are some that I can (hue, brightness, saturation, auto reference parameter). But then I can move the immovable properties in the device properties page. I'm not sure of the usual operation of the Inspector, as I haven't touched it before, but I'm assuming since I can't move the exposure slider for the Absolute Value interface, then that interface is "not available", but "found" to use the VCDProperty terminology.

-Jeff

jdbethun
December 2, 2005, 20:39:58
As a follow up to my own post: it seems like the auto had been set on the exposure and thus, the Absolute Value interface was never available. I had code that prevented this from happening, but it appears with the new version of the control the following line no longer works:



bool autoExpose = m_pGrabber->setProperty(CameraControl_Exposure,false);


When I try to force the auto to false with this, the call fails to set the auto property to false.

Anyways, thanks for your help, now I'll just find another way to ensure the auto is set to off.


Regards,
Jeff

Stefan Geissler
December 5, 2005, 08:14:15
Jeff,

You are right, we found that there is a problem with the old style auto properties of the control. We are still working on this issue.