Buffer Interface
Public Member Functions | List of all members
BufferAcquisition::CircularInterface Class Reference

Acquire images into a circular buffer using a BitFlow frame grabber. More...

#include <CircularInterface.h>

Inheritance diagram for BufferAcquisition::CircularInterface:
BufferAcquisition::BufferInterface

Public Member Functions

 CircularInterface (BFVOID)
 
 CircularInterface (const BFU32 brdNumber)
 
 CircularInterface (const BFU32 brdNumber, const BFU32 numBuffers, const BFU32 errorMode, const BFU32 options)
 
 CircularInterface (const BFU32 brdNumber, const BFU32 numBuffers, const BFU32 errorMode, const BFU32 options, const BFSIZET alignment)
 
 ~CircularInterface (BFVOID)
 
BFVOID setup (const BFU32 numBuffers, const BFU32 errorMode, const BFU32 options)
 
BFVOID setup (const BFU32 numBuffers, const BFU32 errorMode, const BFU32 options, const BFSIZET alignment)
 
BFVOID setup (PBFU32 *const pMemArray, const BFU32 numBuffers, const BFU32 errorMode, const BFU32 options)
 
BFVOID cleanup (BFVOID)
 
BFVOID cirControl (const BFU32 command, const BFU32 options)
 
BFU32 cirErrorWait (BFVOID) const
 
BFRC getCirError (BFVOID)
 
BFU32 waitDoneFrame (const BFU32 timeout, const PBiCirHandle CirHandle) const
 
BFU32 setBufferStatus (BiCirHandle &cirHandle, const BFU32 status)
 
BFU32 setBufferStatus (const BFU32 bufferNumber, const BFU32 status)
 
BFU32 getBufferStatus (BiCirHandle const &cirHandle) const
 
BFU32 getBufferStatus (const BFU32 bufferNumber) const
 
- Public Member Functions inherited from BufferAcquisition::BufferInterface
 BufferInterface (BFVOID)
 
virtual ~BufferInterface (BFVOID)
 
BFVOID open (const BFU32 brdNumber)
 
BFVOID open (const BFU32 brdNumber, const BFU32 options)
 
BFVOID open (const BFU32 brdNumber, std::string const &camFileName)
 
BFVOID open (const BFU32 brdNumber, const BFCHAR *const camFileName)
 
BFVOID open (const BFU32 brdNumber, std::string const &camFileName, const BFU32 options)
 
BFVOID open (const BFU32 brdNumber, const BFCHAR *const camFileName, const BFU32 options)
 
BFVOID openSWConnector (const BFU32 Switch, const BFU32 Connector)
 
BFVOID openSWConnector (const BFU32 Switch, const BFU32 Connector, const BFU32 options)
 
BFVOID close (BFVOID)
 
Bd getBoardHandle (BFVOID) const
 
BFU32 getBoardNumber (BFVOID) const
 
BFVOID getBoardSWConnector (BFU32 &Switch, BFU32 &Connector)
 
BFSIZET enumerateCameraModes (std::vector< std::string > &modes, std::vector< std::string > &descriptions=std::vector< std::string >()) const
 
BFBOOL enumerateCameraMode (const BFSIZET index, BFCHAR *const modeBuf, BFSIZET *const pModeSize, BFCHAR *const descBuf, BFSIZET *const pDescSize) const
 
std::string getCameraMode (BFVOID) const
 
BFBOOL getCameraMode (BFCHAR *const modeBuf, BFSIZET *const pModeSize) const
 
BFVOID setCameraMode (std::string const &modeName)
 
BFVOID setCameraMode (const BFCHAR *const modeName)
 
BFVOID setAcqFrameSize (const BFU32 XSize, const BFU32 YSize)
 
BFVOID setAcqROI (const BFU32 XOffset, const BFU32 YOffset, const BFU32 XSize, const BFU32 YSize)
 
