Developer Application Interface (ARC API) v4.5.8
ARC, Inc. GenIV Application Interface
arc::gen4::CArcDevice Class Reference

#include <CArcDevice.h>

Inheritance diagram for arc::gen4::CArcDevice:
arc::gen4::CArcPCIeBase arc::gen4::CArcBase

Public Member Functions

 CArcDevice (void)
 
 CArcDevice (const CArcDevice &)=delete
 
CArcDeviceoperator= (const CArcDevice &)=delete
 
 CArcDevice (CArcDevice &&)=delete
 
CArcDeviceoperator= (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::CArcBoardMapgetBoardMap (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)
 
- Public Member Functions inherited from arc::gen4::CArcPCIeBase
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)
 
- Public Member Functions inherited from arc::gen4::CArcBase
virtual ~CArcBase (void)
 

Static Public Member Functions

static const std::string version (void) noexcept
 
static const std::vector< arcDev_t > & findDevices (void)
 
- Static Public Member Functions inherited from arc::gen4::CArcBase
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
 
- Protected Member Functions inherited from arc::gen4::CArcPCIeBase
 CArcPCIeBase (void)=default
 
 CArcPCIeBase (const CArcPCIeBase &)=delete
 
 CArcPCIeBase (CArcPCIeBase &&)=delete
 
CArcPCIeBaseoperator= (const CArcPCIeBase &)=delete
 
CArcPCIeBaseoperator= (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)
 
- Protected Member Functions inherited from arc::gen4::CArcBase
 CArcBase (void)=default
 
 CArcBase (const CArcBase &)=delete
 
 CArcBase (CArcBase &&)=delete
 
CArcBaseoperator= (const CArcBase &)=delete
 
CArcBaseoperator= (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_tm_pCommonBuffer
 
std::unique_ptr< arc::gen4::commonBufferList_tm_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::CArcLogm_pCommandLogger
 
alertHandler_t m_fnAlertHandler
 ‍** Command log handler ( for debug ) *‍/ More...
 
std::thread * m_pAlertThread
 
std::shared_ptr< CArcImageAssemblerm_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 Protected Attributes inherited from arc::gen4::CArcPCIeBase
static const std::string m_printSeperator
 
- Static Protected Attributes inherited from arc::gen4::CArcBase
static const std::string m_sVersion
 

Detailed Description

ARC-460 PCIe device class. This is the class for all controller and device driver communications.

See also
arc::gen4::CArcBase

Definition at line 214 of file CArcDevice.h.

Constructor & Destructor Documentation

◆ CArcDevice() [1/3]

arc::gen4::CArcDevice::CArcDevice ( void  )

Default constructor

◆ CArcDevice() [2/3]

arc::gen4::CArcDevice::CArcDevice ( const CArcDevice )
delete

Delete copy constructor

◆ CArcDevice() [3/3]

arc::gen4::CArcDevice::CArcDevice ( CArcDevice &&  )
delete

Delete move constructor

◆ ~CArcDevice()

virtual arc::gen4::CArcDevice::~CArcDevice ( void  )
virtualdefault

Destructor

Member Function Documentation

◆ operator=() [1/2]

CArcDevice & arc::gen4::CArcDevice::operator= ( const CArcDevice )
delete

Delete copy assignment constructor

◆ operator=() [2/2]

CArcDevice & arc::gen4::CArcDevice::operator= ( CArcDevice &&  )
delete

Delete move assignment constructor

◆ toString()

const std::string arc::gen4::CArcDevice::toString ( void  ) const
noexcept

Returns a textual representation of the class.

Returns
A string representation of the class.

◆ version()

static const std::string arc::gen4::CArcDevice::version ( void  )
staticnoexcept

Returns a textual representation of the library version.

Returns
A string representation of the library version.

◆ findDevices()

static const std::vector< arcDev_t > & arc::gen4::CArcDevice::findDevices ( void  )
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().

Returns
A vector reference to the list of found ARC-460 devices.
Exceptions
std::runtime_error

◆ open()

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.

Parameters
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 ).
Exceptions
std::runtime_error
std::out_of_range

◆ isOpen()

bool arc::gen4::CArcDevice::isOpen ( void  ) const
noexcept

Returns whether or not an ARC-460 PCIe device has been opened ( i.e. if the open() method has been called ).

Returns
true if the open() method has been successfully called; false otherwise.

◆ close()

