![]() |
Developer Application Interface (ARC API) v4.5.8
ARC, Inc. GenIV Application Interface
|
#include <CArcDevice.h>
Public Member Functions | |
CArcDevice (void) | |
CArcDevice (const CArcDevice &)=delete | |
CArcDevice & | operator= (const CArcDevice &)=delete |
CArcDevice (CArcDevice &&)=delete | |
CArcDevice & | operator= (CArcDevice &&)=delete |
virtual | ~CArcDevice (void)=default |
const std::string | toString (void) const noexcept |
void | open (const std::uint32_t uiDeviceNumber=0, const bool bMapBuffer=true) |
bool | isOpen (void) const noexcept |
void | close (void) noexcept |
void | mapCommonBuffer (void) |
void | unMapCommonBuffer (void) |
arc::gen4::pCommonBufferList_t | getCommonBuffers (void) const noexcept |
void | setup (const std::filesystem::path &tCtlrFile, const std::uint32_t uiHdwTestCnt=1234, bool *pStop=nullptr) |
void | loadFile (const std::filesystem::path &tCtlrFile, bool *pStop=nullptr) |
void | bootFlash (void) |
arc::gen4::pStringList_t | getCommandList (void) |
arc::gen4::pStringList_t | getExposeModeList (void) |
void | registerAlertHandler (alertHandler_t fnAlertHandler, std::chrono::milliseconds freqMS=std::chrono::milliseconds(1000)) |
std::unique_ptr< arc::gen4::CArcBoardMap > | getBoardMap (void) |
void | setImageDimensions (const std::uint32_t uiCols, const std::uint32_t uiRows) |
void | setImageDimensions (const std::uint32_t uiCols, const std::uint32_t uiRows, const std::uint32_t uwChannelCount) |
void | verifyColumnChannelCount (const std::uint32_t uiCols, const std::uint32_t uwChannelCount) |
arc::gen4::pSysState_t | getSystemState (void) |
arc::gen4::pStatusPacket_t | command (uint32Type auto const ... args) |
template<uint32Type... Args> | |
arc::gen4::pStatusPacket_t | command (arc::gen4::cmds_e tCmd, const Args ... args) |
arc::gen4::pStatusPacket_t | command (const std::vector< std::uint32_t > &vCmdList) |
void | command (const std::vector< std::uint32_t > &vCmdList, std::uint32_t uiExpectedReply) |
arc::gen4::pStatusPacket_t | command (const std::vector< std::any > &vCmdList) |
void | command (const std::vector< std::any > &vCmdList, const std::uint32_t uiExpectedReply) |
arc::gen4::pStatusPacket_t | command (const arc::gen4::CArcCommandPacket *pCmd) const |
void | commandAbort (void) const |
arc::gen4::pImageBuffer_t | expose (const std::uint32_t uiExpTime, const exposeListener_t fnExposeListener=nullptr, const readListener_t fnReadListener=nullptr, pSysState_t pSysState=nullptr) |
void | stopExpose (void) noexcept |
const std::vector< arc::gen4::pImageBuffer_t > & | getImageBufferList (void) const |
arc::gen4::pImageBuffer_t | getImageBuffer (const std::uint16_t uwIndex=0) const noexcept |
std::size_t | getImageBufferCount (void) const noexcept |
std::uint64_t | setImageBufferSize (const std::uint32_t uiColumns, const std::uint32_t uiRows) noexcept |
std::uint64_t | setImageBufferSize (const std::uint64_t uiSize) noexcept |
std::uint64_t | getImageBufferSize (void) const noexcept |
bool | setImageBufferFill (const std::uint32_t uiValue=arc::gen4::CArcDevice::NO_FILL_VALUE) const noexcept |
arc::gen4::pImageAssembler_t | getImageAssembler (void) const noexcept |
void | enableCommandLogging (const bool bEnable=true) |
** Registers a command logger for debug purposes. More... | |
arc::gen4::pLogger_t | getCommandLog (void) const noexcept |
void | flashMemoryReadFirmwareBlock (const std::filesystem::path &tOutFile, bool *pStop=nullptr, const fileProgressListener_t &fnProgressListener=nullptr) |
void | flashMemoryWriteFirmwareBlock (const std::filesystem::path &tInFile, bool *pStop=nullptr, const fileProgressListener_t &fnProgressListener=nullptr) |
const std::string | flashMemoryReadIdBlock (const std::uint32_t uiBoardNumber) |
const std::string | flashMemoryReadUserBlock (const std::uint32_t uiBoardNumber) |
void | flashMemoryWriteUserBlock (const std::uint32_t uiBoardNumber, const std::string &sText) |
void | flashMemoryErase (const std::uint32_t uiBoardNumber, const arc::gen4::flashMemoryId_e eBlockId) |
std::uint32_t | readBAR (const std::uint32_t uiBAR, const std::uint32_t uiAddress) const |
void | writeBAR (const std::uint32_t uiBAR, const std::uint32_t uiAddress, const std::uint32_t uiValue) const |
const std::string | dumpBARs (void) const |
void | setProcessPriority (const arc::gen4::processPriority_e ePriority=arc::gen4::processPriority_e::Normal) |
arc::gen4::processPriority_e | getProcessPriority (void) |
![]() | |
virtual | ~CArcPCIeBase (void)=default |
** Default constructor More... | |
template<typename T = std::uint32_t> | |
std::uint64_t | readConfigSpaceRegister (std::uint64_t uiAddress) |
template<typename T = std::uint32_t> | |
void | writeConfigSpaceRegister (std::uint32_t uiAddress, std::uint32_t uiValue) |
const std::string | readConfigSpace (void) |
const std::string | readConfigSpaceExpanded (void) |
![]() | |
virtual | ~CArcBase (void) |
Static Public Member Functions | |
static const std::string | version (void) noexcept |
static const std::vector< arcDev_t > & | findDevices (void) |
![]() | |
static const std::string | version (void) |
static void | zeroMemory (void *pDest, std::size_t uiSize) |
static void | copyMemory (void *pDest, void *pSrc, std::size_t uiSize) |
template<typename T > | |
static std::tuple< T *, T * > | copyAndIncrement (void *pDest, void *pSrc, const std::size_t uiSize) |
template<typename ErrCode > requires std::is_integral_v<ErrCode> | |
static const std::string | getSystemErrorMessage (ErrCode iErrCode) |
static const std::string | getSystemErrorMessage (void) |
static std::uint32_t | getSystemError (void) noexcept |
static pStringList_t | splitString (const std::string &sString, const char &zDelim=' ') |
static std::string | formatString (const char *pszFmt,...) |
static const std::filesystem::path | incrementFileName (const std::filesystem::path &tFilePath="", const std::int32_t iStartValue=-1) |
static std::string | convertWideToAnsi (const wchar_t wzString[]) noexcept |
static std::string | convertWideToAnsi (const std::wstring &wsString) |
static std::wstring | convertAnsiToWide (const char *pszString) |
static std::string | cmdToString (const std::uint32_t uiCmd) |
template<typename T > | |
static std::string | iterToString (T *begin, T *end, const char zSeperator=' ') |
static std::string | setDots (const std::string &sText, const std::size_t uiMaxLength, const char szDot='.') |
static std::string | trim (const std::string &sText) noexcept |
static const std::chrono::time_point< std::chrono::high_resolution_clock > | startCodeTime (void) noexcept |
template<typename T > | |
static constexpr auto | endCodeTime (const std::chrono::time_point< std::chrono::high_resolution_clock > tStartTimePoint) noexcept |
Public Attributes | |
std::function< float(void)> | fnReadElapsedTime |
std::function< std::uint32_t(void)> | fnGetPixelCount |
std::function< void(void)> | fnResetPixelCounter |
std::function< void(void)> | fnVerifyDeviceIsOpen |
Static Public Attributes | |
static constexpr auto | NOPARAM = static_cast< std::uint32_t >( 0xFFFFFFFF ) |
static constexpr auto | ARC420_BOARD_NUMBER = static_cast< std::uint32_t >( 0x8 ) |
static constexpr auto | ARC480_BOARD_NUMBER = static_cast< std::uint32_t >( 0x3F ) |
static constexpr auto | NO_FILL_VALUE = static_cast< std::uint32_t >( 65536 ) |
static constexpr auto | ARC420_SYNTHETIC_DIMENSION = static_cast< std::uint32_t >( 2048 ) |
static constexpr auto | ARC420_SYNTHETIC_CHANNEL_COUNT = static_cast< std::uint32_t >( 16 ) |
static constexpr auto | ARC440_INVALID_CHANNEL_ADDRESS = static_cast< std::uint32_t >( 0x99 ) |
Protected Member Functions | |
std::unique_ptr< std::uint8_t[]> | readFileBytes (const std::filesystem::path &tFilePath, std::uint32_t &uiFileLength) |
arc::gen4::pStatusPacket_t | download (arc::gen4::CArcDLoadPacket *pDLoad) |
void | clearCommandAbort (void) const |
bool | commandAborted (void) const |
arc::gen4::pStatusPacket_t | readStatus (void) const |
void | readOut (std::uint32_t &uiBufferIndex, const std::uint32_t uiReadCount, const readListener_t fnReadListener) |
void | readAlerts (const std::chrono::milliseconds freqMS) const |
void | flashMemoryWriteIdBlock (std::uint32_t uiBoardNumber, const std::string &sText) |
std::unique_ptr< std::uint8_t[]> | flashMemoryReadFirmwareBlock (std::uint32_t &uiDataLength, bool *pStop, std::function< void(std::uint32_t, std::uint32_t)> fProgressListener) |
virtual bool | readConfigSpace8 (std::uint64_t uiAddress, std::uint64_t *pRegValue) const noexcept override |
virtual bool | readConfigSpace16 (std::uint64_t uiAddress, std::uint64_t *pRegValue) const noexcept override |
virtual bool | readConfigSpace32 (std::uint64_t uiAddress, std::uint64_t *pRegValue) const noexcept override |
virtual bool | readConfigSpace64 (std::uint64_t uiAddress, std::uint64_t *pRegValue) const noexcept override |
virtual bool | writeConfigSpace8 (const std::uint32_t uiAddress, const std::uint32_t uiValue) const noexcept override |
virtual bool | writeConfigSpace16 (const std::uint32_t uiAddress, const std::uint32_t uiValue) const noexcept override |
virtual bool | writeConfigSpace32 (const std::uint32_t uiAddress, const std::uint32_t uiValue) const noexcept override |
![]() | |
CArcPCIeBase (void)=default | |
CArcPCIeBase (const CArcPCIeBase &)=delete | |
CArcPCIeBase (CArcPCIeBase &&)=delete | |
CArcPCIeBase & | operator= (const CArcPCIeBase &)=delete |
CArcPCIeBase & | operator= (CArcPCIeBase &&)=delete |
void | readPCIeCapabilitiesToStream (std::ostream &oss, bool bShowExtended=false, std::size_t uiDotLength=58) |
template<typename T = std::uint32_t> | |
auto | registerToStream (std::ostream &oss, const std::string &sRegName, std::uint64_t &uiAddress, std::size_t uiDotLength=58) |
![]() | |
CArcBase (void)=default | |
CArcBase (const CArcBase &)=delete | |
CArcBase (CArcBase &&)=delete | |
CArcBase & | operator= (const CArcBase &)=delete |
CArcBase & | operator= (CArcBase &&)=delete |
Protected Attributes | |
std::function< std::uint32_t(const std::size_t)> | fnCommonBufferByteCount |
std::function< bool(const std::size_t)> | fnCommonBufferDirty |
std::function< bool(const std::size_t)> | fnCommonBufferOverflow |
std::function< bool(const std::size_t)> | fnCommonBufferComplete |
std::function< void(std::size_t, std::uint32_t)> | fnClearCommonBufferStatus |
std::function< void(void)> | fnClearPacketBuffers |
std::function< std::tuple< bool, std::uint32_t >(void)> | fnImageAddressError |
std::unique_ptr< arc::gen4::commonBuffer_t > | m_pCommonBuffer |
std::unique_ptr< arc::gen4::commonBufferList_t > | m_pCommonBufferList |
std::unique_ptr< std::vector< arc::gen4::pImageBuffer_t > > | m_pBufferList |
std::uint64_t | m_uiBufferSize |
std::unique_ptr< std::queue< arc::gen4::CArcImagePacket * > > | m_pImagePacketQueue |
arc::gen4::arcDevHandle_t | m_tDevice |
std::shared_ptr< arc::gen4::CArcLog > | m_pCommandLogger |
alertHandler_t | m_fnAlertHandler |
** Command log handler ( for debug ) */ More... | |
std::thread * | m_pAlertThread |
std::shared_ptr< CArcImageAssembler > | m_pImgAssembler |
std::uint32_t | m_uiFillValue |
std::mutex | m_oCmdMutex |
std::mutex | m_oCmdAbortMutex |
std::atomic_bool | m_abCmdAbort |
std::atomic_bool | m_abStopAlertCapture |
std::unique_ptr< std::stop_source > | m_pExposeStopSource |
bool | m_bFlashMemoryBlockAccess |
Static Protected Attributes | |
static std::unique_ptr< const std::array< std::uint32_t, 2 > > | m_pCommonBufferStatusRegisters |
static std::unique_ptr< const std::array< std::uint32_t, 2 > > | m_pCommonBufferStatusByteCountRegisters |
static const std::string | m_sVersion |
static const std::string | m_sToString |
static std::unique_ptr< std::vector< arcDev_t > > | m_pvDevList |
static constexpr auto | ELAPSED_TIMEOUT_COUNT = static_cast< std::uint32_t >( 20 ) |
static constexpr auto | READ_TIMEOUT_COUNT = static_cast< std::uint32_t >( 100 ) |
![]() | |
static const std::string | m_printSeperator |
![]() | |
static const std::string | m_sVersion |
ARC-460 PCIe device class. This is the class for all controller and device driver communications.
Definition at line 214 of file CArcDevice.h.
arc::gen4::CArcDevice::CArcDevice | ( | void | ) |
Default constructor
|
delete |
Delete copy constructor
|
delete |
Delete move constructor
|
virtualdefault |
Destructor
|
delete |
Delete copy assignment constructor
|
delete |
Delete move assignment constructor
|
noexcept |
Returns a textual representation of the class.
|
staticnoexcept |
Returns a textual representation of the library version.
|
static |
Searches the system for ARC-460 PCIe boards and returns a list of found devices. For convenience, this method is automatically called by open().
std::runtime_error |
void arc::gen4::CArcDevice::open | ( | const std::uint32_t | uiDeviceNumber = 0 , |
const bool | bMapBuffer = true |
||
) |
Open a connection to the specified ARC-460 PCIe device.
uiDeviceNumber | - The device driver number 0 to N ( default = 0 ). |
bMapBuffer | - Set to true (default) to map the device common buffer based on the size read from the driver itself. Set to false to not map the common buffer after opening the device. Images cannot be accessed without buffer mapping. ( default = true ). |
std::runtime_error | |
std::out_of_range |
|
noexcept |
|
noexcept |
Closes the ARC-460 PCIe device connection.
void arc::gen4::CArcDevice::mapCommonBuffer | ( | void | ) |
Maps the device driver common buffer. The common buffer size can be known by calling commonBufferSize().
std::runtime_error |
void arc::gen4::CArcDevice::unMapCommonBuffer | ( | void | ) |
Unmaps the device common buffer previously mapped by a call to mapCommonBuffer().
std::runtime_error |
|
noexcept |
Returns a list of device driver common buffers and their associated properties. The ARC-460 driver uses a ring buffer to receive image packets from the controller.
void arc::gen4::CArcDevice::setup | ( | const std::filesystem::path & | tCtlrFile, |
const std::uint32_t | uiHdwTestCnt = 1234 , |
||
bool * | pStop = nullptr |
||
) |
Initializes the controller, which must be attached to the ARC-460 PCIe and powered on. An optional data link test, which verifies that the communications link between the host computer and the controller is also available. Any test command sent after the file load will be processed by the controller timing board on-board processor. Prior to this, the tests will be processed by the controller timing board hardware itself. With a test data link value of zero this method is identical to calling loadFile.
tCtlrFile | - The file to load. |
uiHdwTestCnt | - The number of test data link commands to send to the controller ( default = 1234 ). |
pStop | - Pointer used to cancel execution ( default = nullptr ). |
std::runtime_error | |
std::invalid_argument | |
std::length_error |
void arc::gen4::CArcDevice::loadFile | ( | const std::filesystem::path & | tCtlrFile, |
bool * | pStop = nullptr |
||
) |
Loads the specified timing firmware file onto the controller.
tCtlrFile | - The firmware file to load. |
pStop | - Pointer used to cancel execution ( default = nullptr ). |
std::runtime_error |
void arc::gen4::CArcDevice::bootFlash | ( | void | ) |
Boots the controller from flash memory, which should have been previously programmed with a valid firmware file.
Any | exception std::lock_guard throws |
std::runtime_error |
arc::gen4::pStringList_t arc::gen4::CArcDevice::getCommandList | ( | void | ) |
Returns the list of supported controller commands as strings containing the command description, name and arguments.
std::ios_base::failure | |
std::runtime_error |
arc::gen4::pStringList_t arc::gen4::CArcDevice::getExposeModeList | ( | void | ) |
Returns the list of supported controller expose modes as strings containing the mode description.
std::ios_base::failure | |
std::runtime_error |
void arc::gen4::CArcDevice::registerAlertHandler | ( | alertHandler_t | fnAlertHandler, |
std::chrono::milliseconds | freqMS = std::chrono::milliseconds(1000) |
||
) |
Registers a callback function for controller alerts. The function handler has the following signiture: void f( std::string ). Controller alerts can occur at any time. Only one alert handler may be registered. Calling this function a second time will result in the previous handler being replaced.
fnAlertHandler | - The alert handler. |
uFreqMS | - The millisecond frequency with which to check for alerts ( default = 1000 ms ). |
std::runtime_error | and whatever std::thread throws. |
std::unique_ptr< arc::gen4::CArcBoardMap > arc::gen4::CArcDevice::getBoardMap | ( | void | ) |
Convenience method to obtain the board mapping from the controller. The board map contains the slot positions for each board.
void arc::gen4::CArcDevice::setImageDimensions | ( | const std::uint32_t | uiCols, |
const std::uint32_t | uiRows | ||
) |
Set the image dimensions on the controller. The controller hardware imposes restrictions on the image dimensions based on the current channel count on the controller. This method verifies the dimensions against the current channel count and throws an exception if they are not compatible.
uiCols | - The number of pixel columns in the image. |
uiRows | - The number of pixel rows in the image. |
std::runtime_error | |
std::invalid_argument |
void arc::gen4::CArcDevice::setImageDimensions | ( | const std::uint32_t | uiCols, |
const std::uint32_t | uiRows, | ||
const std::uint32_t | uwChannelCount | ||
) |
Set the image dimensions on the controller. The controller hardware imposes restrictions on the image dimensions based on the current channel count on the controller. This method verifies the dimensions against the current channel count and throws an exception if they are not compatible.
uiCols | - The number of pixel columns in the image. |
uiRows | - The number of pixel rows in the image. |
uwChannelCount | - The number of channels. |
Any | exception thrown by verifyColumnChannelCount() and setImageDimensions(). |
void arc::gen4::CArcDevice::verifyColumnChannelCount | ( | const std::uint32_t | uiCols, |
const std::uint32_t | uwChannelCount | ||
) |
Verifies the image column dimension for the specified channel count. An exception is thrown if the dimension does not meet the requirements.
uiCols | - The number of columns in the image. |
uwChannelCount | - The number of channels. |
std::invalid_argument |
arc::gen4::pSysState_t arc::gen4::CArcDevice::getSystemState | ( | void | ) |
Sends a command to the controller to generate a new system state structure, which contains dimensions, readcount, channel count and other controller state data. See arc::gen4::pSysState_t for more info.
std::runtime_error | |
std::invalid_argument |
|
inline |
Send a command to the controller.
...args | - A variable length list of unsigned integers that represent a valid contoller command. Format: command, arg0, ... argN. |
std::runtime_error |
Definition at line 400 of file CArcDevice.h.
|
inline |
Send a command to the controller.
tCmd | - A command from the arc::gen4::cmds_e enumeration list. |
...args | - An optional variable length list of unsigned integers that represent valid contoller command arguments. Format: arg0, ... argN. |
std::runtime_error | |
std::invalid_argument |
Definition at line 422 of file CArcDevice.h.
arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::command | ( | const std::vector< std::uint32_t > & | vCmdList | ) |
Send a command to the controller.
vCmdList | - A vector list of unsigned integers that represent a valid contoller command. Format: command, arg0, ... argN. |
std::runtime_error | |
std::invalid_argument |
void arc::gen4::CArcDevice::command | ( | const std::vector< std::uint32_t > & | vCmdList, |
std::uint32_t | uiExpectedReply | ||
) |
Send a command to the controller and compare the reply against the expected parameter. Throws std::invalid_argument exception if they don't match.
vCmdList | - A vector list of unsigned integers that represent a valid contoller command. Format: command, arg0, ... argN. |
uiExpectedReply | - The expected reply value. |
std::runtime_error | |
std::invalid_argument |
arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::command | ( | const std::vector< std::any > & | vCmdList | ) |
Send a command to the controller.
vCmdList | - A vector command list where the first argument has type arc::gen4::cmds_e and the remaining arguments are all unsigned integers. Format: command, arg0, ... argN. |
std::runtime_error | |
std::invalid_argument |
void arc::gen4::CArcDevice::command | ( | const std::vector< std::any > & | vCmdList, |
const std::uint32_t | uiExpectedReply | ||
) |
Send a command to the controller and compare the reply against the expected parameter. Throws std::invalid_argument exception if they don't match.
vCmdList | - A vector command list where the first argument has type arc::gen4::cmds_e and the remaining arguments are all unsigned integers. Format: command, arg0, ... argN. |
uiExpectedReply | - The expected reply value. |
std::runtime_error | |
std::invalid_argument |
arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::command | ( | const arc::gen4::CArcCommandPacket * | pCmd | ) | const |
Send a command to the controller. The packet contents are not checked before sending to the controller. It is the responsibility of the calling application to ensure that the controller will recognize the packet contents.
pCmd | - The packet to transmit. |
std::runtime_error | |
std::invalid_argument |
void arc::gen4::CArcDevice::commandAbort | ( | void | ) | const |
Attempts to halt any currently executing command. Primarily used for application responsivness.
Any | exception thrown by std::lock_guard. |
arc::gen4::pImageBuffer_t arc::gen4::CArcDevice::expose | ( | const std::uint32_t | uiExpTime, |
const exposeListener_t | fnExposeListener = nullptr , |
||
const readListener_t | fnReadListener = nullptr , |
||
pSysState_t | pSysState = nullptr |
||
) |
Start an image exposure. This method blocks until the image exposure and readout are complete or an error occurs.
uiExpTime | - The exposure time in milliseconds. |
fnExposeListener | - An optional elapsed time listener. ( default = nullptr ) |
fnReadListener | - An optional readout listener. ( default = nullptr ) |
pSysState | - Pointer to a system state object. If nullptr, an attempt will be made to read these values from the controller. ( default = nullptr ) |
std::runtime_error | |
std::invalid_argument | |
std::length_error |
|
noexcept |
Stop the current exposure
const std::vector< arc::gen4::pImageBuffer_t > & arc::gen4::CArcDevice::getImageBufferList | ( | void | ) | const |
Returns the image buffer list as a std::vector. The number of image buffers is controlled by the image read count. Some readout patterns, such as Fowler sampling, can perform multiple reads before and after the actual exposure. These types of reads will result in multiple image buffers. A standard single image exposure will result in one buffer.
std::runtime_error |
|
noexcept |
Returns the image buffer at the specified index. Use getImageBufferCount() to determine the number of image buffers that are available.
uwIndex | - The image buffer index ( default = 0 ). |
|
noexcept |
Returns the number of image buffers that are available.
|
noexcept |
Modify the default image buffer size. Note that the image buffer is dual purposed. Before containing the final image, all incoming image packets, which are later re-assembled into the final image, are temporarily stored within the buffer. This means that the buffer size should be at least 15% larger than the expected image dimensions. Also note that the extra 15% is not a hard number and will depend on the final image dimensions.
uiColumns | - The new image buffer column dimension ( in pixels ). |
uiRows | - The new image buffer row dimension ( in pixels ). |
|
noexcept |
Modify the default image buffer size. Note that the image buffer is dual purposed. Before containing the final image, all incoming image packets, which are later re-assembled into the final image, are temporarily stored within the buffer. This means that the buffer size should be at least 15% larger than the expected image dimensions. Also note that the extra 15% is not a hard number and will depend on the final image dimensions.
uiSize | - The new image buffer size ( in bytes ). |
|
noexcept |
Returns the current image buffer size ( in bytes ).
|
noexcept |
Sets the image buffer prefill value. The image prefill itself is also controlled by this value. A value of arc::gen4::CArcDevice::NO_FILL_VALUE results in no image buffer prefilling.
uiValue | - The image buffer fill value. Must be a 16-bit value in the range 0 to 65535 inclusive ( default = arc::gen4::CArcDevice::NO_FILL_VALUE ). |
|
noexcept |
Returns a pointer to the internal image assembler.
void arc::gen4::CArcDevice::enableCommandLogging | ( | const bool | bEnable = true | ) |
** Registers a command logger for debug purposes.
Enables/disables command logging for debug purposes.
bEnable | - Set to true to enable logging; false otherwise. ( default = true ). |
std::runtime_error | and anything thrown by std::lock_guard(). |
|
noexcept |
Returns a pointer to the logger.
void arc::gen4::CArcDevice::flashMemoryReadFirmwareBlock | ( | const std::filesystem::path & | tOutFile, |
bool * | pStop = nullptr , |
||
const fileProgressListener_t & | fnProgressListener = nullptr |
||
) |
Reads the data contained within the ARC-420 timing board flash memory firmware block. The data will be written to the specified file in binary format. The progress listener parameter can be used to monitor the readRunnable progress.
tOutFile | - The binary file to which data will be written. |
pStop | - A pointer to a boolean that controls cancelling the process. |
fnProgressListener | - A listener function to receive progress updates. |
std::runtime_error | |
std::invalid_argument | |
Anything | exception flashMemoryReadFirmwareBlock() throws |
void arc::gen4::CArcDevice::flashMemoryWriteFirmwareBlock | ( | const std::filesystem::path & | tInFile, |
bool * | pStop = nullptr , |
||
const fileProgressListener_t & | fnProgressListener = nullptr |
||
) |
Write data to the ARC-420 timing board flash memory firmware block. The data will be readRunnable from the specified binary file ( output from LPCXpresso ). The progress listener parameter can be used to monitor the write progress.
tInFile | - The binary file from which data will be read. |
pStop | - A pointer to a boolean that controls cancelling the process. |
fnProgressListener | - A listener function to receive progress updates. |
std::runtime_error | and any exception thrown by readFileBytes() and command() |
const std::string arc::gen4::CArcDevice::flashMemoryReadIdBlock | ( | const std::uint32_t | uiBoardNumber | ) |
Read data from the flash memory id block on the ARC-420 timing board. The id block contains read-only controller data.
uiBoardNumber | - The board number of the id block to read. |
std::ios_base::failure | |
std::runtime_error |
const std::string arc::gen4::CArcDevice::flashMemoryReadUserBlock | ( | const std::uint32_t | uiBoardNumber | ) |
Read data from the flash memory user block.
uiBoardNumber | - The board number of the user block to read. |
std::ios_base::failure | |
std::runtime_error |
void arc::gen4::CArcDevice::flashMemoryWriteUserBlock | ( | const std::uint32_t | uiBoardNumber, |
const std::string & | sText | ||
) |
Write data to the flash memory user block.
uiBoardNumber | - The board number of the user block to write. |
sText | - A std::string containing the text to be written to the user block. |
std::runtime_error | |
std::invalid_argument |
void arc::gen4::CArcDevice::flashMemoryErase | ( | const std::uint32_t | uiBoardNumber, |
const arc::gen4::flashMemoryId_e | eBlockId | ||
) |
Erase a flash memory. A specific block or the entire chip can be erased.
uiBoardNumber | - The board number of the memory to erase. |
eBlockId | - One of the arc::gen4::flashMemoryId_e::FLASH_MEMORY_XXX_ID enumeration constants. |
std::runtime_error | |
std::invalid_argument |
std::uint32_t arc::gen4::CArcDevice::readBAR | ( | const std::uint32_t | uiBAR, |
const std::uint32_t | uiAddress | ||
) | const |
Read a DWORD from a PCIe base address register.
uiBAR | - The base address register number to read. |
uiAddress | - The offset into the specified BAR to read. |
std::runtime_error | |
std::out_of_range |
void arc::gen4::CArcDevice::writeBAR | ( | const std::uint32_t | uiBAR, |
const std::uint32_t | uiAddress, | ||
const std::uint32_t | uiValue | ||
) | const |
Write a DWORD from a PCIe base address register.
uiBAR | - The base address register number to write. |
uiAddress | - The offset into the specified BAR to write. |
uiValue | - The DWORD value to write. |
std::runtime_error | |
std::out_of_range |
const std::string arc::gen4::CArcDevice::dumpBARs | ( | void | ) | const |
Returns a formatted string containing a dump of the ARC-460 PCIe registers.
Any | exception thrown by arc::gen4::readBAR(). |
std::ios_base::failure |
void arc::gen4::CArcDevice::setProcessPriority | ( | const arc::gen4::processPriority_e | ePriority = arc::gen4::processPriority_e::Normal | ) |
Sets the priority for the current process. This value together with the priority value of each thread of the process determines each thread's base priority level. Setting this to a value above normal can help with packet ID errors when taking Fowler sampled exposures with image dimensions around 2048x2048. This is a Windows only method. To set the process priority on Linux, use the following command as super user (administrator): nice -n -19 myAppName
ePriority | - The priority level to set the process to. |
arc::gen4::processPriority_e arc::gen4::CArcDevice::getProcessPriority | ( | void | ) |
Returns the priority for the current process. This value together with the priority value of each thread of the process determines each thread's base priority level. Setting this to a value above normal can help with packet ID errors when taking Fowler sampled exposures with image dimensions around 2048x2048. This is a Windows only method.
|
protected |
Reads and returns all the bytes from a binary file.
tFilePath | - The binary file eto read. |
uiFileLength | - On return contains the byte length of the file. |
std::runtime_error | |
std::invalid_argument | |
std::length_error |
|
protected |
Send a firmware download packet to the controller. The packet contents are not checked before sending to the controller. It is the responsibility of the calling application to ensure that the controller will recognize the packet contents.
pDLoad | - The firmware packet to transmit. |
Any | exception thrown by command() |
|
protected |
Clears the command abort status.
Any | exception thrown by std::lock_guard() |
|
protected |
Checks to see if an abort command has been issued.
Any | exception thrown by std::lock_guard() |
|
protected |
Read status packet in response to a command.
and | any exception thrown by arc::gen4::CArcStatusPacket::assign() |
|
protected |
Controls and monitors the image readout.
uiBufferIndex | - The next packet/image buffer to start reading data into |
uiReadCount | - The number of images to be read |
fnReadListener | - An optional readout listener ( default = nullptr ) |
std::runtime_error |
|
protected |
Receives alert packets into the alert queue.
- | freqMS - The frequency, in milliseconds, to check for alerts. |
std::runtime_error |
|
protected |
Write data to the flash memory id block.
uiBoardNumber | - The board number of the id block to read. |
sText | - A std::string containing the text to be written to the id block. |
std::runtime_error | |
std::invalid_argument |
|
protected |
Reads the data contained within the ARC - 420 flash memory firmware block.The data will be returned as an array of bytes.
uiDataLength | - The length, in bytes, of the data returned. |
pStop | - Set to true to stop reading data (default = false). |
fnProgressListener | - Optional callback function to receive the number of bytes read. The functions first parameter is the number of bytes read. The second parameter is the total number of expected bytes to be read. |
std::runtime_error | |
std::length_error |
|
overrideprotectedvirtualnoexcept |
Device specific function used to read a BYTE (8-bits) from PCIe configuration space.
uiAddress | - The PCIe configuration space address to read |
pRegValue | - A pointer to hold the value read from the specified address |
Implements arc::gen4::CArcPCIeBase.
|
overrideprotectedvirtualnoexcept |
Device specific function used to read a WORD (16-bits) from PCIe configuration space.
uiAddress | - The PCIe configuration space address to read |
pRegValue | - A pointer to hold the value read from the specified address |
Implements arc::gen4::CArcPCIeBase.
|
overrideprotectedvirtualnoexcept |
Device specific function used to read a DWORD (32-bits) from PCIe configuration space.
uiAddress | - The PCIe configuration space address to read |
pRegValue | - A pointer to hold the value read from the specified address |
Implements arc::gen4::CArcPCIeBase.
|
overrideprotectedvirtualnoexcept |
Device specific function used to read a QWORD (64-bits) from PCIe configuration space.
uiAddress | - The PCIe configuration space address to read |
pRegValue | - A pointer to hold the value read from the specified address |
Implements arc::gen4::CArcPCIeBase.
|
overrideprotectedvirtualnoexcept |
Device specific function used to write a BYTE (8-bits) to a PCIe configuration space register.
uiAddress | - The PCIe configuration space address to write |
uiValue | - The value to write to the specified address |
Implements arc::gen4::CArcPCIeBase.
|
overrideprotectedvirtualnoexcept |
Device specific function used to write a WORD (16-bits) to a PCIe configuration space register.
uiAddress | - The PCIe configuration space address to write |
uiValue | - The value to write to the specified address |
Implements arc::gen4::CArcPCIeBase.
|
overrideprotectedvirtualnoexcept |
Device specific function used to write a DWORD (32-bits) to a PCIe configuration space register.
uiAddress | - The PCIe configuration space address to write |
uiValue | - The value to write to the specified address |
Implements arc::gen4::CArcPCIeBase.
std::function<float( void )> arc::gen4::CArcDevice::fnReadElapsedTime |
Convenience function to read the elasped exposure time ( in seconds ).
Any | exception thrown by arc::gen4::command(). |
Definition at line 676 of file CArcDevice.h.
std::function<std::uint32_t( void )> arc::gen4::CArcDevice::fnGetPixelCount |
Convenience function to read the current pixel counter.
Any | exception thrown by arc::gen4::readBAR(). |
Definition at line 682 of file CArcDevice.h.
std::function<void(void)> arc::gen4::CArcDevice::fnResetPixelCounter |
Convenience function to clear the pixel counter.
Any | exception thrown by arc::gen4::writeBAR(). |
Definition at line 687 of file CArcDevice.h.
std::function<void(void)> arc::gen4::CArcDevice::fnVerifyDeviceIsOpen |
Verify that the device is open
Definition at line 690 of file CArcDevice.h.
|
staticconstexpr |
No-parameter constant
Definition at line 693 of file CArcDevice.h.
|
staticconstexpr |
ARC-420 board Id ( fixed )
Definition at line 696 of file CArcDevice.h.
|
staticconstexpr |
ARC-480 board Id ( fixed )
Definition at line 699 of file CArcDevice.h.
|
staticconstexpr |
Image buffer Disable Fill
value
Definition at line 702 of file CArcDevice.h.
|
staticconstexpr |
ARC-420 synthetic image dimension ( fixed )
Definition at line 705 of file CArcDevice.h.
|
staticconstexpr |
ARC-420 synthetic image channel count ( fixed )
Definition at line 708 of file CArcDevice.h.
|
staticconstexpr |
ARC-440 invalid channel and address value
Definition at line 711 of file CArcDevice.h.
|
protected |
Convenience function to read the common buffer byte counter.
param1 | - The index of the common buffer ( 0 or 1 ). |
std::out_of_range | and any exception thrown by arc::gen4::readBAR(). |
Definition at line 791 of file CArcDevice.h.
|
protected |
Convenience function to determine if a common buffer has data available.
param1 | - The index of the common buffer ( 0 or 1 ). |
std::out_of_range | and any exception thrown by arc::gen4::readBAR(). |
Definition at line 798 of file CArcDevice.h.
|
protected |
Convenience function to determine if a common buffer has data overflow.
param1 | - The index of the common buffer ( 0 or 1 ). |
std::out_of_range | and any exception thrown by arc::gen4::readBAR(). |
Definition at line 805 of file CArcDevice.h.
|
protected |
Convenience function to determine if a common buffer is the last to contain data for the current image.
param1 | - The index of the common buffer ( 0 or 1 ). |
std::out_of_range | and any exception thrown by arc::gen4::readBAR(). |
Definition at line 812 of file CArcDevice.h.
|
protected |
Convenience function to clear one or all of the common buffer device status bits.
param1 | - The index of the common buffer ( 0 or 1 ). |
param2 | - Bitmask of status bit to clear. |
std::out_of_range | and any exception thrown by arc::gen4::readBAR(). |
Definition at line 819 of file CArcDevice.h.
|
protected |
Convenience function to clear the packet send and receive buffers.
Any | exception thrown by arc::gen4::writeBAR(). |
Definition at line 824 of file CArcDevice.h.
|
protected |
Convenience function to determine if the image address error bit has been set. This bit will be set if the PCIe card detects that a write to the common buffer will exceed its boundary. This will prevent a system crash. If set, then this bit must be cleared or no image data will ever be written to the host computer ... ever.
std::out_of_range | and any exception thrown by arc::gen4::readBAR(). |
Definition at line 834 of file CArcDevice.h.
|
staticprotected |
Common buffer status register list
Definition at line 886 of file CArcDevice.h.
|
staticprotected |
Common buffer byte counter register list
Definition at line 889 of file CArcDevice.h.
|
staticprotected |
version() text holder
Definition at line 892 of file CArcDevice.h.
|
staticprotected |
toString() text holder
Definition at line 895 of file CArcDevice.h.
|
protected |
Kernel packet buffer
Definition at line 898 of file CArcDevice.h.
|
protected |
Split kernel packet buffer list
Definition at line 901 of file CArcDevice.h.
|
protected |
Image buffer list
Definition at line 904 of file CArcDevice.h.
|
protected |
Image buffer size
Definition at line 907 of file CArcDevice.h.
|
protected |
Image packet queue
Definition at line 910 of file CArcDevice.h.
|
protected |
Device handle
Definition at line 913 of file CArcDevice.h.
|
staticprotected |
Device list
Definition at line 916 of file CArcDevice.h.
|
protected |
Command logger ( for debug )
Definition at line 919 of file CArcDevice.h.
|
protected |
** Command log handler ( for debug ) */
Alert handler
Definition at line 925 of file CArcDevice.h.
|
protected |
Alert thread
Definition at line 928 of file CArcDevice.h.
|
protected |
Image packet reassembler
Definition at line 931 of file CArcDevice.h.
|
mutableprotected |
Image buffer prefill value. A value of NO_FILL_VALUE disables prefill option.
Definition at line 934 of file CArcDevice.h.
|
mutableprotected |
Mutex for commands/replies
Definition at line 937 of file CArcDevice.h.
|
mutableprotected |
Command abort mutex
Definition at line 940 of file CArcDevice.h.
|
mutableprotected |
Command abort
Definition at line 943 of file CArcDevice.h.
|
protected |
Alert capture stop
Definition at line 946 of file CArcDevice.h.
|
protected |
Expose stop
Definition at line 949 of file CArcDevice.h.
|
protected |
Flash memory id block access permission
Definition at line 952 of file CArcDevice.h.
|
staticconstexprprotected |
Elapsed exposure time timeout counter
Definition at line 955 of file CArcDevice.h.
|
staticconstexprprotected |
Image readRunnable timeout counter
Definition at line 958 of file CArcDevice.h.