Buffer Interface
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
BufferAcquisition::BufferInterface Class Reference

Base class for buffered acquisition using a BitFlow frame grabber. More...

#include <BufferInterface.h>

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

Classes

class  Properties
 Static properties of an open BufferAcquisition::BufferInterface. More...
 

Public Member Functions

 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
 

Static Public Member Functions

static BFU32 boardCount (BFVOID)
 
static BFU32 getMajorVersion (BFVOID)
 
static BFU32 getMinorVersion (BFVOID)
 

Protected Attributes

Bd m_hBoard
 
BIBA m_BufferArray
 
PBFCNF m_pCam
 
BFBOOL isMemAssigned
 
BFBOOL isMemAllocated
 
BFBOOL isSetup
 
BFBOOL isOpen
 

Detailed Description

Base class for buffered acquisition using a BitFlow frame grabber.

The BufferInterface class provides the common functionality used by the Sequence and Circular Interface classes.

See also
BufferAcquisition::SequenceInterface
BufferAcquisition::CircularInterface

Constructor & Destructor Documentation

BufferInterface::BufferInterface ( BFVOID  )

Initialize a new BufferInterface instance.

46  : m_hBoard (BFNULL)
49  , isSetup (FALSE)
50  , m_pCam (BFNULL)
51  , isOpen (FALSE)
52 
53  , m_pd (*new PrivateData(*this))
54 {
55  // Fill some default closed state values.
56  m_pd.atClose();
57 }
#define FALSE
Definition: BFType.h:57
BFBOOL isSetup
Definition: BufferInterface.h:293
PBFCNF m_pCam
Definition: BufferInterface.h:289
BFBOOL isOpen
Definition: BufferInterface.h:294
#define BFNULL
Definition: BFType.h:61
Bd m_hBoard
Definition: BufferInterface.h:283
BFBOOL isMemAssigned
Definition: BufferInterface.h:291
BFBOOL isMemAllocated
Definition: BufferInterface.h:292
BufferInterface::~BufferInterface ( BFVOID  )
virtual

Clean up this BufferInterface instance and its resources.

References close().