void arc::gen4::CArcDevice::close ( void  )
noexcept

Closes the ARC-460 PCIe device connection.

◆ mapCommonBuffer()

void arc::gen4::CArcDevice::mapCommonBuffer ( void  )

Maps the device driver common buffer. The common buffer size can be known by calling commonBufferSize().

Exceptions
std::runtime_error

◆ unMapCommonBuffer()

void arc::gen4::CArcDevice::unMapCommonBuffer ( void  )

Unmaps the device common buffer previously mapped by a call to mapCommonBuffer().

Exceptions
std::runtime_error

◆ getCommonBuffers()

arc::gen4::pCommonBufferList_t arc::gen4::CArcDevice::getCommonBuffers ( void  ) const
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.

Returns
An arc::gen4::commonBuffer_t pointer, which should never be nullptr.
See also
arc::gen4::commonBuffer_t

◆ setup()

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.

Parameters
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 ).
Exceptions
std::runtime_error
std::invalid_argument
std::length_error

◆ loadFile()

void arc::gen4::CArcDevice::loadFile ( const std::filesystem::path &  tCtlrFile,
bool *  pStop = nullptr 
)

Loads the specified timing firmware file onto the controller.

Parameters
tCtlrFile- The firmware file to load.
pStop- Pointer used to cancel execution ( default = nullptr ).
Exceptions
std::runtime_error

◆ bootFlash()

void arc::gen4::CArcDevice::bootFlash ( void  )

Boots the controller from flash memory, which should have been previously programmed with a valid firmware file.

Exceptions
Anyexception std::lock_guard throws
std::runtime_error

◆ getCommandList()

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.

Returns
A pointer to a CArcStringList object that contains the list of supported commands.
Exceptions
std::ios_base::failure
std::runtime_error
See also
arc::gen4::CArcStringList

◆ getExposeModeList()

arc::gen4::pStringList_t arc::gen4::CArcDevice::getExposeModeList ( void  )

Returns the list of supported controller expose modes as strings containing the mode description.

Returns
A pointer to a CArcStringList object that contains the list of supported expose modes.
Exceptions
std::ios_base::failure
std::runtime_error
See also
arc::gen4::CArcStringList

◆ registerAlertHandler()

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.

Parameters
fnAlertHandler- The alert handler.
uFreqMS- The millisecond frequency with which to check for alerts ( default = 1000 ms ).
Exceptions
std::runtime_errorand whatever std::thread throws.

◆ getBoardMap()

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.

Returns
A pointer to a board mapping object

◆ setImageDimensions() [1/2]

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.

Parameters
uiCols- The number of pixel columns in the image.
uiRows- The number of pixel rows in the image.
Exceptions
std::runtime_error
std::invalid_argument

◆ setImageDimensions() [2/2]

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.

Parameters
uiCols- The number of pixel columns in the image.
uiRows- The number of pixel rows in the image.
uwChannelCount- The number of channels.
Exceptions
Anyexception thrown by verifyColumnChannelCount() and setImageDimensions().

◆ verifyColumnChannelCount()

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.

Parameters
uiCols- The number of columns in the image.
uwChannelCount- The number of channels.
Exceptions
std::invalid_argument

◆ getSystemState()

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.

Returns
A std::shared_ptr to a pSysState_t that contains the info returned from the controller.
Exceptions
std::runtime_error
std::invalid_argument

◆ command() [1/7]

arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::command ( uint32Type auto const ...  args)
inline

Send a command to the controller.

Parameters
...args- A variable length list of unsigned integers that represent a valid contoller command. Format: command, arg0, ... argN.
Returns
An arc::gen4::pStatusPacket_t object that contains the controller reply. The status packet payload is command dependent.
Exceptions
std::runtime_error

Definition at line 400 of file CArcDevice.h.

◆ command() [2/7]

template<uint32Type... Args>
arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::command ( arc::gen4::cmds_e  tCmd,
const Args ...  args 
)
inline

Send a command to the controller.

Parameters
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.
Returns
An arc::gen4::pStatusPacket_t object that contains the controller reply. The status packet payload is command dependent.
Exceptions
std::runtime_error
std::invalid_argument

Definition at line 422 of file CArcDevice.h.

◆ command() [3/7]

arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::command ( const std::vector< std::uint32_t > &  vCmdList)

Send a command to the controller.

