PDA

View Full Version : gain: discrepancy between GUI and API



UweAndersen
January 18, 2017, 14:07:33
Hello !

After I set the gain value via the "Filter Inspector" I read back that value via an API call.
But the value I read is always '100'.

This is only true for VCDID_Gain. The other properties like e.g. VCDID_Saturation or VCDID_Exposure behave like expected.

This is my code for reading the values:


val = m_VCDProp->getValue(g);

with m_VCDProp being a CSimplePropertyAccess object;

Can you explain what I'm doing wrong?

Best regards,
Uwe Andersen

Stefan Geissler
January 18, 2017, 17:48:35
There seems to be a driver error. You may try the absolute values interface instead, this works as expected:



double Get_Gain_Value_Value(Grabber* pGrabber)
{
if( pGrabber->isDevValid() )
{
tIVCDAbsoluteValuePropertyPtr pAbsValItf;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
pItems->findInterfacePtr(VCDID_Gain, VCDElement_Value ,pAbsValItf);

if( pAbsValItf != NULL )
{
return pAbsValItf->getValue();
}
}

return 0.0;
}

void Set_Gain_Value_Value(Grabber* pGrabber, double Value)
{
if( pGrabber->isDevValid() )
{
tIVCDAbsoluteValuePropertyPtr pAbsValItf;
tIVCDPropertyItemsPtr pItems = pGrabber->getAvailableVCDProperties();
pItems->findInterfacePtr(VCDID_Gain, VCDElement_Value ,pAbsValItf);

if( pAbsValItf != NULL )
{
pAbsValItf->setValue(Value);
}
}
}

UweAndersen
January 19, 2017, 10:11:43
Yes, it does!

Thank you, Stefan!