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

Acquire a sequence of images using a BitFlow frame grabber. More...

#include <SequenceInterface.h>

Inheritance diagram for BufferAcquisition::SequenceInterface:
BufferAcquisition::BufferInterface

Public Member Functions

 SequenceInterface (BFVOID)
 
 SequenceInterface (const BFU32 brdNumber)
 
 SequenceInterface (const BFU32 brdNumber, const BFU32 numBuffers, const BFU32 options)
 
 SequenceInterface (const BFU32 brdNumber, const BFU32 numBuffers, const BFU32 options, const BFSIZET alignment)
 
 ~SequenceInterface (BFVOID)
 
BFVOID setup (const BFU32 numBuffers, const BFU32 options)
 
BFVOID setup (const BFU32 numBuffers, const BFU32 options, const BFSIZET alignment)
 
BFVOID setup (PBFU32 *const pMemArray, const BFU32 numBuffers, const BFU32 options)
 
BFVOID cleanup (BFVOID)
 
BFVOID setSettings (const BFU32 startFrame, const BFU32 numFrames, const BFU32 skipFrames)
 
BFU32 seqWaitDone (const BFU32 timeout) const
 
BFVOID seqControl (const BFU32 command, const BFU32 options)
 
BFU32 seqErrorWait (BFVOID) const
 
BFU32 getSeqError (BFVOID)
 
BFU32 getCurFrameAcquired (BFVOID) const
 
BFU32 waitDoneFrame (const BFU32 timeout) const
 
BiSeqInfo getBufferInfo (const BFU32 bufferNumber) const
 
BFVOID clearBufferInfo (BFVOID)
 
- 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 a sequence of images using a BitFlow frame grabber.

An interface to acquire a fixed-length buffer sequences. In a sequence acquisition, each buffer is acquired once, at which point acquisition automatically stops.

See also
BufferAcquisition::BufferInterface
BufferAcquisition::CircularInterface
Examples:
BiSimplePlusPlus.cpp.

Constructor & Destructor Documentation

SequenceInterface::SequenceInterface ( BFVOID  )

Initilizes a new SequenceInterface object.

10 { }
SequenceInterface::SequenceInterface ( const BFU32  brdNumber)

Initilizes a new SequenceInterface 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().

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

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