Parameters
vCmdList- A vector list of unsigned integers that represent a valid contoller command. Format: command, arg0, ... argN.
Returns
A std::unique_ptr to a CArcPacket object that contains the controller reply. The packet contents are command dependent.
Exceptions
std::runtime_error
std::invalid_argument

◆ command() [4/7]

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.

Parameters
vCmdList- A vector list of unsigned integers that represent a valid contoller command. Format: command, arg0, ... argN.
uiExpectedReply- The expected reply value.
Returns
A std::unique_ptr to a CArcPacket object that contains the controller reply. The packet contents are command dependent.
Exceptions
std::runtime_error
std::invalid_argument

◆ command() [5/7]

arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::command ( const std::vector< std::any > &  vCmdList)

Send a command to the controller.

Parameters
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.
Returns
A std::unique_ptr to a CArcPacket object that contains the controller reply. The packet contents are command dependent.
Exceptions
std::runtime_error
std::invalid_argument

◆ command() [6/7]

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.

Parameters
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.
Returns
A std::unique_ptr to a CArcPacket object that contains the controller reply. The packet contents are command dependent.
Exceptions
std::runtime_error
std::invalid_argument

◆ command() [7/7]

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.

Parameters
pCmd- The packet to transmit.
Returns
A std::unique_ptr to a CArcPacket that contains the controller reply.
Exceptions
std::runtime_error
std::invalid_argument

◆ commandAbort()

void arc::gen4::CArcDevice::commandAbort ( void  ) const

Attempts to halt any currently executing command. Primarily used for application responsivness.

Exceptions
Anyexception thrown by std::lock_guard.

◆ expose()

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.

Parameters
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 )
Returns
A pointer to the first available image buffer. Returns nullptr if no buffer is available.
Exceptions
std::runtime_error
std::invalid_argument
std::length_error

◆ stopExpose()

void arc::gen4::CArcDevice::stopExpose ( void  )
noexcept

Stop the current exposure

◆ getImageBufferList()

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.

Returns
The image buffer list as a std::vector.
Exceptions
std::runtime_error

◆ getImageBuffer()

arc::gen4::pImageBuffer_t arc::gen4::CArcDevice::getImageBuffer ( const std::uint16_t  uwIndex = 0) const
noexcept

Returns the image buffer at the specified index. Use getImageBufferCount() to determine the number of image buffers that are available.

Parameters
uwIndex- The image buffer index ( default = 0 ).
Returns
A pointer to the specified image buffer. Returns nullptr if no buffer is available.

◆ getImageBufferCount()

std::size_t arc::gen4::CArcDevice::getImageBufferCount ( void  ) const
noexcept

Returns the number of image buffers that are available.

Returns
The number of available image buffers.

◆ setImageBufferSize() [1/2]

std::uint64_t arc::gen4::CArcDevice::setImageBufferSize ( const std::uint32_t  uiColumns,
const std::uint32_t  uiRows 
)
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.

Parameters
uiColumns- The new image buffer column dimension ( in pixels ).
uiRows- The new image buffer row dimension ( in pixels ).
Returns
The previous image buffer size.

◆ setImageBufferSize() [2/2]

std::uint64_t arc::gen4::CArcDevice::setImageBufferSize ( const std::uint64_t  uiSize)
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.

Parameters
uiSize- The new image buffer size ( in bytes ).
Returns
The previous image buffer size.

◆ getImageBufferSize()

std::uint64_t arc::gen4::CArcDevice::getImageBufferSize ( void  ) const
noexcept

Returns the current image buffer size ( in bytes ).

Returns
The image buffer size ( in bytes ).

◆ setImageBufferFill()

bool arc::gen4::CArcDevice::setImageBufferFill ( const std::uint32_t  uiValue = arc::gen4::CArcDevice::NO_FILL_VALUE) const
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.

Parameters
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 ).
Returns
Returns true if the image buffer will be prefilled with the specified value. Returns false otherwise.

◆ getImageAssembler()

arc::gen4::pImageAssembler_t arc::gen4::CArcDevice::getImageAssembler ( void  ) const
noexcept

Returns a pointer to the internal image assembler.

Returns
A pointer to the internal image assembler. May return nullptr.

◆ enableCommandLogging()

void arc::gen4::CArcDevice::enableCommandLogging ( const bool  bEnable = true)

‍** Registers a command logger for debug purposes.

Enables/disables command logging for debug purposes.