BFVOID setExTriggerConnect (const CiTrigSelect trigger=CiTrigA, const BFU32 state=BFExTrigConnect)
 
BFVOID setExposureControl (const BFDOUBLE ExposurePeriod, const BFDOUBLE LineFramePeriod, const BFU32 TriggerMode, const BFBOOL AssertedHigh, const BFU32 OutputSignal)
 
BFVOID getExposureControl (BFDOUBLE &ExposurePeriod, BFDOUBLE &LineFramePeriod, BFU32 &TriggerMode, BFBOOL &AssertedHigh, BFU32 &OutputSignal) const
 
PBFU32getBufferArrayPointers (BFVOID)
 
const PBFU32getBufferArrayPointers (BFVOID) const
 
BFU32 getBrdInfo (const BFU32 brdInqVar) const
 
BFU32 getNumFramesCaptured (BFVOID) const
 
BFU32 getNumFramesMissed (BFVOID) const
 
BFBOOL getStartAcqFlag (BFVOID) const
 
BFBOOL getStopAcqFlag (BFVOID) const
 
BFBOOL getAbortAcqFlag (BFVOID) const
 
BFBOOL getPauseAcqFlag (BFVOID) const
 
BFBOOL getCleanupAcqFlag (BFVOID) const
 
BFVOID setTriggerMode (const BFU32 triggerMode=BiTrigFreeRun, const BFU32 trigPolarity=BiTrigAssertedHigh)
 
BFU32 getTriggerMode (BFVOID) const
 
BFU32 getTriggerPolarity (BFVOID) const
 
BFVOID issueSoftwareTrigger (const BFU32 trigMode=BiTrigAssertTrigA)
 
BFU32 showError (const BFU32 errorNum) const
 
BFVOID writeBuffer (PBFCHAR fileName, const BFSIZET fileNameSize, const BFU32 bufferNumber, const BFU32 options) const
 
BFVOID writeBuffer (std::string const &fileName, const BFU32 bufferNumber, const BFU32 options) const
 
BFVOID writeSeqBuffer (PBFCHAR fileName, const BFSIZET fileNameSize, const BFU32 firstBufNumber, const BFU32 numBufs, const BFU32 Options) const
 
BFVOID writeSeqBuffer (std::string const &fileName, const BFU32 firstBufNumber, const BFU32 numBufs, const BFU32 Options) const
 
BFVOID readSeqFile (std::string const &fileName, const BFU32 firstBufNumber, const BFU32 numBufs)
 
BFVOID readSeqFile (const BFCHAR *const fileName, const BFU32 firstBufNumber, const BFU32 numBufs)
 
BFVOID clearBuffers (BFVOID)
 
std::string getErrorText (const BFU32 errorNumber) const
 
BFVOID getErrorText (const BFU32 errorNumber, PBFCHAR errorText, const PBFU32 errorTextSize) const
 
BFU32 getBufferQueueSize (BFVOID) const
 
BFVOID setTimeout (const BFU32 TimeoutValue)
 
BFVOID loadCamFile (std::string const &camFileName)
 
BFVOID loadCamFile (const BFCHAR *const camFileName)
 
BFVOID unloadCamFile (BFVOID)
 
BFU32 cxpReadReg (const BFU32 address) const
 
BFU32 cxpReadReg (const BFU32 link, const BFU32 address) const
 
BFVOID cxpWriteReg (const BFU32 address, const BFU32 value)
 
BFVOID cxpWriteReg (const BFU32 link, const BFU32 address, const BFU32 value)
 
