27 #pragma warning(disable:4996) 29 #pragma warning(default:4996) 65 LOG_FREE_TEXT( std::string(
"Could not get feature by name for ") + name);
68 res =
SP_ACCESS(pFeature)->GetValue( val );
71 LOG_FREE_TEXT( std::string(
"Could not get value of feature ") + name);
96 LOG_FREE_TEXT( std::string(
"Could not get feature by name for ") + name);
102 LOG_FREE_TEXT( std::string(
"Could not run feature command ") + name);
140 if( PayloadSize <= 0)
149 Result =
SP_ACCESS( pFrame) ->GetBufferSize(buffer_size);
155 if( buffer_size >= PayloadSize)
206 nFramesAnnounced = 0;
207 for(
VmbUint32_t FrameNumber= 0; FrameNumber < nFrameCount; ++FrameNumber)
219 std::stringstream strMsg(
"Could only successfully announce ");
220 strMsg << nFramesAnnounced <<
" of " << nFrameCount <<
" frames. Will continue with queuing those.";
226 Result = LocalResult;
247 Frames.reserve( nBufferCount);
261 LocalResult =
SP_ACCESS( tmpFrame)->RegisterObserver( Observer );
267 Frames.push_back( tmpFrame );
285 Result = LocalResult;
355 if( NULL == pFrames || 0 == nFrameCount)
362 Result =
AnnounceFrames( m_Camera, pFrames, nFrameCount, nPayloadSize, FramesAnnounced);
363 if( 0 == FramesAnnounced)
375 for(
VmbUint32_t FrameNumber = 0; FrameNumber < FramesAnnounced; ++FrameNumber)
377 Result = m_Camera.
QueueFrame( pFrames[ FrameNumber ] );
380 std::stringstream strMsg(
"Could only successfully queue ");
381 strMsg << nFramesQueued <<
" of " << nFrameCount <<
" frames. Will continue with filling those.";
390 if( 0 == nFramesQueued)
415 while( ! m_Tasks.empty() )
500 const char *pSerialNumber,
501 const char *pInterfaceID,
503 : m_pImpl( new
Impl() )
504 , m_persistType( -1 )
505 , m_maxIterations( -1 )
506 , m_loggingLevel( -1 )
584 if ( NULL == pStrID )
608 if ( NULL == pStrName )
632 if ( NULL == pStrModel )
656 if ( NULL == pStrSerial )
680 if ( NULL == pStrInterfaceID )
760 res = AcquireHelper.
Prepare( rFrame, PayloadSize );
801 if ( NULL != pNumFramesCompleted )
803 *pNumFramesCompleted = 0;
814 res = AquireHelper.
Prepare( pFrames, nSize, nPayloadSize, nFramesQueued);
818 for (
VmbUint32_t nFrameCount = 0; nFrameCount <nFramesQueued; ++ nFrameCount )
823 std::stringstream strMsg(
"Could only successfully fill ");
824 strMsg << nFrameCount-1 <<
" of " << nSize <<
" frames. Will stop acquisition now.";
828 else if ( NULL != pNumFramesCompleted )
830 ++(*pNumFramesCompleted);
870 for (
size_t FrameNumber = 0; FrameNumber < Frames.size(); ++ FrameNumber )
886 if( 0 != FramesQueued)
954 LOG_FREE_TEXT(
"Could not stop capture, unable to revoke frames")
986 SP_ACCESS( frame )->m_pImpl->m_bAlreadyAnnounced =
true;
997 LOG_FREE_TEXT(
"Could not lock announced frame queue for appending frame." );
1024 if (
true ==
SP_ACCESS(( *iter ))->EnterWriteLock(
true ))
1029 SP_ACCESS( frame )->m_pImpl->m_bAlreadyQueued =
false;
1030 SP_ACCESS( frame )->m_pImpl->m_bAlreadyAnnounced =
false;
1051 LOG_FREE_TEXT(
"Could not lock announced frame queue for removing frame." );
1080 if (
true ==
SP_ACCESS(( *iter ))->EnterWriteLock(
true ))
1118 LOG_FREE_TEXT(
"Queuing of new frames is not possible while flushing and revoking the currently queued frames." );
1134 SP_ACCESS( frame )->m_pImpl->m_bAlreadyQueued =
true;
1141 LOG_FREE_TEXT(
"Could not lock frame queue for appending frame." );
1163 if (
true ==
SP_ACCESS(( *iter ))->EnterWriteLock(
true ))
1225 m_frameHandlers.Vector.push_back( pFH );
1257 if( NULL == pStrFileName )
1265 if( NULL == pSettings )
1300 if( NULL == pStrFileName )
1308 if( NULL == pSettings )
1342 if(
false == ((0 < maxIterations) && (6 > maxIterations)) )
1351 if(
false == ((0 < loggingLevel) && (5 > loggingLevel)) )
virtual IMEXPORT VmbErrorType Close()
virtual IMEXPORT ~Camera()
IMEXPORT VmbErrorType GetFeatureByName(const char *pName, FeaturePtr &pFeature)
IMEXPORT VmbErrorType AcquireSingleImage(FramePtr &pFrame, VmbUint32_t timeout)
bool EnterWriteLock(BasicLockable &rLockable, bool bExclusive=false)
NetPointer< Frame, AVT::VmbAPINET::Frame > FramePtr
IMEXPORTC VmbError_t VMB_CALL VmbRegistersWrite(const VmbHandle_t handle, VmbUint32_t writeCount, const VmbUint64_t *pAddressArray, const VmbUint64_t *pDataArray, VmbUint32_t *pNumCompleteWrites)
VmbHandle_t GetHandle() const
IMEXPORTC VmbError_t VMB_CALL VmbCaptureFrameQueue(const VmbHandle_t cameraHandle, const VmbFrame_t *pFrame, VmbFrameCallback callback)
VmbUint32_t VmbAccessMode_t
ConditionHelper m_conditionHelper
IMEXPORTC VmbError_t VMB_CALL VmbRegistersRead(const VmbHandle_t handle, VmbUint32_t readCount, const VmbUint64_t *pAddressArray, VmbUint64_t *pDataArray, VmbUint32_t *pNumCompleteReads)
VmbInterfaceType m_eInterfaceType
IMEXPORTC VmbError_t VMB_CALL VmbMemoryRead(const VmbHandle_t handle, VmbUint64_t address, VmbUint32_t bufferSize, char *dataBuffer, VmbUint32_t *pSizeComplete)
IMEXPORTC VmbError_t VMB_CALL VmbCameraClose(const VmbHandle_t cameraHandle)
IMEXPORTC VmbError_t VMB_CALL VmbCaptureStart(const VmbHandle_t cameraHandle)
const AcquireImageHelper & operator=(const AcquireImageHelper &o)
virtual VmbErrorType ReadRegisters(const Uint64Vector &addresses, Uint64Vector &buffer) const
virtual IMEXPORT VmbErrorType Open(VmbAccessModeType accessMode)
static VmbErrorType AnnounceFrames(Camera &Camera, FramePtrVector &Frames, VmbUint32_t nBufferCount, VmbInt64_t nPayloadSize, const IFrameObserverPtr &Observer)
AcquireImageHelper(Camera &Cam)
VmbAccessMode_t permittedAccess
char const *const AVT_IP_OR_MAC_ADDRESS
static void VMB_CALL FrameDoneCallback(const VmbHandle_t handle, VmbFrame_t *pFrame)
struct AVT::VmbAPI::Camera::Impl::CameraInfo m_cameraInfo
IMEXPORTC VmbError_t VMB_CALL VmbCaptureFrameWait(const VmbHandle_t cameraHandle, const VmbFrame_t *pFrame, VmbUint32_t timeout)
IMEXPORTC VmbError_t VMB_CALL VmbCameraSettingsSave(const VmbHandle_t handle, const char *fileName, VmbFeaturePersistSettings_t *pSettings, VmbUint32_t sizeofSettings)
VmbErrorType GetID(std::string &cameraID) const
VmbErrorType LoadCameraSettings(std::string fileName, VmbFeaturePersistSettings_t *pSettings=0) const
void ExitWriteLock(BasicLockable &rLockable)
void Protect(MutexPtr pMutex)
virtual VmbErrorType WriteMemory(const VmbUint64_t &address, const UcharVector &buffer)
VmbErrorType GetSerialNumber(std::string &serialNumber) const
VmbUint32_t m_maxIterations
#define LOG_FREE_TEXT(txt)
IMEXPORTC VmbError_t VMB_CALL VmbFrameRevokeAll(const VmbHandle_t cameraHandle)
IMEXPORT void LoadSaveSettingsSetup(VmbFeaturePersist_t persistType, VmbUint32_t maxIterations, VmbUint32_t loggingLevel)
static VmbErrorType SetupFrame(FramePtr &pFrame, VmbInt64_t PayloadSize)
IMEXPORTC VmbError_t VMB_CALL VmbCameraInfoQuery(const char *idString, VmbCameraInfo_t *pInfo, VmbUint32_t sizeofCameraInfo)
NetPointer< Feature, AVT::VmbAPINET::Feature > FeaturePtr
IMEXPORT VmbErrorType GetPermittedAccess(VmbAccessModeType &permittedAccess) const
VmbErrorType SaveCameraSettings(std::string fileName, VmbFeaturePersistSettings_t *pSettings=0) const
std::string interfaceIdString
Camera & operator=(const Camera &)
IMEXPORTC VmbError_t VMB_CALL VmbFrameAnnounce(const VmbHandle_t cameraHandle, const VmbFrame_t *pFrame, VmbUint32_t sizeofFrame)
LockableVector< FrameHandlerPtr > m_frameHandlers
MutexPtr m_pQueueFrameMutex
unsigned long long VmbUint64_t
std::vector< FramePtr > FramePtrVector
VmbErrorType AcquireMultipleImages(FramePtrVector &frames, VmbUint32_t timeout)
IMEXPORTC VmbError_t VMB_CALL VmbMemoryWrite(const VmbHandle_t handle, VmbUint64_t address, VmbUint32_t bufferSize, const char *dataBuffer, VmbUint32_t *pSizeComplete)
VmbErrorType Prepare(FramePtr &pFrame, VmbInt64_t PayloadSize)
std::string cameraIdString
IMEXPORT VmbErrorType FlushQueue()
IMEXPORTC VmbError_t VMB_CALL VmbFrameRevoke(const VmbHandle_t cameraHandle, const VmbFrame_t *pFrame)
#define SP_SET(sp, rawPtr)
VmbErrorType Prepare(FramePtr *pFrames, VmbUint32_t nFrameCount, VmbInt64_t nPayloadSize, VmbUint32_t &nFramesQueued)
#define SP_ISEQUAL(sp1, sp2)
IMEXPORT VmbErrorType QueueFrame(const FramePtr &pFrame)
VmbFeaturePersist_t m_persistType
tear_down_tasks GetTask()
get the top most taks and pop it from stack
VmbUint32_t VmbFeaturePersist_t
VmbUint32_t m_loggingLevel
static VmbErrorType AnnounceFrames(Camera &Camera, FramePtr *pFrames, VmbUint32_t nFrameCount, VmbInt64_t nPayloadSize, VmbUint32_t &nFramesAnnounced)
VmbErrorType GetModel(std::string &model) const
IMEXPORT VmbErrorType StopContinuousImageAcquisition()
VmbErrorType AppendFrameToVector(const FramePtr &frame)
std::vector< tear_down_tasks > task_storage
IMEXPORT VmbErrorType StartCapture()
VmbErrorType RunFeatureCommand(Camera &cam, const char *name)
IMEXPORTC VmbError_t VMB_CALL VmbCameraSettingsLoad(const VmbHandle_t handle, const char *fileName, VmbFeaturePersistSettings_t *pSettings, VmbUint32_t sizeofSettings)
IMEXPORT VmbErrorType RevokeFrame(const FramePtr &pFrame)
virtual VmbErrorType ReadMemory(const VmbUint64_t &address, UcharVector &buffer) const
virtual VmbErrorType WriteRegisters(const Uint64Vector &addresses, const Uint64Vector &buffer)
VmbErrorType GetInterfaceID(std::string &interfaceID) const
IMEXPORT VmbErrorType StartContinuousImageAcquisition(int bufferCount, const IFrameObserverPtr &pObserver)
IMEXPORTC VmbError_t VMB_CALL VmbCameraOpen(const char *idString, VmbAccessMode_t accessMode, VmbHandle_t *pCameraHandle)
void SetHandle(const VmbHandle_t handle)
VmbErrorType GetFeatureValueInt(Camera &cam, const char *name, VmbInt64_t &val)
IMEXPORT VmbErrorType RevokeAllFrames()
IMEXPORTC VmbError_t VMB_CALL VmbCaptureEnd(const VmbHandle_t cameraHandle)
IMEXPORT VmbErrorType GetInterfaceType(VmbInterfaceType &interfaceType) const
IMEXPORT VmbErrorType EndCapture()
std::string cameraIdStringGigE
IMEXPORTC VmbError_t VMB_CALL VmbCaptureQueueFlush(const VmbHandle_t cameraHandle)
VmbErrorType GetName(std::string &name) const
IMEXPORT VmbErrorType AnnounceFrame(const FramePtr &pFrame)