Parameters
bEnable- Set to true to enable logging; false otherwise. ( default = true ).
Exceptions
std::runtime_errorand anything thrown by std::lock_guard().

◆ getCommandLog()

arc::gen4::pLogger_t arc::gen4::CArcDevice::getCommandLog ( void  ) const
noexcept

Returns a pointer to the logger.

Returns
A pointer to a arc::gen4::CArcLog object.
See also
arc::gen4::CArcLog

◆ flashMemoryReadFirmwareBlock() [1/2]

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.

Parameters
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.
Exceptions
std::runtime_error
std::invalid_argument
Anythingexception flashMemoryReadFirmwareBlock() throws

◆ flashMemoryWriteFirmwareBlock()

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.

Parameters
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.
Exceptions
std::runtime_errorand any exception thrown by readFileBytes() and command()

◆ flashMemoryReadIdBlock()

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.

Parameters
uiBoardNumber- The board number of the id block to read.
Returns
A std::string containing the text read from the id block.
Exceptions
std::ios_base::failure
std::runtime_error

◆ flashMemoryReadUserBlock()

const std::string arc::gen4::CArcDevice::flashMemoryReadUserBlock ( const std::uint32_t  uiBoardNumber)

Read data from the flash memory user block.

Parameters
uiBoardNumber- The board number of the user block to read.
Returns
A std::string containing the text read from the user block.
Exceptions
std::ios_base::failure
std::runtime_error

◆ flashMemoryWriteUserBlock()

void arc::gen4::CArcDevice::flashMemoryWriteUserBlock ( const std::uint32_t  uiBoardNumber,
const std::string &  sText 
)

Write data to the flash memory user block.

Parameters
uiBoardNumber- The board number of the user block to write.
sText- A std::string containing the text to be written to the user block.
Exceptions
std::runtime_error
std::invalid_argument

◆ flashMemoryErase()

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.

Parameters
uiBoardNumber- The board number of the memory to erase.
eBlockId- One of the arc::gen4::flashMemoryId_e::FLASH_MEMORY_XXX_ID enumeration constants.
Exceptions
std::runtime_error
std::invalid_argument

◆ readBAR()

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.

Parameters
uiBAR- The base address register number to read.
uiAddress- The offset into the specified BAR to read.
Returns
The DWORD value at the specified BAR offset.
Exceptions
std::runtime_error
std::out_of_range

◆ writeBAR()

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.

Parameters
uiBAR- The base address register number to write.
uiAddress- The offset into the specified BAR to write.
uiValue- The DWORD value to write.
Exceptions
std::runtime_error
std::out_of_range

◆ dumpBARs()

const std::string arc::gen4::CArcDevice::dumpBARs ( void  ) const

Returns a formatted string containing a dump of the ARC-460 PCIe registers.

Returns
A formatted string containing the ARC-460 PCIe register values.
Exceptions
Anyexception thrown by arc::gen4::readBAR().
std::ios_base::failure

◆ setProcessPriority()

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

Parameters
ePriority- The priority level to set the process to.

◆ getProcessPriority()

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.

Returns
The current priority value

◆ readFileBytes()

std::unique_ptr< std::uint8_t[]> arc::gen4::CArcDevice::readFileBytes ( const std::filesystem::path &  tFilePath,
std::uint32_t &  uiFileLength 
)
protected

Reads and returns all the bytes from a binary file.

Parameters
tFilePath- The binary file eto read.
uiFileLength- On return contains the byte length of the file.
Returns
A std::unique_ptr containing the byte data read from the file.
Exceptions
std::runtime_error
std::invalid_argument
std::length_error

◆ download()

arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::download ( arc::gen4::CArcDLoadPacket pDLoad)
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.

Parameters
pDLoad- The firmware packet to transmit.
Returns
A std::unique_ptr to a CArcPacket that contains the controller reply.
Exceptions
Anyexception thrown by command()

◆ clearCommandAbort()

void arc::gen4::CArcDevice::clearCommandAbort ( void  ) const
protected

Clears the command abort status.

Exceptions
Anyexception thrown by std::lock_guard()

◆ commandAborted()

bool arc::gen4::CArcDevice::commandAborted ( void  ) const
protected

Checks to see if an abort command has been issued.

Returns
true if the current command was aborted; false otherwise.
Exceptions
Anyexception thrown by std::lock_guard()

◆ readStatus()

