Buffer Interface
|
Acquire a sequence of images using a BitFlow frame grabber. More...
#include <SequenceInterface.h>
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 |
PBFU32 * | getBufferArrayPointers (BFVOID) |
const PBFU32 * | getBufferArrayPointers (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 ®Name) 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 |
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.
SequenceInterface::SequenceInterface | ( | BFVOID | ) |
Initilizes a new SequenceInterface object.
SequenceInterface::SequenceInterface | ( | const BFU32 | brdNumber | ) |
Initilizes a new SequenceInterface object and opens the bitflow board.
[in] | brdNumber | - The board number to open. |
BiException | - Use the showErrorMsg method to get information on the thrown exception. |
References BufferAcquisition::BufferInterface::open().
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.
[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. |
BiException | - Use the showErrorMsg method to get information on the thrown exception. |
References BufferAcquisition::BufferInterface::close(), BufferAcquisition::BufferInterface::open(), and setup().
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.
[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. |
BiException | - Use the showErrorMsg method to get information on the thrown exception. |
References BufferAcquisition::BufferInterface::close(), BufferAcquisition::BufferInterface::open(), and setup().
SequenceInterface::~SequenceInterface | ( | BFVOID | ) |
Cleanup resources when closing down
References BFNULL, cleanup(), BufferAcquisition::BufferInterface::close(), and BufferAcquisition::BufferInterface::m_hBoard.
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.
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().
Initilizes the buffer infomation structure for all buffers to zero.
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.
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.
[in] | bufferNumber | - The buffer that information will be returned for. |
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.
Returns the buffer number that is currently being acquired into.
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.
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.
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.
Controls the sequence acquisition system.
[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. |
BiException | - Use the showErrorMsg method to get information on the thrown exception. |
References BI_ERROR_INVALID_CMD_SEQ, BIABORT, BISTOP, BiException::check(), BufferAcquisition::BufferInterface::m_BufferArray, and BufferAcquisition::BufferInterface::m_hBoard.
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.
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.
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.
[in] | timeout | - specifies the time in milli seconds to wait or INFINITE to never timeout. |
BiException | - Use the showErrorMsg method to get information on the thrown exception. |
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.
BFVOID SequenceInterface::setSettings | ( | const BFU32 | startFrame, |
const BFU32 | numFrames, | ||
const BFU32 | skipFrames | ||
) |
Modifies the default behavior of the sequence capture system.
[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. |
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.
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.
[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. |
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().
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.
[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. |
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.
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.
[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. |
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.
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.
[in] | timeout | - The number of milliseconds to wait for the end of frame. |
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.