63 {
64  close();
65  delete &m_pd;
66 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336

Member Function Documentation

BFU32 BufferInterface::bfRegId ( std::string const &  regName) const

Return the index of the BitFlow board register from a register name.

Parameters
[in]regName- The BitFlow board register name
Returns
The index of the register, on success, or REG_UNDEFINED, on failure.

Referenced by bfRegId().

1584 {
1585  const auto idIter = m_pd.regIdMap.find(regName);
1586  if (m_pd.regIdMap.end() == idIter)
1587  return REG_UNDEFINED;
1588  return idIter->second;
1589 }
BFU32 BufferInterface::bfRegId ( const BFCHAR *const  regName) const

Return the index of the BitFlow board register from a register name.

Parameters
[in]regName- The BitFlow board register name
Returns
The index of the register, on success, or REG_UNDEFINED, on failure.

References bfRegId().

1599 {
1600  const std::string cppRegName (regName);
1601  return bfRegId(cppRegName);
1602 }
BFU32 bfRegId(std::string const &regName) const
Definition: BufferInterface.cpp:1583
std::string BufferInterface::bfRegName ( const BFU32  RegId) const

Return the name of the frame grabber register at the given index.

Parameters
[in]RegId- The BitFlow board register index.
Returns
The string name of the board register.
Exceptions
BFCiException- Thrown if the register index doesn't exist on this board. Use the showErrorMsg method to get information on the thrown exception.

References MAX_STRING.

1555 {
1556  char name [MAX_STRING];
1557  bfRegName(RegId, name, sizeof name);
1558  return name;
1559 }
std::string bfRegName(const BFU32 RegId) const
Definition: BufferInterface.cpp:1554
#define MAX_STRING
Definition: BFType.h:65
BFVOID BufferInterface::bfRegName ( const BFU32  RegId,
PBFCHAR  nameBuf,
const BFSIZET  nameBufSize 
) const

Retrieve the name of the frame grabber register at the given index.

Parameters
[in]RegId- The BitFlow board register index.
[out]nameBuf- Output buffer filled with the name of the board register.
[in]nameBufSize- Byte size of the nameBuf output buffer.
Exceptions
BFCiException- Thrown if the register index doesn't exist on this board. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), and m_hBoard.

1572 {
1573  BFCiException::check(m_hBoard, BFRegName(m_hBoard, RegId, nameBuf, (BFU32)nameBufSize) );
1574 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFU32 BufferInterface::bfRegPeek ( const BFU32  RegId) const

Peek the value at the given frame grabber register index.

Parameters
[in]RegId- The BitFlow board register index
Returns
The value of the board register.

References m_hBoard.

1612 {
1613  return BFRegPeek(m_hBoard, RegId);
1614 }
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::bfRegPoke ( const BFU32  RegId,
const BFU32  Value 
)

Poke the value at the given frame grabber register index.

Parameters
[in]RegId- The BitFlow board register index
[in]Value- The value to write to the board register.
Exceptions
BFCiException- Thrown if there is a problem writing to the board register. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), and m_hBoard.

1627 {
1628  BFCiException::check(m_hBoard, BFRegPoke(m_hBoard, RegId, Value) );
1629 }
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFU32 BufferInterface::boardCount ( BFVOID  )
static

Return the number of boards installed on the system.

Returns
The number of BitFlow boards installed on the system.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_CIERROR_CISYSBRDENUM, and BiException::check().

77 {
78  BFU32 count;
79  if (BF_OK != CiSysBrdEnum(CISYS_TYPE_ANY, &count))
81  return count;
82 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Definition: BiError.h:371
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
BFVOID BufferInterface::clearBuffers ( BFVOID  )

Clears the buffers's contents by writing zeros to all buffers. Buffers must be allocated in memory before calling this method.

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

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

1172 {
1173  if(!isSetup)
1175 
1176  // Call buffer clear only when setup has been called
1177  BiException::check(m_hBoard, BiBufferClear(m_hBoard, &m_BufferArray) );
1178 }
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 BufferInterface::close ( BFVOID  )

Closes the board and frees all associated resources.

References m_hBoard, m_pCam, and unloadCamFile().

Referenced by BufferAcquisition::CircularInterface::CircularInterface(), open(), openSWConnector(), BufferAcquisition::SequenceInterface::SequenceInterface(), ~BufferInterface(), BufferAcquisition::CircularInterface::~CircularInterface(), and BufferAcquisition::SequenceInterface::~SequenceInterface().

337 {
338  if (m_pCam)
339  unloadCamFile();
340  if (m_hBoard)
341  BiBrdClose(m_hBoard);
342 
343  m_pd.atClose();
344 }
PBFCNF m_pCam
Definition: BufferInterface.h:289
BFVOID unloadCamFile(BFVOID)
Definition: BufferInterface.cpp:1329
Bd m_hBoard
Definition: BufferInterface.h:283
BFSIZET BufferInterface::cxpReadData ( const BFU32  address,
const BFU32  bytesToRead,
std::vector< BFU8 > &  dataOut 
) const

Read the values from a sequence of CoaXPress registers, returning the length of data read.

Parameters
[in]address- The register address on the connected CXP camera to read from.
[in]bytesToRead- The number of bytes to be read.
[out]dataOut- Output buffer of the data read, resized to fit the data, if necessary
Returns
The number of bytes actually read.
Exceptions
BFCiExceptionthrown if the data read operation fails.

Referenced by cxpReadData().

1414 {
1415  return cxpReadData(0xFF, address, bytesToRead, dataOut);
1416 }
BFSIZET cxpReadData(const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
Definition: BufferInterface.cpp:1413
BFSIZET BufferInterface::cxpReadData ( const BFU32  address,
const BFU32  bytesToRead,
BFU8 *const  dataOut,
const BFSIZET  dataOutSize 
) const

Read the values from a sequence of CoaXPress registers, returning the length of data read. Store as much of the output data as can be in the dataOut buffer, dropping any data that won't fit.

Parameters
[in]address- The register address on the connected CXP camera to read from.
[in]bytesToRead- The number of bytes to be read.
[out]dataOut- Output buffer of the data read. Filled as much as possible, given the dataOutSize.
[in]dataOutSize- Byte size of the dataOut buffer.
Returns
The number of bytes actually read.
Exceptions
BFCiExceptionthrown if the data read operation fails.

References cxpReadData().

1434 {
1435  return cxpReadData(0xFF, address, bytesToRead, dataOut, dataOutSize);
1436 }
BFSIZET cxpReadData(const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
Definition: BufferInterface.cpp:1413
BFSIZET BufferInterface::cxpReadData ( const BFU32  link,
const BFU32  address,
const BFU32  bytesToRead,
std::vector< BFU8 > &  dataOut 
) const

Read the values from a sequence of CoaXPress registers, returning the length of data read.

Parameters
[in]link- The camera link to read from.
[in]address- The register address on the connected CXP camera to read from.
[in]bytesToRead- The number of bytes to be read.
[out]dataOut- Output buffer of the data read, resized to fit the data, if necessary
Returns
The number of bytes actually read.
Exceptions
BFCiExceptionthrown if the data read operation fails.

References cxpReadData().

1452 {
1453  // Round the vector size up to the nearest 32-bit WORD byte-size.
1454  const size_t minimumDataSize = (bytesToRead + 3) & ~3u;
1455  if (dataOut.size() < minimumDataSize)
1456  dataOut.resize(minimumDataSize);
1457 
1458  return cxpReadData(link, address, bytesToRead, dataOut.data(), dataOut.size());
1459 }
BFSIZET cxpReadData(const BFU32 address, const BFU32 bytesToRead, std::vector< BFU8 > &dataOut) const
Definition: BufferInterface.cpp:1413
BFSIZET BufferInterface::cxpReadData ( const BFU32  link,
const BFU32  address,
const BFU32  bytesToRead,
BFU8 *const  dataOut,
const BFSIZET  dataOutSize 
) const

Read the values from a sequence of CoaXPress registers, returning the length of data read. Store as much of the output data as can be in the dataOut buffer, dropping any data that won't fit.

Parameters
[in]link- The camera link to read from.
[in]address- The register address on the connected CXP camera to read from.
[in]bytesToRead- The number of bytes to be read.
[out]dataOut- Output buffer of the data read. Filled as much as possible, given the dataOutSize.
[in]dataOutSize- Byte size of the dataOut buffer.
Returns
The number of bytes actually read.
Exceptions
BFCiExceptionthrown if the data read operation fails.

References BFCiException::check(), and m_hBoard.

1478 {
1479  BFU32 bytesRead;
1480  BFCiException::check(m_hBoard, BFCXPReadData(m_hBoard, link, address, bytesToRead, &bytesRead, dataOut, dataOutSize) );
1481  return bytesRead;
1482 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFU32 BufferInterface::cxpReadReg ( const BFU32  address) const

Read the value of a single CoaXPress register.

Parameters
[in]address- The register address on the connected CXP camera to read from.
Returns
The value stored at the specified address.
Exceptions
BFCiExceptionthrown if the register read operation fails.
1353 {
1354  return cxpReadReg(0xFF, address);
1355 }
BFU32 cxpReadReg(const BFU32 address) const
Definition: BufferInterface.cpp:1352
BFU32 BufferInterface::cxpReadReg ( const BFU32  link,
const BFU32  address 
) const

Read the value of a single CoaXPress register.

Parameters
[in]link- The camera link to read from.
[in]address- The register address on the connected CXP camera to read from.
Returns
The value stored at the specified address.
Exceptions
BFCiExceptionthrown if the register read operation fails.

References BFCiException::check(), and m_hBoard.

1368 {
1369  BFU32 value;
1370  BFCiException::check(m_hBoard, BFCXPReadReg(m_hBoard, link, address, &value) );
1371  return value;
1372 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID BufferInterface::cxpWriteData ( const BFU32  address,
std::vector< BFU8 > const &  dataIn 
)

Write data to a sequence of CoaXPress registers.

Parameters
[in]address- The register address on the connected CXP camera to write to.
[in]dataIn- The input data buffer, specifying the data to be written.
Exceptions
BFCiExceptionthrown if the data write operation fails.

Referenced by cxpWriteData().

1493 {
1494  cxpWriteData(0xFF, address, dataIn.data(), dataIn.size());
1495 }
BFVOID cxpWriteData(const BFU32 address, std::vector< BFU8 > const &dataIn)
Definition: BufferInterface.cpp:1492
BFVOID BufferInterface::cxpWriteData ( const BFU32  address,
const BFU8 *const  dataIn,
const BFSIZET  dataInSize 
)

Write data to a sequence of CoaXPress registers.

Parameters
[in]address- The register address on the connected CXP camera to write to.
[in]dataIn- The input data buffer, specifying the data to be written.
[in]dataInSize- The number of bytes from dataIn that are to be written. This should be no bigger than the physical byte size of dataIn.
Exceptions
BFCiExceptionthrown if the data write operation fails.

References cxpWriteData().

1508 {
1509  cxpWriteData(0xFF, address, dataIn, dataInSize);
1510 }
BFVOID cxpWriteData(const BFU32 address, std::vector< BFU8 > const &dataIn)
Definition: BufferInterface.cpp:1492
BFVOID BufferInterface::cxpWriteData ( const BFU32  link,
const BFU32  address,
std::vector< BFU8 > const &  dataIn 
)

Write data to a sequence of CoaXPress registers.

Parameters
[in]link- The camera link to write on.
[in]address- The register address on the connected CXP camera to write to.
[in]dataIn- The input data buffer, specifying the data to be written.
Exceptions
BFCiExceptionthrown if the data write operation fails.

References cxpWriteData().

1522 {
1523  cxpWriteData(link, address, dataIn.data(), dataIn.size());
1524 }
BFVOID cxpWriteData(const BFU32 address, std::vector< BFU8 > const &dataIn)
Definition: BufferInterface.cpp:1492
BFVOID BufferInterface::cxpWriteData ( const BFU32  link,
const BFU32  address,
const BFU8 *const  dataIn,
const BFSIZET  dataInSize 
)

Write data to a sequence of CoaXPress registers.

Parameters
[in]link- The camera link to write on.
[in]address- The register address on the connected CXP camera to write to.
[in]dataIn- The input data buffer, specifying the data to be written.
[in]dataInSize- The number of bytes from dataIn that are to be written. This should be no bigger than the physical byte size of dataIn.
Exceptions
BFCiExceptionthrown if the data write operation fails.

References BFCiException::check(), and m_hBoard.

1538 {
1539  BFCiException::check(m_hBoard, BFCXPWriteData(m_hBoard, link, address, const_cast<BFU8*>(dataIn), (BFU32)dataInSize) );
1540 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID BufferInterface::cxpWriteReg ( const BFU32  address,
const BFU32  value 
)

Write the value of a single CoaXPress register.

Parameters
[in]address- The register address on the connected CXP camera to write to.
[in]value- The value to be written.
Exceptions
BFCiExceptionthrown if the register write operation fails.
1383 {
1384  cxpWriteReg(0xFF, address, value);
1385 }
BFVOID cxpWriteReg(const BFU32 address, const BFU32 value)
Definition: BufferInterface.cpp:1382
BFVOID BufferInterface::cxpWriteReg ( const BFU32  link,
const BFU32  address,
const BFU32  value 
)

Write the value of a single CoaXPress register.

Parameters
[in]link- The camera link to write on.
[in]address- The register address on the connected CXP camera to write to.
[in]value- The value to be written.
Exceptions
BFCiExceptionthrown if the register write operation fails.

References BFCiException::check(), and m_hBoard.

1397 {
1398  BFCiException::check(m_hBoard, BFCXPWriteReg(m_hBoard, link, address, value) );
1399 }
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFBOOL BufferInterface::enumerateCameraMode ( const BFSIZET  index,
BFCHAR *const  modeBuf,
BFSIZET *const  pModeSize,
BFCHAR *const  descBuf,
BFSIZET *const  pDescSize 
) const

Iteratively retrieve a each mode supported by the current camera file. R64 and older board models to not support multi-mode camera files.

Parameters
[in]index- Mode index to enumerate.
[out]modeBuf- Output buffer for the mode name, filled as completely as possible. This may be nullptr.
[in,out]pModeSize- As input, the size of the modeBuf (if not nullptr). As output, the buffer size required to retrieve the entire mode name string.
[out]descBuf- Output buffer for the mode description, filled as completely as possible. This may be nullptr.
[in,out]pDescSize- As input, the size of the descBuf (if not nullptr). As output, the buffer size required to retrieve the entire description string.
Returns
True on success, false otherwise.
Exceptions
BiException- Thrown if the current camera cannot be opened. Use the showErrorMsg method to get information on the thrown exception.

References enumerateCameraModes().

426 {
427  std::vector<std::string> modes, descs;
428  const BFSIZET modeCnt = enumerateCameraModes(modes, descs);
429 
430  if (index >= modeCnt)
431  return false;
432 
433  if (!BufInHelpers::set_str(modes[index], modeBuf, pModeSize))
434  return false;
435 
436  if (!BufInHelpers::set_str(descs[index], descBuf, pDescSize))
437  return false;
438 
439  return true;
440 }
BFSIZET enumerateCameraModes(std::vector< std::string > &modes, std::vector< std::string > &descriptions=std::vector< std::string >()) const
Definition: BufferInterface.cpp:382
size_t BFSIZET
Definition: BFTypeNT.h:93
BFSIZET BufferInterface::enumerateCameraModes ( std::vector< std::string > &  modes,
std::vector< std::string > &  descriptions = std::vector<std::string>() 
) const

Retrieve a list of modes supported by the current camera file, returning the number of modes determined. R64 and older board models to not support multi-mode camera files.

Parameters
[out]modes- Ouput vector filled with the mode names available.
[out]descriptions- Output vector filled with descriptions of the corresponding modes.
Returns
The number of modes available.
Exceptions
BiException- Thrown if the current camera cannot be opened. Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), m_BufferArray, m_hBoard, and MAX_STRING.

Referenced by enumerateCameraMode().

383 {
384  // Get the current camera handle.
385  PBFCNF currentCam;
386  BiException::check(m_hBoard, BiCamGetCur(m_hBoard, &m_BufferArray, &currentCam) );
387 
388  // Working variables.
389  BFCHAR mode [MAX_STRING], desc [MAX_STRING];
390  std::vector<std::string> mTmp, dTmp;
391 
392  // Retrieve all modes. Assume that a CiCamModesEnum error simply indicates that modes
393  // aren't supported, and continue without fuss.
394  while (CiCamModesEnum(m_hBoard, currentCam, BFU32(mTmp.size()), mode, sizeof(mode), desc, sizeof(desc)) == BF_OK && mode[0])
395  {
396  mTmp.push_back(mode);
397  dTmp.push_back(desc);
398  }
399 
400  // Return the modes and descriptions retrieved.
401  modes = std::move(mTmp);
402  descriptions = std::move(dTmp);
403  return modes.size();
404 }
char BFCHAR
Definition: BFTypeNT.h:33
unsigned long BFU32
Definition: BFTypeNT.h:55
BIBA m_BufferArray
Definition: BufferInterface.h:286
#define MAX_STRING
Definition: BFType.h:65
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
PBFVOID PBFCNF
Definition: BFType.h:97
BFBOOL BufferInterface::getAbortAcqFlag ( BFVOID  ) const

Returns the status of the abort acquisition flag.

Returns
If TRUE, the abort command has been issued.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

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

802 {
803  BFBOOL start, stop, abort, pause, cleanup;
804 
805  if(!isSetup)
807 
808  BiException::check(m_hBoard, BiControlStatusGet(m_hBoard, &m_BufferArray, &start, &stop, &abort, &pause, &cleanup) );
809  return abort;
810 }
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
int BFBOOL
Definition: BFTypeNT.h:34
Bd BufferAcquisition::BufferInterface::getBoardHandle ( BFVOID  ) const
inline

Returns the board handle. This will be useful when using other BitFlow APIs.

Returns
Returns the board handle.

Referenced by BFGTLUtilities::Device::open().

107  {
108  return m_hBoard;
109  }
Bd m_hBoard
Definition: BufferInterface.h:283
BFU32 BufferInterface::getBoardNumber ( BFVOID  ) const

Return the opened board number. Returns ~BFU32(0), if the board isn't open, or wasn't opened with a board number (see getBoardSWConnector).

Returns
The board number of the opened board, or ~BFU32(0), if no board is opened.
353 {
354  return m_pd.boardNumber;
355 }
BFVOID BufferInterface::getBoardSWConnector ( BFU32 Switch,
BFU32 Connector 
)

Retrieve the opened board switch and connector. Retrieves ~BFU32(0), if the board isn't open, or wasn't opened with openSWConnector (see getBoardNumber).

Returns
The switch setting and connector index that were used to open the board, or ~BFU32(0), if no board is opened.
365 {
366  Switch = m_pd.boardSwitch;
367  Connector = m_pd.boardConnector;
368 }
BFU32 BufferInterface::getBrdInfo ( const BFU32  brdInqVar) const

Inquires about the system characteristics of the board.

Parameters
[in]brdInqVar- charactersitic to find the value of. Can be one of the following:
BiBrdInqModel - returns the board model.
BiBrdInqIDReg - returns the current setting of the ID switch on the board.
BiBrdInqLUT - returns the type of LUT on the board.
BiCamInqXSize - returns the width of the image in pixels.
BiCamInqYSize0 - returns the height of the image in lines.
BiCamInqFormat - returns the image format.
BiCamInqBitsPerPix - returns the pixel depth in bits, as acquired to host.
BiCamInqBytesPerPix - returns the pixel depth in bytes, as acquired to host.
BiCamInqAqTimeout - returns the timeout value in the attached camera file.
BiCamInqFrameSize0 - returns the image size in bytes, as acquired to host.
BiCamInqFrameWidth - returns the width of the image in bytes, as acquired to host.
BiCamInqBytesPerPixDisplay - returns the pixel depth in bytes, as acquired to display.
BiCamInqBitsPerPixDisplay - returns the pixel depth in bits, as acquired to display.
BiCamInqDisplayFrameSize0 - returns the image size in bytes, as acquired to display.
BiCamInqDisplayFrameWidth -returns the width of the image in bytes, as acquired to display.
Not all parameters will work for all model boards. Please refer to the BitFlow SDK documentation for more information.
Returns
Returns the value of the characteristic that was asked for.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
BiSimplePlusPlus.cpp, CircClassExample.cpp, and CircHoldSimple.cpp.

References BiException::check(), and m_hBoard.

704 {
705  BFU32 value;
706  BiException::check(m_hBoard, BiBrdInquire(m_hBoard, brdInqVar, &value) );
707  return value;
708 }
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
PBFU32 * BufferInterface::getBufferArrayPointers ( BFVOID  )

Returns a pointer to the array of buffer pointers.

Returns
Returns a pointer to an array of pointers that point to each of the buffers.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
BiSimplePlusPlus.cpp.

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

644 {
645  PBFU32 *pBufferArray;
646 
647  if(!isSetup)
649 
650  BiException::check(m_hBoard, BiBufferArrayGet(m_hBoard, &m_BufferArray, &pBufferArray) );
651 
652  return pBufferArray;
653 }
unsigned long * PBFU32
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
const PBFU32 * BufferInterface::getBufferArrayPointers ( BFVOID  ) const

Returns a pointer to the array of buffer pointers.

Returns
Returns a constant pointer to an array of pointers that point to each of the buffers.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

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

665 {
666  PBFU32 *pBufferArray;
667 
668  if(!isSetup)
670 
671  BiException::check(m_hBoard, BiBufferArrayGet(m_hBoard, &m_BufferArray, &pBufferArray) );
672 
673  return pBufferArray;
674 }
unsigned long * PBFU32
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 BufferInterface::getBufferQueueSize ( BFVOID  ) const

Returns the number of buffers that have been stored to the buffer queue. As buffers are added to the queue, the count increments. As buffers are removed from the queue, the count decrements. When in CirErIgnore error mode, the NumFrames returned will be the total number frames that were on the queue.

References BiException::check(), m_BufferArray, and m_hBoard.

1239 {
1240  BFU32 NumFrames;
1241 
1242  BiException::check(m_hBoard, BiBufferQueueSize(m_hBoard, &m_BufferArray, &NumFrames));
1243 
1244  return NumFrames;
1245 }
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
Bd m_hBoard
Definition: BufferInterface.h:283
std::string BufferInterface::getCameraMode ( BFVOID  ) const

Get the current camera mode's name. R64 and older board models do not support camera modes.

Returns
The name of the current camera mode.
Exceptions
BFCiException- Thrown if the current camera mode cannot be determined. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), m_hBoard, and MAX_STRING.

Referenced by getCameraMode().

451 {
452  BFCHAR modeName [MAX_STRING];
453  BFCiException::check(m_hBoard, CiCamModeGet(m_hBoard, modeName, sizeof(modeName)) );
454 
455  return modeName;
456 }
char BFCHAR
Definition: BFTypeNT.h:33
#define MAX_STRING
Definition: BFType.h:65
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFBOOL BufferInterface::getCameraMode ( BFCHAR *const  modeBuf,
BFSIZET *const  pModeSize 
) const

Get the current camera mode's name. R64 and older board models do not support camera modes.

Parameters
[out]modeBuf- Output buffer for the mode name, filled as completely as possible. This may be nullptr.
[in,out]pModeSize- As input, the size of the modeBuf (if not nullptr). As output, the buffer size required to retrieve the entire mode name string.
Returns
True, if the read succeeded, false otherwise.
Exceptions
BFCiException- Thrown if the current camera mode cannot be determined. Use the showErrorMsg method to get information on the thrown exception.

References getCameraMode().

472 {
473  return BufInHelpers::set_str(getCameraMode(), modeBuf, pModeSize);
474 }
std::string getCameraMode(BFVOID) const
Definition: BufferInterface.cpp:450
BFBOOL BufferInterface::getCleanupAcqFlag ( BFVOID  ) const

Returns the status of the cleanup acquisition flag.

Returns
If TRUE, cleanup has has been called.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

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

840 {
841  BFBOOL start, stop, abort, pause, cleanup;
842 
843  if(!isSetup)
845 
846  BiException::check(m_hBoard, BiControlStatusGet(m_hBoard, &m_BufferArray, &start, &stop, &abort, &pause, &cleanup) );
847  return cleanup;
848 }
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
int BFBOOL
Definition: BFTypeNT.h:34
std::string BufferInterface::getErrorText ( const BFU32  errorNumber) const

Returns a text description of the error that occured.

Parameters
[in]errorNumber- The error number to get the error text for.
Returns
The error message text.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_BUFFER_TOO_SMALL, and BiException::check().

1191 {
1192  std::vector<char> errTxt (256);
1193 
1194  BFU32 errTxtSize = (BFU32)errTxt.size();
1195  BFU32 rc = BiErrorTextGet(0, errorNumber, errTxt.data(), &errTxtSize);
1196 
1197  if (BI_ERROR_BUFFER_TOO_SMALL == rc)
1198  {
1199  errTxt.resize(++errTxtSize);
1200  rc = BiErrorTextGet(0, errorNumber, errTxt.data(), &errTxtSize);
1201  }
1202 
1203  BiException::check(0, rc);
1204 
1205  errTxt.push_back(0);
1206  return errTxt.data();
1207 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Definition: BiError.h:330
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
BFVOID BufferInterface::getErrorText ( const BFU32  errorNumber,
PBFCHAR  errorText,
const PBFU32  errorTextSize 
) const

Returns a text description of the error that occured.

Parameters
[in]errorNumber- The error number to get the error text for.
[out]errorText- The pointer to the users allocated buffer that will store the text error message.
[in,out]errorTextSize- As an input, this parameter is the number of bytes that errorText buffer can hold. As an output, the paramerter is overwritten with the number of bytes written to the errorText buffer when successful or the number of bytes the buffer needs to be to hold the full message if the buffer is too small.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check().

1227 {
1228  BiException::check(0, BiErrorTextGet(0, errorNumber, errorText, errorTextSize) );
1229 }
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
BFVOID BufferInterface::getExposureControl ( BFDOUBLE ExposurePeriod,
BFDOUBLE LineFramePeriod,
BFU32 TriggerMode,
BFBOOL AssertedHigh,
BFU32 OutputSignal 
) const

Retrieve the current configuration of the New Timing Generator (NTG).

Parameters
[out]ExposurePeriod- The exposure period in milliseconds.
[out]LineFramePeriod- The line/frame rate in milliseconds.
[out]TriggerMode- The trigger mode, which may be one of the following:
BFNTGModeFreeRun - Timing generator is free running.
BFNTGModeOneShotTrigger - Timing generator is in one-shot mode, triggered by the board’s trigger input.
BFNTGModeOneShotEncoder - Timing generator is in one-shot mode, triggered by the board’s encoder input.
[out]AssertedHigh- Whether the trigger is to assert high (true), or low (false).
[out]OutputSignal- The outputs that the waveform will be sent to. Any of the following may be ORd together:
For the Karbon-CL/Neon/Alta:
BFNTGOutputCC1 - Output on the CC1 signal on CL connector.
BFNTGOutputCC2 - Output on the CC2 signal on CL connector.
BFNTGOutputCC3 - Output on the CC3 signal on CL connector.
BFNTGOutputCC4 - Output on the CC4 signal on CL connector.
BFNTGOutputGP0 - Output on GPOUT0 on the I/O connector.
BFNTGOutputGP1 - Output on GPOUT1 on the I/O connector.
BFNTGOutputGP2 - Output on GPOUT2 on the I/O connector.
BFNTGOutputGP3 - Output on GPOUT3 on the I/O connector.
BFNTGInputTrig - Output goes to Trigger input.
BFNTGInputEncA - Output goes to Encoder A input.
For the Karbon-CXP and Cyton-CXP:
BFNTGOutputCC1 - Output on the CC1 signal on CL connector.
BFNTGOutputCC2 - Output on the CC2 signal on CL connector.
BFNTGOutputCC3 - Output on the CC3 signal on CL connector.
BFNTGOutputCC4 - Output on the CC4 signal on CL connector.
BFNTGInputTrig - Output goes to Trigger input.
BFNTGInputEncA - Output goes to Encoder A input.
BFNTGInputEncB - Output goes to Encoder B input.
Exceptions
BFCiException- Thrown if the exposure control state couldn't be retrieved. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), and m_hBoard.

630 {
631  BFCiException::check(m_hBoard, CiConExposureControlGet(m_hBoard, &ExposurePeriod, &LineFramePeriod, &TriggerMode, &AssertedHigh, &OutputSignal) );
632 }
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFU32 BufferInterface::getMajorVersion ( BFVOID  )
static

Returns the major version of the Bi API.

Returns
Returns the major version of the Bi API.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check().

859 {
860  BFU32 majorVersion, minorVersion;
861 
862  BiException::check(0, BiDVersion(&majorVersion, &minorVersion) );
863 
864  return majorVersion;
865 }
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
BFU32 BufferInterface::getMinorVersion ( BFVOID  )
static

Returns the minor version of the Bi API.

Returns
Returns the minor version of the Bi API.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check().

876 {
877  BFU32 majorVersion, minorVersion;
878 
879  BiException::check(0, BiDVersion(&majorVersion, &minorVersion) );
880 
881  return minorVersion;
882 }
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
BFU32 BufferInterface::getNumFramesCaptured ( BFVOID  ) const

Returns the number of frames that have been captured the moment the method is called.

Returns
Returns the number of frames that have been captured at the time the method was called.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
BiSimplePlusPlus.cpp.

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

721 {
722  BFU32 framesCaptured=0, framesMissed=0;
723 
724  if(!isSetup)
726 
727  BiException::check(m_hBoard, BiCaptureStatusGet(m_hBoard, &m_BufferArray, &framesCaptured, &framesMissed) );
728 
729  return framesCaptured;
730 }
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 BufferInterface::getNumFramesMissed ( BFVOID  ) const

Returns the number of frames that have been missed by acquisition the moment the method is called. Under normal circomstances this method should return 0.

Returns
Returns the number of frames that have been missed at the time the method was called.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
BiSimplePlusPlus.cpp.

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

744 {
745  BFU32 framesCaptured=0, framesMissed=0;
746 
747  if(!isSetup)
749 
750  BiException::check(m_hBoard, BiCaptureStatusGet(m_hBoard, &m_BufferArray, &framesCaptured, &framesMissed) );
751 
752  return framesMissed;
753 }
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
BFBOOL BufferInterface::getPauseAcqFlag ( BFVOID  ) const

Returns the status of the pause acquisition flag.

Returns
If TRUE, the pause command has been issued.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

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

821 {
822  BFBOOL start, stop, abort, pause, cleanup;
823 
824  if(!isSetup)
826 
827  BiException::check(m_hBoard, BiControlStatusGet(m_hBoard, &m_BufferArray, &start, &stop, &abort, &pause, &cleanup) );
828  return pause;
829 }
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
int BFBOOL
Definition: BFTypeNT.h:34
BFBOOL BufferInterface::getStartAcqFlag ( BFVOID  ) const

Returns the status of the start acquisition flag.

Returns
If TRUE, the start command has been issued.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

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

764 {
765  BFBOOL start, stop, abort, pause, cleanup;
766 
767  if(!isSetup)
769 
770  BiException::check(m_hBoard, BiControlStatusGet(m_hBoard, &m_BufferArray, &start, &stop, &abort, &pause, &cleanup) );
771  return start;
772 }
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
int BFBOOL
Definition: BFTypeNT.h:34
BFBOOL BufferInterface::getStopAcqFlag ( BFVOID  ) const

Returns the status of the stop acquisition flag.

Returns
If TRUE, the stop command has been issued.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

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

783 {
784  BFBOOL start, stop, abort, pause, cleanup;
785 
786  if(!isSetup)
788 
789  BiException::check(m_hBoard, BiControlStatusGet(m_hBoard, &m_BufferArray, &start, &stop, &abort, &pause, &cleanup) );
790  return stop;
791 }
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
int BFBOOL
Definition: BFTypeNT.h:34
BFU32 BufferInterface::getTriggerMode ( BFVOID  ) const

Returns the trigger mode being used by the board.

Returns
The returned trigger modes can be one of the following:
BiTrigFreeRun - No trigger, board free runs. The board is a slave to the camera.
BiTrigContinuousData - No LEN or FEN the board streams data.
BiTrigOneShot - One image is captured for each trigger. For asynchronously resettable cameras.
BiTrigOneShotStartStop - Acquisition begins on a rising or falling edge, then ends on a falling or rising edge respcetfully.
BiTrigOneShotStartAStopB - Acquisition begins with trigger A and ends with trigger B.
BiTrigAqCmd - Acquires images based on the snap and grab command along with the trigger. If a snap is issued, one frame will be acquired with a trigger. If a grab is issued, continuous frames will be acquired with a trigger.
BiTrigOneShotSelfTrig - The board self triggers in one-shot mode. Similar to free run mode except the board is controling the camera.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), and m_hBoard.

940 {
941  BFU32 trigMode;
942  BFU32 trigPolarity;
943 
944  BiException::check(m_hBoard, BiTrigModeGet(m_hBoard, &trigMode, &trigPolarity) );
945  return trigMode;
946 }
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
BFU32 BufferInterface::getTriggerPolarity ( BFVOID  ) const

Returns the trigger polarity being used by the board.

Returns
The returned trigger modes can be one of the following:
BiTrigAssertedHigh - Trigger A and B are asserted on rising edge.
BiTrigAssertedLow - Trigger A and B are asserted on falling edge.
BiTrigAHighBLow - Trigger A is asserted on rising edge, B on falling edge.
BiTrigALowBHigh - Trigger A is asserted on falling edge, B on rising edge.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), and m_hBoard.

961 {
962  BFU32 trigMode;
963  BFU32 trigPolarity;
964 
965  BiException::check(m_hBoard, BiTrigModeGet(m_hBoard, &trigMode, &trigPolarity) );
966  return trigPolarity;
967 }
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
BFBOOL BufferInterface::isBoardOpen ( BFVOID  ) const

Check the board open state.

Returns
Whether or not the board has been opened.

References isOpen.

1637 {
1638  return isOpen;
1639 }
BFBOOL isOpen
Definition: BufferInterface.h:294
BFBOOL BufferInterface::isBoardSetup ( BFVOID  ) const

Check the board setup state.

Returns
Whether the board has been setup.

References isSetup.

1647 {
1648  return isSetup;
1649 }
BFBOOL isSetup
Definition: BufferInterface.h:293
BFVOID BufferInterface::issueSoftwareTrigger ( const BFU32  trigMode = BiTrigAssertTrigA)

This function performs a software trigger.

Parameters
[in]trigMode- Can be one of the following:
BiTrigAssertTrigA - Trigger A is asserted on a rising edge.
BiTrigAssertTrigB - Trigger B is asserted on a rising edge.
BiTrigDeassertTrigA - Trigger A is asserted on a falling edge.
BiTrigDeassertTrigB - Trigger B is asserted on a falling edge.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), and m_hBoard.

982 {
983  BiException::check(m_hBoard, BiTrigForce(m_hBoard, trigMode) );
984 }
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::loadCamFile ( std::string const &  camFileName)

This method loads the specified camera file so the board will acquire images using that camera file, telling the board to use the specified camera file. After loading the camera file, Setup should be called and the new camera file will be used. This method can not be called if the board is already setup with another camera file. The unloadCamFile can be used to free resources allocated by this method.

Parameters
[in]camFileName- The name of the camera file with no path. The Camera Configuration path will be searched for the camera file.
Exceptions
BiException- Thrown when an error occurs trying to load the camera file. Use the showErrorMsg method to get information on the thrown exception.

References BI_ERROR_ALREADY_SETUP, BI_OK, BiException::check(), isSetup, m_BufferArray, m_hBoard, m_pCam, and unloadCamFile().

Referenced by loadCamFile().

1280 {
1281  if(isSetup)
1283 
1284  if (m_pCam)
1285  unloadCamFile();
1286 
1287  std::vector<char> cFileName (camFileName.begin(), camFileName.end());
1288  cFileName.push_back(0);
1289 
1290  BiException::check(m_hBoard, BiCamOpen(m_hBoard, &m_BufferArray, cFileName.data(), &m_pCam) );
1291 
1292  const BFRC rv = BiCamSetCur(m_hBoard, &m_BufferArray, m_pCam, CiSysConfigure);
1293  if(rv != BI_OK)
1294  {
1295  BiCamClose(m_hBoard, &m_BufferArray, m_pCam);
1297  }
1298 }
Definition: BiError.h:343
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
PBFCNF m_pCam
Definition: BufferInterface.h:289
BFVOID unloadCamFile(BFVOID)
Definition: BufferInterface.cpp:1329
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:19
BFVOID BufferInterface::loadCamFile ( const BFCHAR *const  camFileName)

This method loads the specified camera file so the board will acquire images using that camera file, telling the board to use the specified camera file. After loading the camera file, Setup should be called and the new camera file will be used. This method can not be called if the board is already setup with another camera file. The unloadCamFile can be used to free resources allocated by this method.

Parameters
[in]camFileName- The name of the camera file with no path. The Camera Configuration path will be searched for the camera file.
Exceptions
BiException- Thrown when an error occurs trying to load the camera file. Use the showErrorMsg method to get information on the thrown exception.

References loadCamFile().

1317 {
1318  const std::string cppCamFileName (camFileName);
1319  loadCamFile(cppCamFileName);
1320 }
BFVOID loadCamFile(std::string const &camFileName)
Definition: BufferInterface.cpp:1279
BFVOID BufferInterface::open ( const BFU32  brdNumber)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. If a RoadRunner, Raven and R64 are installed in the system in that order, the RoadRunner is board number zero, the Raven board number 1 and R64 is board number 2.

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

References BiTypeAny, BiException::check(), close(), and m_hBoard.

Referenced by BufferAcquisition::CircularInterface::CircularInterface(), open(), and BufferAcquisition::SequenceInterface::SequenceInterface().

96 {
97  close();
98  BiException::check(0, BiBrdOpen(BiTypeAny, brdNumber, &m_hBoard) );
99  m_pd.boardNumber = brdNumber;
100  m_pd.atOpen();
101 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define BiTypeAny
Definition: BiDef.h:33
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::open ( const BFU32  brdNumber,
const BFU32  options 
)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. If a RoadRunner, Raven and R64 are installed in the system in that order, the RoadRunner is board number zero, the Raven board number 1 and R64 is board number 2.

Parameters
[in]brdNumber- Specifies the board number to open.
[in]options- Can be one or or'ed combinations of the following:
  • BFSysInitialize - Initialize the system.
  • BFSysExclusive - If not already open, open exclusively.
  • BFSysNoIntThread - Do not activate interrupt thread.
  • BFSysNoCameraOpen - Do not open any camera configurations.
  • BFSysNoAlreadyOpenMess - Supress already open warning message.
  • BFSysNoOpenErrorMess - Supress all error popups in open function.
  • BFSysSecondProcessOpen - Allow the board to be opened twice in the same process (includes some of the above modes).
  • BFSysAllowTwoOpens - Allow the board to be opened twic ein the same process, and initialized.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiTypeAny, BiException::check(), close(), and m_hBoard.

124 {
125  close();
126  BiException::check(0, BiBrdOpenEx(BiTypeAny, brdNumber, &m_hBoard, options) );
127  m_pd.boardNumber = brdNumber;
128  m_pd.atOpen();
129 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define BiTypeAny
Definition: BiDef.h:33
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::open ( const BFU32  brdNumber,
std::string const &  camFileName 
)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. This method is the same as the other overloaded open method, only rather than using the camera file selected in SysReg, the camera file passed into the method will be used.

Parameters
[in]brdNumber- Specifies the board number to open.
[in]camFileName- The name of the camera file for the board to use. If only the name of the camera file is used, the camera configuration path is searched for the camera file.(usually the Config folder under the SDK root.) If the full path along with the name used, that is where the file will try get the file from.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiTypeAny, BiException::check(), close(), and m_hBoard.

150 {
151  close();
152 
153  std::vector<char> cFileName (camFileName.begin(), camFileName.end());
154  cFileName.push_back(0);
155 
156  BiException::check(0, BiBrdOpenCam(BiTypeAny, brdNumber, &m_hBoard, cFileName.data()) );
157  m_pd.boardNumber = brdNumber;
158  m_pd.atOpen();
159 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define BiTypeAny
Definition: BiDef.h:33
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::open ( const BFU32  brdNumber,
const BFCHAR *const  camFileName 
)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. This method is the same as the other overloaded open method, only rather than using the camera file selected in SysReg, the camera file passed into the method will be used.

Parameters
[in]brdNumber- Specifies the board number to open.
[in]camFileName- The name of the camera file for the board to use. If only the name of the camera file is used, the camera configuration path is searched for the camera file.(usually the Config folder under the SDK root.) If the full path along with the name used, that is where the file will try get the file from.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References open().

180 {
181  const std::string cppCamFileName (camFileName);
182  open(brdNumber, cppCamFileName);
183 }
BFVOID open(const BFU32 brdNumber)
Definition: BufferInterface.cpp:95
BFVOID BufferInterface::open ( const BFU32  brdNumber,
std::string const &  camFileName,
const BFU32  options 
)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. This method is the same as the other overloaded open method, only rather than using the camera file selected in SysReg, the camera file passed into the method will be used. This method also allows the board to be opened with user specified options.

Parameters
[in]brdNumber- Specifies the board number to open.
[in]camFileName- The name of the camera file for the board to use. If only the name of the camera file is used, the camera configuration path is searched for the camera file.(usually the Config folder under the SDK root.) If the full path along with the name used, that is where the file will try get the file from.
[in]options- Can be one or or'ed combinations of the following:
  • BFSysInitialize - Initialize the system.
  • BFSysExclusive - If not already open, open exclusively.
  • BFSysNoIntThread - Do not activate interrupt thread.
  • BFSysNoCameraOpen - Do not open any camera configurations.
  • BFSysNoAlreadyOpenMess - Supress already open warning message.
  • BFSysNoOpenErrorMess - Supress all error popups in open function.
  • BFSysSecondProcessOpen - Allow the board to be opened twice in the same process (includes some of the above modes).
  • BFSysAllowTwoOpens - Allow the board to be opened twic ein the same process, and initialized.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiTypeAny, BiException::check(), close(), and m_hBoard.

215 {
216  close();
217 
218  std::vector<char> cFileName (camFileName.begin(), camFileName.end());
219  cFileName.push_back(0);
220 
221  BiException::check(0, BiBrdOpenCamEx(BiTypeAny, brdNumber, &m_hBoard, cFileName.data(), options) );
222  m_pd.boardNumber = brdNumber;
223  m_pd.atOpen();
224 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define BiTypeAny
Definition: BiDef.h:33
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::open ( const BFU32  brdNumber,
const BFCHAR *const  camFileName,
const BFU32  options 
)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. This method is the same as the other overloaded open method, only rather than using the camera file selected in SysReg, the camera file passed into the method will be used. This method also allows the board to be opened with user specified options.

Parameters
[in]brdNumber- Specifies the board number to open.
[in]camFileName- The name of the camera file for the board to use. If only the name of the camera file is used, the camera configuration path is searched for the camera file.(usually the Config folder under the SDK root.) If the full path along with the name used, that is where the file will try get the file from.
[in]options- Can be one or or'ed combinations of the following:
  • BFSysInitialize - Initialize the system.
  • BFSysExclusive - If not already open, open exclusively.
  • BFSysNoIntThread - Do not activate interrupt thread.
  • BFSysNoCameraOpen - Do not open any camera configurations.
  • BFSysNoAlreadyOpenMess - Supress already open warning message.
  • BFSysNoOpenErrorMess - Supress all error popups in open function.
  • BFSysSecondProcessOpen - Allow the board to be opened twice in the same process (includes some of the above modes).
  • BFSysAllowTwoOpens - Allow the board to be opened twic ein the same process, and initialized.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References open().

256 {
257  const std::string cppCamFileName (camFileName);
258  open(brdNumber, cppCamFileName, options);
259 }
BFVOID open(const BFU32 brdNumber)
Definition: BufferInterface.cpp:95
BFVOID BufferInterface::openSWConnector ( const BFU32  Switch,
const BFU32  Connector 
)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. This method is the same as the other overloaded open method, only selecting the board to open by its switch setting and connector index, rather than the systemwide board index.

Parameters
[in]Switch- State of the board switch. The first board found with this switch setting will be opened.
[in]Connector- Connector index to open on the appropriately switched board.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiTypeAny, BiException::check(), close(), and m_hBoard.

277 {
278  close();
279 
280  BiException::check(0, BiBrdOpenSWConnector(BiTypeAny, Switch, Connector, &m_hBoard) );
281 
282  m_pd.boardSwitch = Switch;
283  m_pd.boardConnector = Connector;
284 
285  m_pd.atOpen();
286 }
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
#define BiTypeAny
Definition: BiDef.h:33
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::openSWConnector ( const BFU32  Switch,
const BFU32  Connector,
const BFU32  options 
)

Opens a board for access. This method must be called before any other method. The board number refers to all model bitflow boards. This method is the same as the other overloaded open method, only selecting the board to open by its switch setting and connector index, rather than the systemwide board index. This method also allows the board to be opened with user specified options.

Parameters
[in]Switch- State of the board switch. The first board found with this switch setting will be opened.
[in]Connector- Connector index to open on the appropriately switched board.
[in]options- Can be one or or'ed combinations of the following:
  • BFSysInitialize - Initialize the system.
  • BFSysExclusive - If not already open, open exclusively.
  • BFSysNoIntThread - Do not activate interrupt thread.
  • BFSysNoCameraOpen - Do not open any camera configurations.
  • BFSysNoAlreadyOpenMess - Supress already open warning message.
  • BFSysNoOpenErrorMess - Supress all error popups in open function.
  • BFSysSecondProcessOpen - Allow the board to be opened twice in the same process (includes some of the above modes).
  • BFSysAllowTwoOpens - Allow the board to be opened twic ein the same process, and initialized.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BI_CIERROR_CIBRDOPEN, BI_CIERROR_CISYSBOARDFINDSWCONNECTOR, BiException::check(), close(), and m_hBoard.

315 {
316  close();
317 
318  CiENTRY entry;
319  BFRC rc = CiSysBoardFindSWConnector(CISYS_TYPE_ANY, Switch, Connector, &entry);
320  if (BF_OK != rc)
322 
323  rc = CiBrdOpen(&entry, &m_hBoard, options);
324  if (BF_OK != rc)
326 
327  m_pd.boardSwitch = Switch;
328  m_pd.boardConnector = Connector;
329 
330  m_pd.atOpen();
331 }
BFU32 BFRC
Definition: BFType.h:92
Definition: BiError.h:373
BFVOID close(BFVOID)
Definition: BufferInterface.cpp:336
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
Definition: BiError.h:372
BufferInterface::Properties const & BufferInterface::properties ( void  ) const

Retrieve a reference to the BufferInterface::Properties.

Returns
A reference to the BufferInterface::Properties.
1657 {
1658  return m_pd.m_properties;
1659 }
BFVOID BufferInterface::readSeqFile ( std::string const &  fileName,
const BFU32  firstBufNumber,
const BFU32  numBufs 
)

Reads image files into memory, that were saved with the writeSeqBuffer() method. File formats BMP, TIFF and AVI are supported for reading.

Parameters
[in]fileName- The file name of the first image file to read into memory. For multiple files, the XXXX portion of the file name will be incremented. The file name includes the file extension.
[in]firstBufNumber- The first buffer that the files on disk will be read into. If numBufs is greater than one, images will continue to be read into subsequent internal buffers. In order for multiple images to be read, they must have the format "prefixXXXX.ext", where XXX is a sequential number series.
[in]numBufs- The number of buffers to be read into.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), m_BufferArray, and m_hBoard.

Referenced by readSeqFile().

1132 {
1133  std::vector<char> cFileName (fileName.begin(), fileName.end());
1134  cFileName.push_back(0);
1135 
1136  BiException::check(m_hBoard, BiDiskBufRead(m_hBoard, &m_BufferArray, firstBufNumber, numBufs, cFileName.data()) );
1137 }
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
BFVOID BufferInterface::readSeqFile ( const BFCHAR *const  fileName,
const BFU32  firstBufNumber,
const BFU32  numBufs 
)

Reads image files into memory, that were saved with the writeSeqBuffer() method. File formats BMP, TIFF and AVI are supported for reading.

Parameters
[in]fileName- The file name of the first image file to read into memory. For multiple files, the XXXX portion of the file name will be incremented. The file name includes the file extension.
[in]firstBufNumber- The first buffer that the files on disk will be read into. If numBufs is greater than one, images will continue to be read into subsequent internal buffers. In order for multiple images to be read, they must have the format "prefixXXXX.ext", where XXX is a sequential number series.
[in]numBufs- The number of buffers to be read into.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References readSeqFile().

1159 {
1160  const std::string cppFileName (fileName);
1161  readSeqFile(cppFileName, firstBufNumber, numBufs);
1162 }
BFVOID readSeqFile(std::string const &fileName, const BFU32 firstBufNumber, const BFU32 numBufs)
Definition: BufferInterface.cpp:1131
BFVOID BufferInterface::setAcqFrameSize ( const BFU32  XSize,
const BFU32  YSize 
)

Set the size of the acquired frame.

Parameters
[in]XSize- The X-size (aka, width) to be used for the frame size.
[in]YSize- The Y-size (aka, height) to be used for the frame size.
Exceptions
BFCiException- Thrown if the frame size could not be set. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), and m_hBoard.

519 {
520  BFCiException::check(m_hBoard, CiAqFrameSize(m_hBoard, XSize, YSize, AqEngJ) );
521 }
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID BufferInterface::setAcqROI ( const BFU32  XOffset,
const BFU32  YOffset,
const BFU32  XSize,
const BFU32  YSize 
)

Set the Region Of Interest (ROI) of the acquired frame.

Parameters
[in]XOffset- The desired offset from the left image edge.
[in]YOffset- The desired offset from the top image edge.
[in]XSize- The X-size (aka, width) to be used for the ROI.
[in]YSize- The Y-size (aka, height) to be used for the ROI.
Exceptions
BFCiException- Thrown if the ROI could not be set. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), and m_hBoard.

535 {
536  BFCiException::check(m_hBoard, CiAqROISet(m_hBoard, XOffset, YOffset, XSize, YSize, AqEngJ) );
537 }
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID BufferInterface::setCameraMode ( std::string const &  modeName)

Set the current camera mode to that named. R64 and older board models do not support camera modes.

Parameters
[in]modeName- Name of the mode to be set as the current
Exceptions
BFCiException- Thrown if the specified camera mode could not be set. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), BiException::check(), m_BufferArray, and m_hBoard.

Referenced by setCameraMode().

485 {
486  PBFCNF currentCam;
487  BiException::check(m_hBoard, BiCamGetCur(m_hBoard, &m_BufferArray, &currentCam) );
488 
489  std::vector<char> mModeName (modeName.begin(), modeName.end());
490  mModeName.push_back(0);
491 
492  BFCiException::check(m_hBoard, CiCamModeSet(m_hBoard, currentCam, mModeName.data()) );
493 }
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
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
PBFVOID PBFCNF
Definition: BFType.h:97
BFVOID BufferInterface::setCameraMode ( const BFCHAR *const  modeName)

Set the current camera mode to that named. R64 and older board models do not support camera modes.

Parameters
[in]modeName- Name of the mode to be set as the current
Exceptions
BFCiException- Thrown if the specified camera mode could not be set. Use the showErrorMsg method to get information on the thrown exception.

References setCameraMode().

504 {
505  const std::string cppModeName (modeName);
506  setCameraMode(cppModeName);
507 }
BFVOID setCameraMode(std::string const &modeName)
Definition: BufferInterface.cpp:484
BFVOID BufferInterface::setExposureControl ( const BFDOUBLE  ExposurePeriod,
const BFDOUBLE  LineFramePeriod,
const BFU32  TriggerMode,
const BFBOOL  AssertedHigh,
const BFU32  OutputSignal 
)

Programs the New Timing Generator (NTG).

Parameters
[in]ExposurePeriod- The exposure period in milliseconds.
[in]LineFramePeriod- The line/frame rate in milliseconds.
[in]TriggerMode- The trigger mode, which may be one of the following:
BFNTGModeFreeRun - Timing generator is free running.
BFNTGModeOneShotTrigger - Timing generator is in one-shot mode, triggered by the board’s trigger input.
BFNTGModeOneShotEncoder - Timing generator is in one-shot mode, triggered by the board’s encoder input.
[in]AssertedHigh- Whether the trigger is to assert high (true), or low (false).
[in]OutputSignal- The outputs that the waveform will be sent to. Any of the following may be ORd together:
For the Karbon-CL/Neon/Alta:
BFNTGOutputCC1 - Output on the CC1 signal on CL connector.
BFNTGOutputCC2 - Output on the CC2 signal on CL connector.
BFNTGOutputCC3 - Output on the CC3 signal on CL connector.
BFNTGOutputCC4 - Output on the CC4 signal on CL connector.
BFNTGOutputGP0 - Output on GPOUT0 on the I/O connector.
BFNTGOutputGP1 - Output on GPOUT1 on the I/O connector.
BFNTGOutputGP2 - Output on GPOUT2 on the I/O connector.
BFNTGOutputGP3 - Output on GPOUT3 on the I/O connector.
BFNTGInputTrig - Output goes to Trigger input.
BFNTGInputEncA - Output goes to Encoder A input.
For the Karbon-CXP and Cyton-CXP:
BFNTGOutputCC1 - Output on the CC1 signal on CL connector.
BFNTGOutputCC2 - Output on the CC2 signal on CL connector.
BFNTGOutputCC3 - Output on the CC3 signal on CL connector.
BFNTGOutputCC4 - Output on the CC4 signal on CL connector.
BFNTGInputTrig - Output goes to Trigger input.
BFNTGInputEncA - Output goes to Encoder A input.
BFNTGInputEncB - Output goes to Encoder B input.
Exceptions
BFCiException- Thrown if the exposure control state couldn't be set. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), and m_hBoard.

590 {
591  BFCiException::check(m_hBoard, CiConExposureControlSet(m_hBoard, ExposurePeriod, LineFramePeriod, TriggerMode, AssertedHigh, OutputSignal) );
592 }
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID BufferInterface::setExTriggerConnect ( const CiTrigSelect  trigger = CiTrigA,
const BFU32  state = BFExTrigConnect 
)

Connect or disconnect the external hardware trigger circuitry.

Parameters
[in]trigger- The trigger to connect or disconnect.
[in]state- The state to set, connected or disconnected.
Exceptions
BFCiException- Thrown if the trigger connection state couldn't be set. Use the showErrorMsg method to get information on the thrown exception.

References BFCiException::check(), and m_hBoard.

550 {
551  BFCiException::check(m_hBoard, CiConExTrigConnect(m_hBoard, trigger, state) );
552 }
Bd m_hBoard
Definition: BufferInterface.h:283
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID BufferInterface::setTimeout ( const BFU32  TimeoutValue)

This method sets the timeout value for operations within the Buffer interface. These operations include, but are not limited to, waiting for frames, waiting for acquisition to start or abort, and waiting for active regions within a frame.

Parameters
[in]TimeoutValue- The timeout value to set.
Exceptions
BiException- Failed setting the timeout value.Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), m_BufferArray, and m_hBoard.

1259 {
1260  BiException::check(m_hBoard, BiInternalTimeoutSet(m_hBoard, &m_BufferArray, TimeoutValue) );
1261 }
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
BFVOID BufferInterface::setTriggerMode ( const BFU32  triggerMode = BiTrigFreeRun,
const BFU32  trigPolarity = BiTrigAssertedHigh 
)

Sets the trigger mode for the board.

Parameters
[in]triggerMode- The trigger mode to set the board too. Can be one of the following:
BiTrigFreeRun - No trigger, board free runs. The board is a slave to the camera.
BiTrigContinuousData - No LEN or FEN the board streams data.
BiTrigOneShot - One image is captured for each trigger. For asynchronously resettable cameras.
BiTrigOneShotStartStop - Acquisition begins on a rising or falling edge, then ends on a falling or rising edge respcetfully.
BiTrigOneShotStartAStopB - Acquisition begins with trigger A and ends with trigger B.
BiTrigAqCmd - Acquires images based on the snap and grab command along with the trigger. If a snap is issued, one frame will be acquired with a trigger. If a grab is issued, continuous frames will be acquired with a trigger.
BiTrigOneShotSelfTrig - The board self triggers in one-shot mode. Similar to free run mode except the board is controling the camera.
[in]trigPolarity- Sense of trigger A and B. Can be one of the following:
BiTrigAssertedHigh - Trigger A and B are asserted on rising edge.
BiTrigAssertedLow - Trigger A and B are asserted on falling edge.
BiTrigAHighBLow - Trigger A is asserted on rising edge, B on falling edge.
BiTrigALowBHigh - Trigger A is asserted on falling edge, B on rising edge.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), and m_hBoard.

914 {
915  BiException::check(m_hBoard, BiTrigModeSet(m_hBoard, triggerMode, trigPolarity) );
916 }
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
BFU32 BufferInterface::showError ( const BFU32  errorNum) const

Pops up a dialog displaying a text description of the error given by the errorNum parameter.

Parameters
[in]errorNum- The error number returned by a non-getXXX member function.
Returns
Returns one of the following:
BI_OK - The user clicked on the ok button on the dialog.
BI_CANCEL - The user clicked on the cancel button on the dialog.
Exceptions
BiException- An invalid error number was passed into the method.

References BI_ERROR_INVALID_ERR_NUM, BiException::check(), and m_hBoard.

1000 {
1001  const BFU32 rv = BiErrorShow( m_hBoard, errorNum );
1002 
1003  if (rv == BI_ERROR_INVALID_ERR_NUM)
1005 
1006  return rv;
1007 }
Definition: BiError.h:335
unsigned long BFU32
Definition: BFTypeNT.h:55
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:306
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::unloadCamFile ( BFVOID  )

Unloads and frees resources associated with the loadCamFile method.

Exceptions
BiException- Thrown when an error occurs trying to unload the camera file. Use the showErrorMsg method to get information on the thrown exception.

References BFNULL, m_BufferArray, m_hBoard, and m_pCam.

Referenced by close(), and loadCamFile().

1330 {
1331  if(m_pCam == BFNULL)
1332  return;
1333 
1334  BiCamSel(m_hBoard, &m_BufferArray, 0, 0);
1335 
1336  BiCamClose(m_hBoard, &m_BufferArray, m_pCam);
1337 
1338  m_pCam = BFNULL;
1339 }
BIBA m_BufferArray
Definition: BufferInterface.h:286
PBFCNF m_pCam
Definition: BufferInterface.h:289
#define BFNULL
Definition: BFType.h:61
Bd m_hBoard
Definition: BufferInterface.h:283
BFVOID BufferInterface::writeBuffer ( PBFCHAR  fileName,
const BFSIZET  fileNameSize,
const BFU32  bufferNumber,
const BFU32  options 
) const

Writes one buffer to a file on disk in the BMP, TIFF or RAW file format.

Parameters
[in]fileName- The file name to be saved to disk. The file name includes the file extension.
[in]fileNameSize- The size of the fileName buffer.
[in]bufferNumber- The number of the buffer to be written to disk.
[in]options- The options for saving a buffer to disk are:
SwapRGB - Swap the RGB format to BGR.
Pack32to24Bit - Save 32 bit color (RGBX) data to 24 bit (RGB).
BOTTOM_UP - Saves the data to disk upside down from what is being displayed.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References BiException::check(), m_BufferArray, and m_hBoard.

Referenced by writeBuffer().

1029 {
1030  BiException::check(m_hBoard, BiDiskBufWrite(m_hBoard, &m_BufferArray, bufferNumber, 1, fileName, fileNameSize, options) );
1031 }
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
BFVOID BufferInterface::writeBuffer ( std::string const &  fileName,
const BFU32  bufferNumber,
const BFU32  options 
) const

Writes one buffer to a file on disk in the BMP, TIFF or RAW file format.

Parameters
[in]fileName- The file name to be saved to disk. The file name includes the file extension.
[in]bufferNumber- The number of the buffer to be written to disk.
[in]options- The options for saving a buffer to disk are:
SwapRGB - Swap the RGB format to BGR.
Pack32to24Bit - Save 32 bit color (RGBX) data to 24 bit (RGB).
BOTTOM_UP - Saves the data to disk upside down from what is being displayed.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References writeBuffer().

1050 {
1051  std::vector<BFCHAR> cFileName (fileName.begin(), fileName.end());
1052  cFileName.push_back(0);
1053 
1054  writeBuffer(cFileName.data(), cFileName.size(), bufferNumber, options);
1055 }
BFVOID writeBuffer(PBFCHAR fileName, const BFSIZET fileNameSize, const BFU32 bufferNumber, const BFU32 options) const
Definition: BufferInterface.cpp:1028
BFVOID BufferInterface::writeSeqBuffer ( PBFCHAR  fileName,
const BFSIZET  fileNameSize,
const BFU32  firstBufNumber,
const BFU32  numBufs,
const BFU32  options 
) const

Writes a sequence of buffers to a file on disk in the BMP, TIFF, RAW or AVI file format.

Parameters
[in]fileName- The file name to be saved to disk. The file name includes the file extension.
[in]fileNameSize- The size of the fileName buffer.
[in]firstBufNumber- The first buffer to write to disk.
[in]numBufs- The number of buffers to be written to disk.
[in]options- The options for saving a buffer to disk are:
SwapRGB - Swap the RGB format to BGR.
Pack32to24Bit - Save 32 bit color (RGBX) data to 24 bit (RGB).
BOTTOM_UP - Saves the data to disk upside down from what is being displayed.
OVERWRITEFILE - Overwrite existing files.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.
Examples:
BiSimplePlusPlus.cpp.

References BiException::check(), m_BufferArray, and m_hBoard.

Referenced by writeSeqBuffer().

1080 {
1081  BiException::check(m_hBoard, BiDiskBufWrite(m_hBoard, &m_BufferArray, firstBufNumber, numBufs, fileName, fileNameSize, options) );
1082 }
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
BFVOID BufferInterface::writeSeqBuffer ( std::string const &  fileName,
const BFU32  firstBufNumber,
const BFU32  numBufs,
const BFU32  options 
) const

Writes a sequence of buffers to a file on disk in the BMP, TIFF, RAW or AVI file format.

Parameters
[in]fileName- The file name to be saved to disk. The file name includes the file extension.
[in]firstBufNumber- The first buffer to write to disk.
[in]numBufs- The number of buffers to be written to disk.
[in]options- The options for saving a buffer to disk are:
SwapRGB - Swap the RGB format to BGR.
Pack32to24Bit - Save 32 bit color (RGBX) data to 24 bit (RGB).
BOTTOM_UP - Saves the data to disk upside down from what is being displayed.
OVERWRITEFILE - Overwrite existing files.
Exceptions
BiException- Use the showErrorMsg method to get information on the thrown exception.

References writeSeqBuffer().

1105 {
1106  std::vector<BFCHAR> cFileName (fileName.begin(), fileName.end());
1107  cFileName.push_back(0);
1108 
1109  writeSeqBuffer(cFileName.data(), cFileName.size(), firstBufNumber, numBufs, options);
1110 }
BFVOID writeSeqBuffer(PBFCHAR fileName, const BFSIZET fileNameSize, const BFU32 firstBufNumber, const BFU32 numBufs, const BFU32 Options) const
Definition: BufferInterface.cpp:1079

Member Data Documentation

BFBOOL BufferAcquisition::BufferInterface::isMemAllocated
protected
BFBOOL BufferAcquisition::BufferInterface::isMemAssigned
protected
BFBOOL BufferAcquisition::BufferInterface::isOpen
protected

Referenced by isBoardOpen().

BFBOOL BufferAcquisition::BufferInterface::isSetup
protected
BIBA BufferAcquisition::BufferInterface::m_BufferArray
mutableprotected
Bd BufferAcquisition::BufferInterface::m_hBoard
protected

Handle to the opened board

Referenced by bfRegName(), bfRegPeek(), bfRegPoke(), BufferAcquisition::CircularInterface::cirControl(), BufferAcquisition::CircularInterface::cirErrorWait(), BufferAcquisition::CircularInterface::cleanup(), BufferAcquisition::SequenceInterface::cleanup(), BufferAcquisition::SequenceInterface::clearBufferInfo(), clearBuffers(), close(), cxpReadData(), cxpReadReg(), cxpWriteData(), cxpWriteReg(), enumerateCameraModes(), getAbortAcqFlag(), getBrdInfo(), getBufferArrayPointers(), BufferAcquisition::SequenceInterface::getBufferInfo(), getBufferQueueSize(), BufferAcquisition::CircularInterface::getBufferStatus(), getCameraMode(), BufferAcquisition::CircularInterface::getCirError(), getCleanupAcqFlag(), BufferAcquisition::SequenceInterface::getCurFrameAcquired(), getExposureControl(), getNumFramesCaptured(), getNumFramesMissed(), getPauseAcqFlag(), BufferAcquisition::SequenceInterface::getSeqError(), getStartAcqFlag(), getStopAcqFlag(), getTriggerMode(), getTriggerPolarity(), issueSoftwareTrigger(), loadCamFile(), open(), openSWConnector(), readSeqFile(), BufferAcquisition::SequenceInterface::seqControl(), BufferAcquisition::SequenceInterface::seqErrorWait(), BufferAcquisition::SequenceInterface::seqWaitDone(), setAcqFrameSize(), setAcqROI(), BufferAcquisition::CircularInterface::setBufferStatus(), setCameraMode(), setExposureControl(), setExTriggerConnect(), BufferAcquisition::SequenceInterface::setSettings(), setTimeout(), setTriggerMode(), BufferAcquisition::SequenceInterface::setup(), BufferAcquisition::CircularInterface::setup(), showError(), unloadCamFile(), BufferAcquisition::CircularInterface::waitDoneFrame(), BufferAcquisition::SequenceInterface::waitDoneFrame(), writeBuffer(), writeSeqBuffer(), BufferAcquisition::CircularInterface::~CircularInterface(), and BufferAcquisition::SequenceInterface::~SequenceInterface().

PBFCNF BufferAcquisition::BufferInterface::m_pCam
protected

A pointer to a loaded camera file

Referenced by close(), loadCamFile(), and unloadCamFile().


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