arc::gen4::pStatusPacket_t arc::gen4::CArcDevice::readStatus ( void  ) const
protected

Read status packet in response to a command.

Returns
A status packet pointer or nullptr if no status packet was received.
Exceptions
andany exception thrown by arc::gen4::CArcStatusPacket::assign()

◆ readOut()

void arc::gen4::CArcDevice::readOut ( std::uint32_t &  uiBufferIndex,
const std::uint32_t  uiReadCount,
const readListener_t  fnReadListener 
)
protected

Controls and monitors the image readout.

Parameters
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 )
Exceptions
std::runtime_error

◆ readAlerts()

void arc::gen4::CArcDevice::readAlerts ( const std::chrono::milliseconds  freqMS) const
protected

Receives alert packets into the alert queue.

Parameters
-freqMS - The frequency, in milliseconds, to check for alerts.
Exceptions
std::runtime_error

◆ flashMemoryWriteIdBlock()

void arc::gen4::CArcDevice::flashMemoryWriteIdBlock ( std::uint32_t  uiBoardNumber,
const std::string &  sText 
)
protected

Write data to the flash memory id block.

Parameters
uiBoardNumber- The board number of the id block to read.
sText- A std::string containing the text to be written to the id block.
Exceptions
std::runtime_error
std::invalid_argument

◆ flashMemoryReadFirmwareBlock() [2/2]

std::unique_ptr< std::uint8_t[]> arc::gen4::CArcDevice::flashMemoryReadFirmwareBlock ( std::uint32_t &  uiDataLength,
bool *  pStop,
std::function< void(std::uint32_t, std::uint32_t)>  fProgressListener 
)
protected

Reads the data contained within the ARC - 420 flash memory firmware block.The data will be returned as an array of bytes.

Parameters
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.
Returns
A pointer to the data read from the flash memory firmware block.
Exceptions
std::runtime_error
std::length_error

◆ readConfigSpace8()

virtual bool arc::gen4::CArcDevice::readConfigSpace8 ( std::uint64_t  uiAddress,
std::uint64_t *  pRegValue 
) const
overrideprotectedvirtualnoexcept

Device specific function used to read a BYTE (8-bits) from PCIe configuration space.

Parameters
uiAddress- The PCIe configuration space address to read
pRegValue- A pointer to hold the value read from the specified address
Returns
true if the read succeeded; false otherwise.

Implements arc::gen4::CArcPCIeBase.

◆ readConfigSpace16()

virtual bool arc::gen4::CArcDevice::readConfigSpace16 ( std::uint64_t  uiAddress,
std::uint64_t *  pRegValue 
) const
overrideprotectedvirtualnoexcept

Device specific function used to read a WORD (16-bits) from PCIe configuration space.

Parameters
uiAddress- The PCIe configuration space address to read
pRegValue- A pointer to hold the value read from the specified address
Returns
true if the read succeeded; false otherwise.

Implements arc::gen4::CArcPCIeBase.

◆ readConfigSpace32()

virtual bool arc::gen4::CArcDevice::readConfigSpace32 ( std::uint64_t  uiAddress,
std::uint64_t *  pRegValue 
) const
overrideprotectedvirtualnoexcept

Device specific function used to read a DWORD (32-bits) from PCIe configuration space.

Parameters
uiAddress- The PCIe configuration space address to read
pRegValue- A pointer to hold the value read from the specified address
Returns
true if the read succeeded; false otherwise.

Implements arc::gen4::CArcPCIeBase.

◆ readConfigSpace64()

virtual bool arc::gen4::CArcDevice::readConfigSpace64 ( std::uint64_t  uiAddress,
std::uint64_t *  pRegValue 
) const
overrideprotectedvirtualnoexcept

Device specific function used to read a QWORD (64-bits) from PCIe configuration space.

Parameters
uiAddress- The PCIe configuration space address to read
pRegValue- A pointer to hold the value read from the specified address
Returns
true if the read succeeded; false otherwise.

Implements arc::gen4::CArcPCIeBase.

◆ writeConfigSpace8()

virtual bool arc::gen4::CArcDevice::writeConfigSpace8 ( const std::uint32_t  uiAddress,
const std::uint32_t  uiValue 
) const
overrideprotectedvirtualnoexcept

Device specific function used to write a BYTE (8-bits) to a PCIe configuration space register.

Parameters
uiAddress- The PCIe configuration space address to write
uiValue- The value to write to the specified address
Returns
true if the write succeeded; false otherwise.

Implements arc::gen4::CArcPCIeBase.

◆ writeConfigSpace16()

virtual bool arc::gen4::CArcDevice::writeConfigSpace16 ( const std::uint32_t  uiAddress,
const std::uint32_t  uiValue 
) const
overrideprotectedvirtualnoexcept

Device specific function used to write a WORD (16-bits) to a PCIe configuration space register.

Parameters
uiAddress- The PCIe configuration space address to write
uiValue- The value to write to the specified address
Returns
true if the write succeeded; false otherwise.

Implements arc::gen4::CArcPCIeBase.

◆ writeConfigSpace32()

virtual bool arc::gen4::CArcDevice::writeConfigSpace32 ( const std::uint32_t  uiAddress,
const std::uint32_t  uiValue 
) const
overrideprotectedvirtualnoexcept

Device specific function used to write a DWORD (32-bits) to a PCIe configuration space register.

Parameters
uiAddress- The PCIe configuration space address to write
uiValue- The value to write to the specified address
Returns
true if the write succeeded; false otherwise.

Implements arc::gen4::CArcPCIeBase.

Member Data Documentation

◆ fnReadElapsedTime

std::function<float( void )> arc::gen4::CArcDevice::fnReadElapsedTime

Convenience function to read the elasped exposure time ( in seconds ).

Returns
The elapsed exposure time value in seconds.
Exceptions
Anyexception thrown by arc::gen4::command().

Definition at line 676 of file CArcDevice.h.

◆ fnGetPixelCount

std::function<std::uint32_t( void )> arc::gen4::CArcDevice::fnGetPixelCount

Convenience function to read the current pixel counter.

Returns
The current pixel counter value as a std::uint32_t.
Exceptions
Anyexception thrown by arc::gen4::readBAR().

Definition at line 682 of file CArcDevice.h.

◆ fnResetPixelCounter

std::function<void(void)> arc::gen4::CArcDevice::fnResetPixelCounter

Convenience function to clear the pixel counter.

Exceptions
Anyexception thrown by arc::gen4::writeBAR().

Definition at line 687 of file CArcDevice.h.

◆ fnVerifyDeviceIsOpen

std::function<void(void)> arc::gen4::CArcDevice::fnVerifyDeviceIsOpen

Verify that the device is open

Definition at line 690 of file CArcDevice.h.

◆ NOPARAM

constexpr auto arc::gen4::CArcDevice::NOPARAM = static_cast< std::uint32_t >( 0xFFFFFFFF )
staticconstexpr

No-parameter constant

Definition at line 693 of file CArcDevice.h.

◆ ARC420_BOARD_NUMBER

constexpr auto arc::gen4::CArcDevice::ARC420_BOARD_NUMBER = static_cast< std::uint32_t >( 0x8 )
staticconstexpr

ARC-420 board Id ( fixed )

Definition at line 696 of file CArcDevice.h.

◆ ARC480_BOARD_NUMBER

constexpr auto arc::gen4::CArcDevice::ARC480_BOARD_NUMBER = static_cast< std::uint32_t >( 0x3F )
staticconstexpr

ARC-480 board Id ( fixed )

Definition at line 699 of file CArcDevice.h.

◆ NO_FILL_VALUE

constexpr auto arc::gen4::CArcDevice::NO_FILL_VALUE = static_cast< std::uint32_t >( 65536 )
staticconstexpr

Image buffer Disable Fill value

Definition at line 702 of file CArcDevice.h.

◆ ARC420_SYNTHETIC_DIMENSION

constexpr auto arc::gen4::CArcDevice::ARC420_SYNTHETIC_DIMENSION = static_cast< std::uint32_t >( 2048 )
staticconstexpr

ARC-420 synthetic image dimension ( fixed )

Definition at line 705 of file CArcDevice.h.

◆ ARC420_SYNTHETIC_CHANNEL_COUNT

constexpr auto arc::gen4::CArcDevice::ARC420_SYNTHETIC_CHANNEL_COUNT = static_cast< std::uint32_t >( 16 )
staticconstexpr

ARC-420 synthetic image channel count ( fixed )

Definition at line 708 of file CArcDevice.h.

◆ ARC440_INVALID_CHANNEL_ADDRESS

constexpr auto arc::gen4::CArcDevice::ARC440_INVALID_CHANNEL_ADDRESS = static_cast< std::uint32_t >( 0x99 )
staticconstexpr

ARC-440 invalid channel and address value

Definition at line 711 of file CArcDevice.h.

◆ fnCommonBufferByteCount

std::function<std::uint32_t( const std::size_t )> arc::gen4::CArcDevice::fnCommonBufferByteCount
protected

Convenience function to read the common buffer byte counter.

Parameters
param1- The index of the common buffer ( 0 or 1 ).
Returns
The current number of bytes written to the specified common buffer.
Exceptions
std::out_of_rangeand any exception thrown by arc::gen4::readBAR().

Definition at line 791 of file CArcDevice.h.

◆ fnCommonBufferDirty

std::function<bool( const std::size_t )> arc::gen4::CArcDevice::fnCommonBufferDirty
protected

Convenience function to determine if a common buffer has data available.

Parameters
param1- The index of the common buffer ( 0 or 1 ).
Returns
true if the specified common buffer has been filled with data; false otherwise.
Exceptions
std::out_of_rangeand any exception thrown by arc::gen4::readBAR().

Definition at line 798 of file CArcDevice.h.

◆ fnCommonBufferOverflow

std::function<bool( const std::size_t )> arc::gen4::CArcDevice::fnCommonBufferOverflow
protected

Convenience function to determine if a common buffer has data overflow.

Parameters
param1- The index of the common buffer ( 0 or 1 ).
Returns
true if the specified common buffer has overflowed with data; false otherwise.
Exceptions
std::out_of_rangeand any exception thrown by arc::gen4::readBAR().

Definition at line 805 of file CArcDevice.h.

◆ fnCommonBufferComplete

std::function<bool( const std::size_t )> arc::gen4::CArcDevice::fnCommonBufferComplete
protected

Convenience function to determine if a common buffer is the last to contain data for the current image.

Parameters
param1- The index of the common buffer ( 0 or 1 ).
Returns
true if the specified common buffer is the last to contain data for the current image; false otherwise.
Exceptions
std::out_of_rangeand any exception thrown by arc::gen4::readBAR().

Definition at line 812 of file CArcDevice.h.

◆ fnClearCommonBufferStatus

std::function<void( std::size_t, std::uint32_t )> arc::gen4::CArcDevice::fnClearCommonBufferStatus
protected

Convenience function to clear one or all of the common buffer device status bits.

Parameters
param1- The index of the common buffer ( 0 or 1 ).
param2- Bitmask of status bit to clear.
Exceptions
std::out_of_rangeand any exception thrown by arc::gen4::readBAR().

Definition at line 819 of file CArcDevice.h.

◆ fnClearPacketBuffers

std::function<void( void )> arc::gen4::CArcDevice::fnClearPacketBuffers
protected

Convenience function to clear the packet send and receive buffers.

Exceptions
Anyexception thrown by arc::gen4::writeBAR().

Definition at line 824 of file CArcDevice.h.

◆ fnImageAddressError

std::function<std::tuple<bool,std::uint32_t>(void)> arc::gen4::CArcDevice::fnImageAddressError
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.

Returns
A tuple with index 0 being true if an address error has been detected. Index 1 contains the PCIe status register value that was read.
Exceptions
std::out_of_rangeand any exception thrown by arc::gen4::readBAR().

Definition at line 834 of file CArcDevice.h.

◆ m_pCommonBufferStatusRegisters

std::unique_ptr<const std::array<std::uint32_t,2> > arc::gen4::CArcDevice::m_pCommonBufferStatusRegisters
staticprotected

Common buffer status register list

Definition at line 886 of file CArcDevice.h.

◆ m_pCommonBufferStatusByteCountRegisters

std::unique_ptr<const std::array<std::uint32_t, 2> > arc::gen4::CArcDevice::m_pCommonBufferStatusByteCountRegisters
staticprotected

Common buffer byte counter register list

Definition at line 889 of file CArcDevice.h.

◆ m_sVersion

const std::string arc::gen4::CArcDevice::m_sVersion
staticprotected

version() text holder

Definition at line 892 of file CArcDevice.h.

◆ m_sToString

const std::string arc::gen4::CArcDevice::m_sToString
staticprotected

toString() text holder

Definition at line 895 of file CArcDevice.h.

◆ m_pCommonBuffer

std::unique_ptr<arc::gen4::commonBuffer_t> arc::gen4::CArcDevice::m_pCommonBuffer
protected

