PDA

View Full Version : Use VCDproperties to enable/disable external trigger



yonge_wil
January 2, 2014, 09:48:40
Hi,
I'd like to know how to Use VCDproperties to enable/disable external trigger.
We use snap mode to capture image together with onfreamready(), we should enable or disable external trigger as needed, but it fails sometime(stoplive--setexternaltrigger--startlive). From another post I noticed I can set external trigger use VCDProperties, and I succeeded to get the triggerpolarity to work, but failed to set trigger mode. What should I do?

tIVCDSwitchPropertyPtr pTriggerPolarity;
tIVCDPropertyItemsPtr pItems = grabber.getAvailableVCDProperties();
if( pItems != 0 )
{
tIVCDPropertyItemPtr pTriggerItem = pItems->findItem( VCDID_Trigger );
if( pTriggerItem != NULL)
{
tIVCDPropertyElementPtr pModeValueElement1 = pTriggerItem->findElement( VCDElement_TriggerMode );
tIVCDPropertyElementPtr pModeValueElement = pTriggerItem->findElement( VCDElement_TriggerPolarity );


if( pModeValueElement != NULL )
{
pModeValueElement->getInterfacePtr(pTriggerPolarity);
bool isenable = pTriggerPolarity->getSwitch();
pTriggerPolarity->setSwitch(!isenable);
}
}
}

pModeValueElement1 is 0x0000000 all the time.

DMK31BU03

Stefan Geissler
January 6, 2014, 12:23:55
Hello

It should work as follows


tIVCDSwitchPropertyPtr pTriggerPolarity;
tIVCDPropertyItemsPtr pItems = grabber.getAvailableVCDProperties();
if( pItems != 0 )
{
tIVCDPropertyItemPtr pTriggerItem = pItems->findItem( VCDID_TriggerMode );
if( pTriggerItem != NULL)
{
tIVCDPropertyElementPtr pModeValueElement1 = pTriggerItem->findElement( VCDElement_Value );
tIVCDPropertyElementPtr pModeValueElement = pTriggerItem->findElement( VCDElement_TriggerPolarity );


if( pModeValueElement != NULL )
{
pModeValueElement->getInterfacePtr(pTriggerPolarity);
bool isenable = pModeValueElement->getSwitch();
pModeValueElement->setSwitch(!isenable);
}
}
}