Parameters
[in]brdNumber- The board number to open.
[in]numBuffers- The number of buffers to create.
[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().

44 {
45  open(brdNumber);
46 
47  try
48  {
49  setup(numBuffers, options);
50  }
51  catch (BFException const&)
52  {
53  close();
54  throw;
55  }
56 }
BFVOID setup(const BFU32 numBuffers, const BFU32 options)
Definition: SequenceInterface.cpp:124
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
SequenceInterface::SequenceInterface ( const BFU32  brdNumber,
const BFU32  numBuffers,
const BFU32  options,
const BFSIZET  alignment 
)

Initilizes a new SequenceInterface 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 not need to call setup.

Parameters
[in]brdNumber- The board number to open.
[in]numBuffers- The number of buffers to create.
[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().

81 {
82  open(brdNumber);
83 
84  try
85  {
86  setup(numBuffers, options, alignment);
87  }
88  catch (BFException const&)
89  {
90  close();
91  throw;
92  }
93 }
BFVOID setup(const BFU32 numBuffers, const BFU32 options)
Definition: SequenceInterface.cpp:124
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
SequenceInterface::~SequenceInterface ( BFVOID  )

Cleanup resources when closing down

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

100 {
101  cleanup();
102 
103  if(m_hBoard != BFNULL)
104  close();
105 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
#define BFNULL
Definition: BFType.h:61
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID cleanup(BFVOID)
Definition: SequenceInterface.cpp:244

Member Function Documentation

BFVOID SequenceInterface::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 ~SequenceInterface().

245 {
246  BFU32 rv;
247 
248  if (isMemAssigned)
249  {
250  BiBufferUnassign(m_hBoard, &m_BufferArray);
252  }
253  else if (isMemAllocated)
254  {
255  BiBufferFree(m_hBoard, &m_BufferArray);
257  }
258 
259  if (isSetup)
260  {
261  rv = BiSeqCleanUp(m_hBoard, &m_BufferArray);
262  isSetup = FALSE;
264  }
265 }
#define FALSE
Definition: BFType.h:57
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
BFBOOL isMemAssigned
Definition: BufferInterface.h:291
BFBOOL isMemAllocated
Definition: BufferInterface.h:292
BFVOID SequenceInterface::clearBufferInfo ( BFVOID  )

Initilizes the buffer infomation structure for all buffers to zero.

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.

483 {
484  if(!isSetup)
486 
487  BiException::check(m_hBoard, BiSeqBufferStatusClear(m_hBoard, &m_BufferArray) );
488 }
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
BiSeqInfo SequenceInterface::getBufferInfo ( const BFU32  bufferNumber) const

Returns infomation for a the buffer specified by the bufferNumber parameter. The info for a given buffer will include the frame count, time stamp and number of lines that have been acquired.

Parameters
[in]bufferNumber- The buffer that information will be returned for.
Returns
Returns the buffer information structure.
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.

466 {
467  BiSeqInfo bufferInfo;
468 
469  if(!isSetup)
471 
472  BiException::check(m_hBoard, BiSeqBufferStatus(m_hBoard, &m_BufferArray, bufferNumber, &bufferInfo) );
473  return bufferInfo;
474 }
struct _BiSeqInfo BiSeqInfo
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 SequenceInterface::getCurFrameAcquired ( BFVOID  ) const

Returns the buffer number that is currently being acquired into.

Returns
Returns the buffer number that is currently being acquired into.
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.

407 {
408  BFU32 frame;
409 
410  if(!isSetup)
412 
413  BiException::check(m_hBoard, BiSeqStatusGet(m_hBoard, &m_BufferArray, &frame) );
414 
415  return frame;
416 }
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 SequenceInterface::getSeqError ( 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.

391 {
392  if(!isSetup)
394 
395  return BiSeqErrorCheck(m_hBoard, &m_BufferArray);
396 }
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 SequenceInterface::seqControl ( const BFU32  command,
const BFU32  options 
)

Controls the sequence 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:
BiSimplePlusPlus.cpp.

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

339 {
340  BFU32 rv = BiSeqControl(m_hBoard, &m_BufferArray, command, options);
341  if(rv != BF_OK)
342  {
343  // Consider stopping or aborting acquisition if not acquiring
344  // a valid sequence of commands.
345  if((command == BISTOP || command == BIABORT) && rv == BI_ERROR_INVALID_CMD_SEQ)
346  return;
347  else
349  }
350 }
#define BISTOP
Definition: BiDef.h:154
unsigned long BFU32
Definition: BFTypeNT.h:55
BIBA m_BufferArray
Definition: BufferInterface.h:286
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Definition: BiError.h:161
#define BIABORT
Definition: BiDef.h:157
Bd m_hBoard
Definition: BufferInterface.h:283
BFU32 SequenceInterface::seqErrorWait ( 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 getSeqError() to get more information about the error.
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.

370 {
371  if(!isSetup)
373 
374  return BiSeqErrorWait(m_hBoard, &m_BufferArray);
375 }
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 SequenceInterface::seqWaitDone ( const BFU32  timeout) const

Efficiently waits for the sequence capture to be completed. If the sequence is not complete by the time specified by the "timeout" parameter, the method throws a BFException.

Parameters
[in]timeout- specifies the time in milli seconds to wait or INFINITE to never timeout.
Returns
This method can return one of the following:
BI_OK - Sequence capture was successful.
BI_AQ_STOPPED - Sequence scquisition was stopped.
BI_AQ_ABORTED - Sequence acquisition was aborted.
BI_CANCEL_FRAME_DONE - Cleanup was called causing this mehtod to return.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
BiSimplePlusPlus.cpp.

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

309 {
310  if(!isSetup)
312 
313  BFU32 rv = BiSeqWaitDone(m_hBoard, &m_BufferArray, timeout);
314  if(rv != BI_OK && rv != BI_AQ_STOPPED && rv != BI_AQ_ABORTED && rv != BI_CANCEL_FRAME_DONE)
316 
317  return rv;
318 }
Definition: BiError.h:405
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
Definition: BiError.h:399
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:19
Definition: BiError.h:342
Definition: BiError.h:400
BFVOID SequenceInterface::setSettings ( const BFU32  startFrame,
const BFU32  numFrames,
const BFU32  skipFrames 
)

Modifies the default behavior of the sequence capture system.

Parameters
[in]startFrame- The first buffer to start acquiring data into. Default is buffer zero.
[in]numFrames- The number of frames to acquire. This parameter must be less than the number of buffers that were allocated during creation of the SequenceInterface object creation or setup.
[in]skipFrames- Number of frames to be skipped between captures. **NOTE: skipFrames is currently not supported and must be zero.
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.

284 {
285  if(!isSetup)
287 
288  BiException::check(m_hBoard, BiSeqParameters(m_hBoard, &m_BufferArray, startFrame, numFrames, skipFrames) );
289 }
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 SequenceInterface::setup ( const BFU32  numBuffers,
const BFU32  options 
)

Sets up the system for sequence 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 sequence buffers to allocate.
[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 SequenceInterface().

125 {
126  BFU32 rv;
127 
128  if(isSetup)
130 
131  // allocate memory for buffer sequence
132  BiException::check(m_hBoard, BiBufferAllocCam(m_hBoard, &m_BufferArray, numBuffers) );
133 
134  // setup board for sequence acquisition
135  rv = BiSeqAqSetup(m_hBoard, &m_BufferArray, options|BiAqEngJ);
136  if(rv != BI_OK)
137  {
138  BiBufferFree(m_hBoard, &m_BufferArray);
140  }
141 
142  // we used the camera file information to allocate memory
144  isSetup = TRUE;
145 }
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
#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 SequenceInterface::setup ( const BFU32  numBuffers,
const BFU32  options,
const BFSIZET  alignment 
)

Sets up the system for sequence 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 sequence buffers to allocate.
[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.

170 {
171  BFU32 rv;
172 
173  if(isSetup)
175 
176  // allocate memory for buffer sequence
177  BiException::check(m_hBoard, BiBufferAllocAlignedCam(m_hBoard, &m_BufferArray, numBuffers, alignment) );
178 
179  // setup board for sequence acquisition
180  rv = BiSeqAqSetup(m_hBoard, &m_BufferArray, options|BiAqEngJ);
181  if(rv != BI_OK)
182  {
183  BiBufferFree(m_hBoard, &m_BufferArray);
185  }
186 
187  // we used the camera file information to allocate memory
189  isSetup = TRUE;
190 }
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
#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 SequenceInterface::setup ( PBFU32 *const  pMemArray,
const BFU32  numBuffers,
const BFU32  options 
)

Sets up the system for sequence 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]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.

212 {
213  BFU32 rv;
214 
215  if(isSetup)
217 
218  // assign user allocated memory to the internal structure
219  BiException::check(m_hBoard, BiBufferAssign(m_hBoard, &m_BufferArray, pMemArray, numBuffers) );
220 
221  // setup board for sequence acquisition
222  rv = BiSeqAqSetup(m_hBoard, &m_BufferArray, options|BiAqEngJ);
223  if(rv != BI_OK)
224  {
225  BiBufferUnassign(m_hBoard, &m_BufferArray);
227  }
228 
229  // we used the user allocated memory and assigned it to the structure.
231  isSetup = TRUE;
232 }
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
#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 SequenceInterface::waitDoneFrame ( const BFU32  timeout) 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.
Returns
Returns one of the following:
BI_OK - Operation Successful one complete frame was acquired.
BI_CANCEL_FRAME_DONE - cleanup was called causing this method to return.
BI_FRAME_STOP - Acquisition was stopped.
BI_FRAME_ABORT - Acquisition was aborted.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

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

436 {
437  if(!isSetup)
439 
440  const BFU32 rv = BiSeqWaitDoneFrame(m_hBoard, &m_BufferArray, timeout);
441  if (rv != BI_OK && rv != BI_CANCEL_FRAME_DONE && rv != BI_FRAME_STOP && rv != BI_FRAME_ABORT)
442  {
443  // Error occured, either timeout or big problems.
444  // Throw exception to notify the user.
446  }
447 
448  // return status of why this method returned.
449  return rv;
450 }
Definition: BiError.h:405
unsigned long BFU32
Definition: BFTypeNT.h:55
Definition: BiError.h:407
Definition: BiError.h:406
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

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