Kernel packet buffer

Definition at line 898 of file CArcDevice.h.

◆ m_pCommonBufferList

std::unique_ptr<arc::gen4::commonBufferList_t> arc::gen4::CArcDevice::m_pCommonBufferList
protected

Split kernel packet buffer list

Definition at line 901 of file CArcDevice.h.

◆ m_pBufferList

std::unique_ptr<std::vector<arc::gen4::pImageBuffer_t> > arc::gen4::CArcDevice::m_pBufferList
protected

Image buffer list

Definition at line 904 of file CArcDevice.h.

◆ m_uiBufferSize

std::uint64_t arc::gen4::CArcDevice::m_uiBufferSize
protected

Image buffer size

Definition at line 907 of file CArcDevice.h.

◆ m_pImagePacketQueue

std::unique_ptr<std::queue<arc::gen4::CArcImagePacket*> > arc::gen4::CArcDevice::m_pImagePacketQueue
protected

Image packet queue

Definition at line 910 of file CArcDevice.h.

◆ m_tDevice

arc::gen4::arcDevHandle_t arc::gen4::CArcDevice::m_tDevice
protected

Device handle

Definition at line 913 of file CArcDevice.h.

◆ m_pvDevList

std::unique_ptr<std::vector<arcDev_t> > arc::gen4::CArcDevice::m_pvDevList
staticprotected

Device list

Definition at line 916 of file CArcDevice.h.

◆ m_pCommandLogger

std::shared_ptr<arc::gen4::CArcLog> arc::gen4::CArcDevice::m_pCommandLogger
protected

Command logger ( for debug )

Definition at line 919 of file CArcDevice.h.

◆ m_fnAlertHandler

alertHandler_t arc::gen4::CArcDevice::m_fnAlertHandler
protected

‍** Command log handler ( for debug ) *‍/

Alert handler

Definition at line 925 of file CArcDevice.h.

◆ m_pAlertThread

std::thread* arc::gen4::CArcDevice::m_pAlertThread
protected

Alert thread

Definition at line 928 of file CArcDevice.h.

◆ m_pImgAssembler

std::shared_ptr<CArcImageAssembler> arc::gen4::CArcDevice::m_pImgAssembler
protected

Image packet reassembler

Definition at line 931 of file CArcDevice.h.

◆ m_uiFillValue

std::uint32_t arc::gen4::CArcDevice::m_uiFillValue
mutableprotected

Image buffer prefill value. A value of NO_FILL_VALUE disables prefill option.

Definition at line 934 of file CArcDevice.h.

◆ m_oCmdMutex

std::mutex arc::gen4::CArcDevice::m_oCmdMutex
mutableprotected

Mutex for commands/replies

Definition at line 937 of file CArcDevice.h.

◆ m_oCmdAbortMutex

std::mutex arc::gen4::CArcDevice::m_oCmdAbortMutex
mutableprotected

Command abort mutex

Definition at line 940 of file CArcDevice.h.

◆ m_abCmdAbort

std::atomic_bool arc::gen4::CArcDevice::m_abCmdAbort
mutableprotected

Command abort

Definition at line 943 of file CArcDevice.h.

◆ m_abStopAlertCapture

std::atomic_bool arc::gen4::CArcDevice::m_abStopAlertCapture
protected

Alert capture stop

Definition at line 946 of file CArcDevice.h.

◆ m_pExposeStopSource

std::unique_ptr<std::stop_source> arc::gen4::CArcDevice::m_pExposeStopSource
protected

Expose stop

Definition at line 949 of file CArcDevice.h.

◆ m_bFlashMemoryBlockAccess

bool arc::gen4::CArcDevice::m_bFlashMemoryBlockAccess
protected

Flash memory id block access permission

Definition at line 952 of file CArcDevice.h.

◆ ELAPSED_TIMEOUT_COUNT

constexpr auto arc::gen4::CArcDevice::ELAPSED_TIMEOUT_COUNT = static_cast< std::uint32_t >( 20 )
staticconstexprprotected

Elapsed exposure time timeout counter

Definition at line 955 of file CArcDevice.h.

◆ READ_TIMEOUT_COUNT

constexpr auto arc::gen4::CArcDevice::READ_TIMEOUT_COUNT = static_cast< std::uint32_t >( 100 )
staticconstexprprotected

Image readRunnable timeout counter

Definition at line 958 of file CArcDevice.h.