BFSIZET cxpReadData (const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
 
BFSIZET cxpReadData (const BFU32 address, const BFU32 bytesToRead, BFU8 *const dataOut, const BFSIZET dataOutSize) const
 
BFSIZET cxpReadData (const BFU32 link, const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
 
BFSIZET cxpReadData (const BFU32 link, const BFU32 address, const BFU32 bytesToRead, BFU8 *const dataOut, const BFSIZET dataOutSize) const
 
BFVOID cxpWriteData (const BFU32 address, std::vector< BFU8 > const &dataIn)
 
BFVOID cxpWriteData (const BFU32 address, const BFU8 *const dataIn, const BFSIZET dataInSize)
 
BFVOID cxpWriteData (const BFU32 link, const BFU32 address, std::vector< BFU8 > const &dataIn)
 
BFVOID cxpWriteData (const BFU32 link, const BFU32 address, const BFU8 *const dataIn, const BFSIZET dataInSize)
 
std::string bfRegName (const BFU32 RegId) const
 
BFVOID bfRegName (const BFU32 RegId, PBFCHAR nameBuf, const BFSIZET nameBufSize) const
 
BFU32 bfRegId (std::string const &regName) const
 
BFU32 bfRegId (const BFCHAR *const regName) const
 
BFU32 bfRegPeek (const BFU32 RegId) const
 
BFVOID bfRegPoke (const BFU32 RegId, const BFU32 Value)
 
BFBOOL isBoardOpen (BFVOID) const
 
BFBOOL isBoardSetup (BFVOID) const
 
BufferInterface::Properties const & properties (void) const
 

Additional Inherited Members

- Static Public Member Functions inherited from BufferAcquisition::BufferInterface
static BFU32 boardCount (BFVOID)
 
static BFU32 getMajorVersion (BFVOID)
 
static BFU32 getMinorVersion (BFVOID)
 
- Protected Attributes inherited from BufferAcquisition::BufferInterface
Bd m_hBoard
 
BIBA m_BufferArray
 
PBFCNF m_pCam
 
BFBOOL isMemAssigned
 
BFBOOL isMemAllocated
 
BFBOOL isSetup
 
BFBOOL isOpen
 

Detailed Description

Acquire images into a circular buffer using a BitFlow frame grabber.

An interface to acquire images continuously in a circular buffer. In a circular acquisition continues indefinitely, until explicitly stopped.

See also
BufferAcquisition::BufferInterface
BufferAcquisition::SequenceInterface
Examples:
CircClassExample.cpp, and CircHoldSimple.cpp.

Constructor & Destructor Documentation

CircularInterface::CircularInterface ( BFVOID  )

Initilizes a new CircularInterface object.

10 {
11 }
CircularInterface::CircularInterface ( const BFU32  brdNumber)

Initilizes a new CircularInterface object and opens the bitflow board.

Parameters
[in]brdNumber- The board number to open.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BufferAcquisition::BufferInterface::open().

22 {
23  open(brdNumber);
24 }
BFVOID open(const BFU32 brdNumber)
Definition: BufferInterface.cpp:95
CircularInterface::CircularInterface ( const BFU32  brdNumber,
const BFU32  numBuffers,
const BFU32  errorMode,
const BFU32  options 
)

Initilizes a new CircularInterface object. Opens and sets up the board using attached camera file. When using this constructor, there is no need to call setup.

Parameters
[in]brdNumber- The board number to open.
[in]numBuffers- The number of buffers to create.
[in]errorMode- The error mode to use when there are no buffers. available to acquire into. The error mode can be one of the following:
CirErStop - Stop acquisition when no buffers are available.
CirErIgnore - Overwrite buffers regardless of status.
[in]options- Options for setup:
NoResetOnError - Will not reset acquisition on overflow or hardware exception.
AbortMissedFrame - If a frame is missed, acquisition will stop.
DisableAqErrorSig - The overflow and hardware exception signals will not be created.
Options can be ORed together.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BufferAcquisition::BufferInterface::close(), BufferAcquisition::BufferInterface::open(), and setup().

50 {
51  open(brdNumber);
52 
53  // If setup fails catch the exception, close the open board
54  // and rethrow it.
55  try
56  {
57  setup(numBuffers, errorMode, options);
58  }
59  catch (BFException const&)
60  {
61  close();
62  throw;
63  }
64 }
BFVOID setup(const BFU32 numBuffers, const BFU32 errorMode, const BFU32 options)
Definition: CircularInterface.cpp:144
Base class of all BitFlow exception classes.
Definition: BFException.hpp:11
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
BFVOID open(const BFU32 brdNumber)
Definition: BufferInterface.cpp:95
CircularInterface::CircularInterface ( const BFU32  brdNumber,
const BFU32  numBuffers,
const BFU32  errorMode,
const BFU32  options,
const BFSIZET  alignment 
)

Initilizes a new CircularInterface object. Opens and sets up the board using attached camera file. When allocating the buffers, each buffer will be aligned by the specified alignment boundary. When using this constructor, there is no need to call setup.

Parameters
[in]brdNumber- The board number to open.
[in]numBuffers- The number of buffers to create.
[in]errorMode- The error mode to use when there are no buffers. available to acquire into. The error mode can be one of the following:
CirErStop - Stop acquisition when no buffers are available.
CirErIgnore - Overwrite buffers regardless of status.
[in]options- Options for setup:
NoResetOnError - Will not reset acquisition on overflow or hardware exception.
AbortMissedFrame - If a frame is missed, acquisition will stop.
DisableAqErrorSig - The overflow and hardware exception signals will not be created.
Options can be ORed together.
[in]alignment- Allocate each buffer on this specified alignment boundary. The alignment value must be an integer power of 2.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BufferAcquisition::BufferInterface::close(), BufferAcquisition::BufferInterface::open(), and setup().

95 {
96  open(brdNumber);
97 
98  // If setup fails catch the exception, close the open board
99  // and rethrow it.
100  try
101  {
102  setup(numBuffers, errorMode, options, alignment);
103  }
104  catch (BFException const&)
105  {
106  close();
107  throw;
108  }
109 }
BFVOID setup(const BFU32 numBuffers, const BFU32 errorMode, const BFU32 options)
Definition: CircularInterface.cpp:144
Base class of all BitFlow exception classes.
Definition: BFException.hpp:11
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
BFVOID open(const BFU32 brdNumber)
Definition: BufferInterface.cpp:95
CircularInterface::~CircularInterface ( BFVOID  )

Cleanup resources when closing down

References BFNULL, cleanup(), BufferAcquisition::BufferInterface::close(), and BufferAcquisition::BufferInterface::m_hBoard.

115 {
116  cleanup();
117 
118  if(m_hBoard != BFNULL)
119  close();
120 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
BFVOID cleanup(BFVOID)
Definition: CircularInterface.cpp:266
#define BFNULL
Definition: BFType.h:61
Bd m_hBoard
Definition: BufferInterface.h:283

Member Function Documentation

BFVOID CircularInterface::cirControl ( const BFU32  command,
const BFU32  options 
)

Controls the circular acquisition system.

Parameters
[in]command- Can be one of the following:
BISTART - Starts acquisition.
BISTOP - Stops acquisition after the current frame is acquired.
BIABORT - Stops acquisition immediately.
BIPAUSE - Pauses acquisition after the current frame is acquired.
BIRESUME - Resumes acquisition after acquisition has been paused.
[in]options- Can be one of the following:
BIWait - Waits for the current command to be completed before returning.
BIAsync - The method returns as soon as the command is issued.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
CircHoldSimple.cpp.

References BI_ERROR_CIR_INVALID_CMD_SEQ, BI_OK, BIABORT, BISTOP, BiException::check(), BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

305 {
306  BFU32 rv = BiCirControl(m_hBoard, &m_BufferArray, command, options);
307  if(rv != BI_OK)
308  {
309  // Consider stopping or aborting acquisition if not acquiring
310  // a valid sequence of commands.
311  if((command == BISTOP || command == BIABORT) && rv == BI_ERROR_CIR_INVALID_CMD_SEQ)
312  return;
313  else
315  }
316 }
#define BISTOP
Definition: BiDef.h:154
unsigned long BFU32
Definition: BFTypeNT.h:55
Definition: BiError.h:298
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define BIABORT
Definition: BiDef.h:157
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:19
BFU32 CircularInterface::cirErrorWait ( BFVOID  ) const

Returns when an acquisition error has occured or when the cleanup method has been called. This method is designed to be placed in a separate thread and will return when an error occurs. When the method returns, the error thread can take the appropriate action. This method only handles acquisition errors such as a FIFO overflow, acquisition timeout, and loss of sync. When cleanup is call this method will return BI_CIR_CLEANUP.

Returns
Returns on an error or when cleanup has been called.
BI_CIR_CLEANUP - cleanup has been called.
BI_ERROR_ACQUISITION - A acquisition error has occured. Use getCirError() to get more information about the error.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
CircClassExample.cpp.

References BI_ERROR_CALL_SETUP, BiException::check(), BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

335 {
336  if(!isSetup)
338 
339  return BiCirErrorWait(m_hBoard, &m_BufferArray);
340 }
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:342
BFVOID CircularInterface::cleanup ( BFVOID  )

Shuts down current acquisition, kill all threads, and releases all resources allocated when instantiated. The setup method should be called before this function. Cleanup gets called from the desctructor so in most cases there will be no need for the user to call this method.

Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), FALSE, BufferAcquisition::BufferInterface::isMemAllocated, BufferAcquisition::BufferInterface::isMemAssigned, BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

Referenced by ~CircularInterface().

267 {
268  if (isMemAssigned)
269  {
270  BiBufferUnassign(m_hBoard, &m_BufferArray);
272  }
273  else if (isMemAllocated)
274  {
275  BiBufferFree(m_hBoard, &m_BufferArray);
277  }
278 
279  if(isSetup)
280  {
281  const BFRC rv = BiCircCleanUp(m_hBoard, &m_BufferArray);
282  isSetup = FALSE;
284  }
285 }
#define FALSE
Definition: BFType.h:57
BFU32 BFRC
Definition: BFType.h:92
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
BFBOOL isMemAssigned
Definition: BufferInterface.h:291
BFBOOL isMemAllocated
Definition: BufferInterface.h:292
BFU32 CircularInterface::getBufferStatus ( BiCirHandle const &  cirHandle) const

Returns the current acquisition status for a buffer.

Parameters
[in]cirHandle- The handle of the buffer to get status from.
Returns
Returns one of the following buffer statuses:
BIAVAILABLE - The buffer is available for acquisition.
BIFRESH - A buffer that has been acquired into and added to the buffer queue.
BINEW - A buffer that has been acquired into and has been removed from the buffer queue from the waitDoneFrame method.
BIHOLD - The buffer is unavailable for acquisition.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_CALL_SETUP, BiException::check(), BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

480 {
481  if(!isSetup)
483 
484  BFU32 status;
485  BiException::check(m_hBoard, BiCirStatusGet(m_hBoard, &m_BufferArray, cirHandle, &status) );
486  return status;
487 }
unsigned long BFU32
Definition: BFTypeNT.h:55
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:342
BFU32 CircularInterface::getBufferStatus ( const BFU32  bufferNumber) const

Returns the current acquisition status for a buffer.

Parameters
[in]bufferNumber- The buffer number to get status from.
Returns
Returns one of the following buffer statuses:
BIAVAILABLE - The buffer is available for acquisition.
BIFRESH - A buffer that has been acquired into and added to the buffer queue.
BINEW - A buffer that has been acquired into and has been removed from the buffer queue from the waitDoneFrame method.
BIHOLD - The buffer is unavailable for acquisition.
BIQUEUED - The buffer is in the available queue and will be made available by the system.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_CALL_SETUP, BiException::check(), BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

507 {
508  if(!isSetup)
510 
511  BFU32 status;
512  BiException::check(m_hBoard, BiCirBufferStatusGet(m_hBoard, &m_BufferArray, bufferNumber, &status) );
513  return status;
514 }
unsigned long BFU32
Definition: BFTypeNT.h:55
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:342
BFRC CircularInterface::getCirError ( BFVOID  )

Returns any errors on the error stack. If there are no errors on the error stack, BI_OK will be returned. This method does not require the use of a separate error thread. For single threaded applications, this method can be called frome time to time to check for error conditions.

See also
showError()
Returns
Returns any errors on the error stack. If there are no errors, BI_OK will be returned.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_CALL_SETUP, BiException::check(), BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

356 {
357  if(!isSetup)
359 
360  return BiCirErrorCheck(m_hBoard, &m_BufferArray);
361 }
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:342
BFU32 CircularInterface::setBufferStatus ( BiCirHandle cirHandle,
const BFU32  status 
)

Changes the status of the buffer designated by CirHandle. The status can be changed to BIAVAILABLE or BIHOLD only. An error will be thrown if the status is anything but BIAVAILABLE or BIHOLD.

Parameters
[in]cirHandle- The handle of the buffer to change status on.
[in]status- The status to change the buffer too. Status can be one of the following:
BIAVAILABLE - The buffer is available for acquisition. BIHOLD - The buffer is unavailable for acquisition.
Returns
Returns one of the following:
BI_OK - Operation Successful, the buffer was held.
BI_ERROR_MARK_HOLD - Was unable to hold the buffer because the board is DMAing image data to a buffer near the buffer to be held.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
CircClassExample.cpp.

References BI_ERROR_CALL_SETUP, BI_ERROR_MARK_HOLD, BI_OK, BiException::check(), BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

421 {
422  if(!isSetup)
424 
425  const BFU32 rv = BiCirStatusSet(m_hBoard, &m_BufferArray, cirHandle, status);
426  if(rv != BI_OK && rv != BI_ERROR_MARK_HOLD)
428 
429  return rv;
430 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Definition: BiError.h:311
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:19
Definition: BiError.h:342
BFU32 CircularInterface::setBufferStatus ( const BFU32  bufferNumber,
const BFU32  status 
)

Changes the status of the buffer designated by bufferNumber. The status can be changed to BIAVAILABLE or BIHOLD only. An error will be thrown if the status is anything but BIAVAILABLE or BIHOLD.

Parameters
[in]bufferNumber- The buffer number to change status on.
[in]status- The status to change the buffer too. Status can be one of the following:
BIAVAILABLE - The buffer is available for acquisition. BIHOLD - The buffer is unavailable for acquisition.
Returns
Returns one of the following:
BI_OK - Operation Successful, the buffer was held.
BI_ERROR_MARK_HOLD - Was unable to hold the buffer because the board is DMAing image data to a buffer near the buffer to be held.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_CALL_SETUP, BI_ERROR_MARK_HOLD, BI_OK, BiException::check(), BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

453 {
454  if(!isSetup)
456 
457  const BFU32 rv = BiCirBufferStatusSet(m_hBoard, &m_BufferArray, bufferNumber, status);
458  if(rv != BI_OK && rv != BI_ERROR_MARK_HOLD)
460 
461  return rv;
462 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Definition: BiError.h:311
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:19
Definition: BiError.h:342
BFVOID CircularInterface::setup ( const BFU32  numBuffers,
const BFU32  errorMode,
const BFU32  options 
)

Sets up the system for circular acquisition by allocating memory and setting up the board. The allocating of memory will be based on the x and y sizes along with the bit depth of the current attached camera file.

Parameters
[in]numBuffers- The number of buffers to allocate.
[in]errorMode- The error mode to use when there are no buffers available to acquire into. The error mode can be one of the following:
CirErStop - Stop acquisition when no buffers are available.
CirErIgnore - Overwrite buffers regardless of status.
[in]options- Options for setup:
NoResetOnError - Will not reset acquisition on overflow or hardware exception.
AbortMissedFrame - If a frame is missed, acquisition will stop.
DisableAqErrorSig - The overflow and hardware exception signals will not be created.
Options can be ORed together.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_SETUP_TWICE, BI_OK, BiAqEngJ, BiException::check(), BufferAcquisition::BufferInterface::isMemAllocated, BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, BufferAcquisition::BufferInterface::m_hBoard, and TRUE.

Referenced by CircularInterface().

145 {
146  if(isSetup)
148 
149  // allocate memory for circular buffers
150  BiException::check(m_hBoard, BiBufferAllocCam(m_hBoard, &m_BufferArray, numBuffers) );
151 
152  // setup board for sequence acquisition
153  const BFRC rv = BiCircAqSetup(m_hBoard, &m_BufferArray, errorMode, options|BiAqEngJ);
154  if(rv != BI_OK)
155  {
156  BiBufferFree(m_hBoard, &m_BufferArray);
158  }
159 
160  // we used the camera file information to allocate memory
162  isSetup = TRUE;
163 }
BFU32 BFRC
Definition: BFType.h:92
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define TRUE
Definition: BFType.h:53
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:341
Definition: BiError.h:19
BFBOOL isMemAllocated
Definition: BufferInterface.h:292
#define BiAqEngJ
Definition: BiDef.h:125
BFVOID CircularInterface::setup ( const BFU32  numBuffers,
const BFU32  errorMode,
const BFU32  options,
const BFSIZET  alignment 
)

Sets up the system for circular acquisition by allocating memory and setting up the board. The allocating of memory will be based on the x and y sizes along with the bit depth of the current attached camera file. When allocating the buffers, each buffer will be aligned by the specified alignment boundary.

Parameters
[in]numBuffers- The number of buffers to allocate.
[in]errorMode- The error mode to use when there are no buffers available to acquire into. The error mode can be one of the following:
CirErStop - Stop acquisition when no buffers are available.
CirErIgnore - Overwrite buffers regardless of status.
[in]options- Options for setup:
NoResetOnError - Will not reset acquisition on overflow or hardware exception.
AbortMissedFrame - If a frame is missed, acquisition will stop.
DisableAqErrorSig - The overflow and hardware exception signals will not be created.
Options can be ORed together.
[in]alignment- Allocate each buffer on this specified alignment boundary. The alignment value must be an integer power of 2.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_SETUP_TWICE, BI_OK, BiAqEngJ, BiException::check(), BufferAcquisition::BufferInterface::isMemAllocated, BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, BufferAcquisition::BufferInterface::m_hBoard, and TRUE.

192 {
193  if(isSetup)
195 
196  // allocate memory for circular buffers
197  BiException::check(m_hBoard, BiBufferAllocAlignedCam(m_hBoard, &m_BufferArray, numBuffers, alignment) );
198 
199  // setup board for sequence acquisition
200  const BFRC rv = BiCircAqSetup(m_hBoard, &m_BufferArray, errorMode, options|BiAqEngJ);
201  if(rv != BI_OK)
202  {
203  BiBufferFree(m_hBoard, &m_BufferArray);
205  }
206 
207  // we used the camera file information to allocate memory
209  isSetup = TRUE;
210 }
BFU32 BFRC
Definition: BFType.h:92
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define TRUE
Definition: BFType.h:53
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:341
Definition: BiError.h:19
BFBOOL isMemAllocated
Definition: BufferInterface.h:292
#define BiAqEngJ
Definition: BiDef.h:125
BFVOID CircularInterface::setup ( PBFU32 *const  pMemArray,
const BFU32  numBuffers,
const BFU32  errorMode,
const BFU32  options 
)

Sets up the system for circular acquisition by using memory allocated by the user.

Parameters
[in]pMemArray- A pointer to an array of pointers that point to each buffer allocated by the user.
[in]numBuffers- The number of buffers allocated by the user.
[in]errorMode- The error mode to use when there are no buffers available to acquire into. The error mode can be one of the following:
CirErStop - Stop acquisition when no buffers are available.
CirErIgnore - Overwrite buffers regardless of status.
[in]options- Options for setup:
NoResetOnError - Will not reset acquisition on overflow or hardware exception.
AbortMissedFrame - If a frame is missed, acquisition will stop.
DisableAqErrorSig - The overflow and hardware exception signals will not be created.
Options can be ORed together.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_SETUP_TWICE, BI_OK, BiAqEngJ, BiException::check(), BufferAcquisition::BufferInterface::isMemAssigned, BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, BufferAcquisition::BufferInterface::m_hBoard, and TRUE.

236 {
237  if(isSetup)
239 
240  // assign user allocated memory to the internal structure
241  BiException::check(m_hBoard, BiBufferAssign(m_hBoard, &m_BufferArray, pMemArray, numBuffers) );
242 
243  // setup board for sequence acquisition
244  const BFRC rv = BiCircAqSetup(m_hBoard, &m_BufferArray, errorMode, options|BiAqEngJ);
245  if(rv != BI_OK)
246  {
247  BiBufferUnassign(m_hBoard, &m_BufferArray);
249  }
250 
251  // we used the user allocated memory and assigned it to the structure.
253  isSetup = TRUE;
254 }
BFU32 BFRC
Definition: BFType.h:92
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define TRUE
Definition: BFType.h:53
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:341
Definition: BiError.h:19
BFBOOL isMemAssigned
Definition: BufferInterface.h:291
#define BiAqEngJ
Definition: BiDef.h:125
BFU32 CircularInterface::waitDoneFrame ( const BFU32  timeout,
const PBiCirHandle  cirHandle 
) const

Returns when a frame has been completly DMAed into memory. If this method is called after a frame has been captured into memory, the method returns immediately.

Parameters
[in]timeout- The number of milliseconds to wait for the end of frame.
[out]cirHandle- a pointer to a handle of the acquired buffer. The handle includes the following information:
pBufData - A pointer to the image data buffer.
FrameCount - The number of frames that have been acquired.
TimeStamp - The time stamp of the acquired image.
BufferNumber - The buffer number the image is in.
NumLinesAcquired - Number of lines acquired.
pNode - A pointer to the node in the linked list.
Returns
Returns one of the following:
BI_OK - Operation Successful one complete frame was acquired.
BI_CANCEL_CIR_FRAME_DONE - Cleanup was called causing this method to return.
BI_CIR_STOPPED - Acquisition was stopped.
BI_CIR_ABORTED - Acquisition was aborted.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
CircClassExample.cpp.

References BI_CANCEL_CIR_FRAME_DONE, BI_CIR_ABORTED, BI_CIR_STOPPED, BI_ERROR_CALL_SETUP, BI_OK, BiException::check(), BufferAcquisition::BufferInterface::isSetup, BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.

389 {
390  if(!isSetup)
392 
393  const BFU32 rv = BiCirWaitDoneFrame(m_hBoard, &m_BufferArray, timeout, cirHandle);
394  if(rv != BI_OK && rv != BI_CIR_STOPPED && rv != BI_CIR_ABORTED && rv != BI_CANCEL_CIR_FRAME_DONE)
396 
397  return rv;
398 }
unsigned long BFU32
Definition: BFTypeNT.h:55
BFBOOL isSetup
Definition: BufferInterface.h:293
BIBA m_BufferArray
Definition: BufferInterface.h:286
Definition: BiError.h:408
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Definition: BiError.h:402
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:403
Definition: BiError.h:19
Definition: BiError.h:342

The documentation for this class was generated from the following files: