eGrabber Reference  24.04.0.8
Public Member Functions | List of all members
EGrabber< CallbackModel >

An EGrabber object encapsulates a set of related GenTL modules (an interface, a device, a data stream, a remote device, and a number of buffers). More...

#include <EGrabber.h>

Inherits EGrabberBase, EGrabberEventCallbacks, and EGrabberScriptCallbacks.

Public Member Functions

virtual ~EGrabber ()
 
int getLastEventGrabberIndex ()
 Get the grabber index of the last event received on the current thread. More...
 
EGrabberGenICam grabbers (int ix)
 Access the GenICam interface of a specific underlying grabber. More...
 
Constructor
 EGrabber (EGenTL &gentl, int interfaceIndex=0, int deviceIndex=0, int dataStreamIndex=0, gc::DEVICE_ACCESS_FLAGS deviceOpenFlags=defaultDeviceOpenFlags, bool remoteRequired=true)
 Create an EGrabber object. More...
 
 EGrabber (const EGrabberInfo &grabber, gc::DEVICE_ACCESS_FLAGS deviceOpenFlags=defaultDeviceOpenFlags, bool remoteRequired=true)
 Create an EGrabber object for a discovered grabber (EGrabberDiscovery) More...
 
 EGrabber (const EGrabberCameraInfo &camera, gc::DEVICE_ACCESS_FLAGS deviceOpenFlags=defaultDeviceOpenFlags)
 Create an EGrabber object for a discovered camera (EGrabberDiscovery) More...
 
Buffer manipulation
BufferIndexRange reallocBuffers (size_t bufferCount, size_t bufferSize=0)
 Reallocates the buffers. More...
 
BufferIndexRange announceAndQueue (const GenTLMemory &memory, size_t bufferCount=1)
 Allocate, announce and queue a memory buffer. More...
 
BufferIndexRange announceAndQueue (const UserMemory &memory)
 Announce and queue a user-allocated memory buffer. More...
 
BufferIndexRange announceAndQueue (const UserMemoryArray &memory)
 Announce and queue an array of contiguous buffers using a user-allocated memory buffer. More...
 
BufferIndexRange announceAndQueue (const UserMemoryArray &memory, bool reverse)
 Announce and queue optionally in a reverse order an array of contiguous buffers using a user-allocated memory buffer. More...
 
BufferIndexRange announceAndQueue (const BusMemory &memory)
 Announce and queue a user-allocated bus-memory buffer. More...
 
BufferIndexRange announceAndQueue (const NvidiaRdmaMemory &memory)
 Announce and queue a user-allocated device-memory buffer. More...
 
void flushBuffers (gc::ACQ_QUEUE_TYPE operation=gc::ACQ_QUEUE_ALL_TO_INPUT)
 Move buffers from/to specific data stream buffer queues (see ACQ_QUEUE_TYPE_LIST) More...
 
void resetBufferQueue ()
 Reset the buffers queues. More...
 
void resetBufferQueue (const BufferIndexRange &range)
 Reset and queue a range of announced buffers. More...
 
void queue (const BufferIndexRange &range)
 Queue a range of announced buffers. More...
 
void revoke (const BufferIndexRange &range)
 Revoke a range of announced buffers. More...
 
bool shouldReannounceBuffers ()
 Get an indication about the need to reconfigure internal resources such as the DMA. More...
 
bool shouldReallocBuffers ()
 Get an indication about the need to reallocate buffers because the payload size or the alignment changed. More...
 
Acquisitions
void start (uint64_t frameCount=GENTL_INFINITE, bool controlRemoteDevice=true)
 Start acquisitions. More...
 
void stop ()
 Stop acquisitions. More...
 
Image format
size_t getWidth ()
 Get the width (in pixels) of images produced by the grabber. More...
 
size_t getHeight ()
 Get the height (in lines) of images produced by the grabber. More...
 
size_t getPayloadSize ()
 Get the payload size of images produced by the grabber. More...
 
std::string getPixelFormat ()
 Get the pixel format of images produced by the grabber. More...
 
GenTL get info

Working with GenTL Module info commands

template<typename M , typename T >
getInfo (int32_t cmd)
 Getting Module information. More...
 
template<typename T >
getBufferInfo (size_t bufferIndex, gc::BUFFER_INFO_CMD cmd)
 Get information of buffer at index bufferIndex. More...
 
NewBufferData getBufferData (size_t bufferIndex)
 Get handle details of buffer at index bufferIndex. More...
 
GenTL port access
template<typename P >
bool isOpen ()
 Check if a port has been opened. More...
 
template<typename P >
void gcReadPortData (uint64_t address, void *data, size_t size)
 Read data from port. More...
 
template<typename P >
void gcWritePortData (uint64_t address, const void *data, size_t size)
 Write data to port. More...
 
template<typename P >
std::vector< char > gcReadPort (uint64_t address, size_t size)
 Read size bytes from specified port at given address. More...
 
template<typename P >
void gcWritePort (uint64_t address, const std::vector< char > &data)
 Write data.size() bytes to specified port at given address. More...
 
template<typename P , typename V >
gcReadPortValue (uint64_t address)
 Read a single value from specified port at given address. More...
 
template<typename P , typename V >
void gcWritePortValue (uint64_t address, V value)
 Write a single value to specified port at given address. More...
 
template<typename P >
std::string gcReadPortString (uint64_t address, size_t size)
 Read size bytes as null-terminated string from specified port at given address. More...
 
GenApi functions

Working with GenApi Port Module features

template<typename P >
int64_t getInteger (const std::string &feature)
 Get Integer (INT64) value of specified GenApi Port Module feature. More...
 
template<typename P >
double getFloat (const std::string &feature)
 Get Float (DOUBLE) value of specified GenApi Port Module feature. More...
 
template<typename P >
std::string getString (const std::string &feature)
 Get String value of specified GenApi Port Module feature. More...
 
template<typename P >
void getStringData (const std::string &feature, std::vector< char > &data)
 Get String data of specified GenApi Port Module feature. More...
 
template<typename P >
std::vector< std::string > getStringList (const std::string &what)
 Get list of String values returned by some query on GenApi Port Module. More...
 
template<typename P >
void getRegister (const std::string &feature, void *data, size_t size)
 Read data of specified GenApi Port Module register feature. More...
 
template<typename P >
void setInteger (const std::string &feature, int64_t value)
 Set Integer (INT64) value of specified GenApi Port Module feature. More...
 
template<typename P >
void setFloat (const std::string &feature, double value)
 Set Float (DOUBLE) value of specified GenApi Port Module feature. More...
 
template<typename P >
void setString (const std::string &feature, const std::string &value)
 Set String value of specified GenApi Port Module feature. More...
 
template<typename P >
void setRegister (const std::string &feature, const void *data, size_t size)
 Write data to specified GenApi Port Module register feature. More...
 
template<typename P >
void execute (const std::string &command)
 Execute specified GenApi Port Module command feature. More...
 
template<typename P >
void attachEvent (uint64_t eventId, const void *buffer, size_t size)
 Attach GenApi event to specified GenApi Port Module. More...
 
template<typename P >
void invalidate (const std::string &feature)
 Invalidate cache of specified GenApi Port Module feature (and its dependencies) More...
 
void runScript (const std::string &script, void *context=0)
 Run a Euresys GenApi script. More...
 
void interruptScript (const std::string &scriptId)
 Interrupt the execution of a running Euresys GenApi script. More...
 
virtual ge::GENAPI_UI_CALLBACK_RET_CODE onScriptUiCallback (const std::string &operation, void *context, const std::map< std::string, std::string > &args, std::string &value)
 
Memento
void memento (const std::string &text)
 Output text to Memento. More...
 
void memento (unsigned char verbosity, unsigned char kind, const std::string &text)
 Output text to Memento with specified verbosity and user kind. More...
 
void mementoWaveUp (unsigned char kind, unsigned char id)
 Inject a user analyzer event UP into the memento logging system with a "+1" semantic on the user wave form of the analyzer event specified by id. More...
 
void mementoWaveDown (unsigned char kind, unsigned char id)
 Inject a user analyzer event DOWN into the memento logging system with a "-1" semantic on the user wave form of the analyzer event specified by id. More...
 
void mementoWaveReset (unsigned char kind, unsigned char id)
 Inject a user analyzer event RESET into the memento logging system with a "reset to 0" semantic on the user wave form of the analyzer event specified by id. More...
 
void mementoWaveValue (unsigned char kind, unsigned char id, uint64_t value)
 Inject a user analyzer event VALUE into the memento logging system with a "set to value" semantic on the user wave form of the analyzer event specified by id. More...
 
void mementoWaveNoValue (unsigned char kind, unsigned char id)
 Inject a user analyzer event NOVALUE into the memento logging system with a "disable value" semantic on the user wave form of the analyzer event specified by id. More...
 
Events
template<typename DATA >
void enableEvent ()
 Enable event handling for the specified event. More...
 
template<typename DATA >
void disableEvent ()
 Disable event handling for the specified event. More...
 
template<typename DATA >
void flushEvent ()
 Flush the event queue(s) More...
 
NewBufferData pop (uint64_t timeout=GENTL_INFINITE)
 Return a NewBufferData structure (to be given to ScopedBuffer or Buffer) More...
 
template<typename DATA1 , typename DATA2 , typename DATA3 , typename DATA4 , typename DATA5 , typename DATA6 , typename DATA7 , typename DATA8 >
size_t pop (OneOf< DATA1, DATA2, DATA3, DATA4, DATA5, DATA6, DATA7, DATA8 > &oneOf, int &position, uint64_t timeout=GENTL_INFINITE)
 Get the oldest event from a series of requested events described in OneOf. More...
 
void cancelPop ()
 Cancel a waiting pop. More...
 
template<typename ANYDATA >
size_t processEvent (uint64_t timeout=GENTL_INFINITE)
 Invoke the corresponding Event Callback(s) More...
 
template<typename ANYDATA >
void cancelEvent ()
 Cancel a waiting processEvent<ANYDATA> the current processEvent<ANYDATA> will abort by throwing a gentl_error (GenTL::GC_ERR_ABORT) exception. More...
 
template<typename ANYDATA >
size_t getPendingEventCount ()
 Get the number of pending events in the different DATA queues. More...
 
Event Callbacks

The following methods are overridable callbacks. They are invoked if

  • their corresponding events are enabled with enableEvent<DATA>
  • events do occur
    Note
    depending on the EGrabber callback configuration (Available Callback threading models), the callbacks are invoked at different timings and from different contexts
virtual void onNewBufferEvent (const NewBufferData &data)
 
virtual void onIoToolboxEvent (const IoToolboxData &data)
 
virtual void onCicEvent (const CicData &data)
 
virtual void onDataStreamEvent (const DataStreamData &data)
 
virtual void onCxpInterfaceEvent (const CxpInterfaceData &data)
 
virtual void onDeviceErrorEvent (const DeviceErrorData &data)
 
virtual void onCxpDeviceEvent (const CxpDeviceData &data)
 
virtual void onRemoteDeviceEvent (const RemoteDeviceData &data)
 
Thread start/stop callbacks

The following methods are overridable callbacks. They are invoked when a callback thread starts or stops:

  • onThreadStart is executed from the thread as soon as it started
  • onThreadStop is executed from the thread when it is about to exit These callbacks are reserved for advanced users who need to perform very specific operations on a callback thread before its event processing loop starts (e.g. changing thread priority).
    Parameters
    typethe event type(s) the thread processes
    Precondition
    only available for EGrabber configurations CallbackSingleThread and CallbackMultiThread
virtual void onThreadStart (EventType type)
 
virtual void onThreadStop (EventType type)
 
Cleanup
virtual void shutdown ()
 Explicitly shutdown an EGrabber object. More...
 

Detailed Description

template<typename CallbackModel = CallbackOnDemand>
class Euresys::EGrabber< CallbackModel >

An EGrabber object encapsulates a set of related GenTL modules (an interface, a device, a data stream, a remote device, and a number of buffers).

Constructor & Destructor Documentation

◆ EGrabber() [1/3]

EGrabber ( EGenTL gentl,
int  interfaceIndex = 0,
int  deviceIndex = 0,
int  dataStreamIndex = 0,
gc::DEVICE_ACCESS_FLAGS  deviceOpenFlags = defaultDeviceOpenFlags,
bool  remoteRequired = true 
)

Create an EGrabber object.

Template Parameters
CallbackModelthe EGrabber callback configuration to use (Available Callback threading models)
Parameters
gentlEGenTL object
interfaceIndexindex of the InterfaceModule to use
deviceIndexindex of the DeviceModule to use
dataStreamIndexindex of the StreamModule to use
deviceOpenFlagshow the device is to be opened
remoteRequiredwhether the remote device is required to create the grabber
Exceptions
gentl_errorGenTL::GC_ERR_INVALID_ADDRESS if remoteRequired is true and there is no available remote device when the grabber is created
Note
Partial EGrabber objects (e.g., a grabber with only the interface module, or a grabber with the interface and device modules but without the datastream) can be created by passing -1 as interfaceIndex, deviceIndex, or dataStreamIndex

◆ EGrabber() [2/3]

EGrabber ( const EGrabberInfo grabber,
gc::DEVICE_ACCESS_FLAGS  deviceOpenFlags = defaultDeviceOpenFlags,
bool  remoteRequired = true 
)

Create an EGrabber object for a discovered grabber (EGrabberDiscovery)

◆ EGrabber() [3/3]

EGrabber ( const EGrabberCameraInfo camera,
gc::DEVICE_ACCESS_FLAGS  deviceOpenFlags = defaultDeviceOpenFlags 
)

Create an EGrabber object for a discovered camera (EGrabberDiscovery)

◆ ~EGrabber()

virtual ~EGrabber ( )
virtual

Member Function Documentation

◆ reallocBuffers()

BufferIndexRange reallocBuffers ( size_t  bufferCount,
size_t  bufferSize = 0 
)

Reallocates the buffers.

reallocBuffers performs the following operations:

  • revoke current buffers (if any)
  • allocate bufferCount buffers (if bufferSize is zero, the size is determined automatically)
  • announce the new buffers to the data stream
  • queue the new buffers to the data stream input fifo
Note
reallocBuffers invalidates all buffer indexes

◆ announceAndQueue() [1/6]

BufferIndexRange announceAndQueue ( const GenTLMemory memory,
size_t  bufferCount = 1 
)

Allocate, announce and queue a memory buffer.

◆ announceAndQueue() [2/6]

BufferIndexRange announceAndQueue ( const UserMemory memory)

Announce and queue a user-allocated memory buffer.

◆ announceAndQueue() [3/6]

BufferIndexRange announceAndQueue ( const UserMemoryArray memory)

Announce and queue an array of contiguous buffers using a user-allocated memory buffer.

◆ announceAndQueue() [4/6]

BufferIndexRange announceAndQueue ( const UserMemoryArray memory,
bool  reverse 
)

Announce and queue optionally in a reverse order an array of contiguous buffers using a user-allocated memory buffer.

◆ announceAndQueue() [5/6]

BufferIndexRange announceAndQueue ( const BusMemory memory)

Announce and queue a user-allocated bus-memory buffer.

◆ announceAndQueue() [6/6]

BufferIndexRange announceAndQueue ( const NvidiaRdmaMemory memory)

Announce and queue a user-allocated device-memory buffer.

◆ flushBuffers()

void flushBuffers ( gc::ACQ_QUEUE_TYPE  operation = gc::ACQ_QUEUE_ALL_TO_INPUT)

Move buffers from/to specific data stream buffer queues (see ACQ_QUEUE_TYPE_LIST)

◆ resetBufferQueue() [1/2]

void resetBufferQueue ( )

Reset the buffers queues.

resetBufferQueue performs the following operations:

  • discard pending buffers (if any)
  • queue all buffers to the data stream input fifo, in the initial order (i.e., the order in which they were announced with reallocBuffers or announceBuffer)
Note
the data stream must be idle when calling this function

◆ resetBufferQueue() [2/2]

void resetBufferQueue ( const BufferIndexRange range)

Reset and queue a range of announced buffers.

resetBufferQueue performs the following operations:

  • discard pending buffers (if any)
  • queue the buffers of the given range to the data stream input fifo
    Parameters
    rangerange of announced buffers (returned by reallocBuffers or announceAndQueue)
    Note
    the data stream must be idle when calling this function

◆ queue()

void queue ( const BufferIndexRange range)

Queue a range of announced buffers.

queue a range of announced buffers

Parameters
rangerange of announced buffers (returned by reallocBuffers or announceAndQueue)

◆ revoke()

void revoke ( const BufferIndexRange range)

Revoke a range of announced buffers.

Note
revoke does not invalidate other buffer indexes

◆ shouldReannounceBuffers()

bool shouldReannounceBuffers ( )

Get an indication about the need to reconfigure internal resources such as the DMA.

In this case the already announced buffers need to be revoked and announced again otherwise some changes in the stream configuration like StripeArrangement would not be taken into account

◆ shouldReallocBuffers()

bool shouldReallocBuffers ( )

Get an indication about the need to reallocate buffers because the payload size or the alignment changed.

In this case the already announced buffers need to be revoked and reallocated

◆ start()

void start ( uint64_t  frameCount = GENTL_INFINITE,
bool  controlRemoteDevice = true 
)

Start acquisitions.

Parameters
frameCountthe number of buffers to fill
controlRemoteDevicedefines whether or not to start and stop the remote device by automatically executing AcquisitionStart and AcquisitionStop commands

start performs the following operations:

  • start the data stream for frameCount buffers
  • if controlRemoteDevice is true, start the remote device by executing AcquisitionStart
  • for Coaxlink and Grablink Duo, start the Camera and Illumination Controller by executing ActivateCic
Note
the data stream must be idle when calling this function
when frameCount buffers have been filled, the data stream automatically goes idle, but the remote device is not stopped
if controlRemoteDevice is true, AcquisitionStop will be exectuted in a subsequent call to stop (or in the EGrabber destructor)
by default NewBufferData event will be enabled, unless explicitly disabled beforehand

◆ stop()

void stop ( )

Stop acquisitions.

stop performs the following operations:

  • for Coaxlink and Grablink Duo, stop the Camera and Illumination Controller by executing DeactivateCic
  • stop the remote device (unless start was called with controlRemoteDevice = false)
  • stop the data stream
Note
this function will block until the data stream is idle

◆ getWidth()

size_t getWidth ( )

Get the width (in pixels) of images produced by the grabber.

◆ getHeight()

size_t getHeight ( )

Get the height (in lines) of images produced by the grabber.

Note
for line-scan cameras, the height is determined by the data stream feature "BufferHeight"

◆ getPayloadSize()

size_t getPayloadSize ( )

Get the payload size of images produced by the grabber.

◆ getPixelFormat()

std::string getPixelFormat ( )

Get the pixel format of images produced by the grabber.

Note
both the camera and the data stream influence this

◆ getInfo()

T getInfo ( int32_t  cmd)

Getting Module information.

Template Parameters
MModule to query (Available GenTL/Port Modules)
TThe C++ type corresponding to the type (GenTL::INFO_DATATYPE_LIST) of data to get
Parameters
cmdthe info command to get, available values depend on the module M
Note
the template parameter M cannot be set to RemoteModule because the GenTL standard does not expose module information about the remote device

◆ getBufferInfo()

T getBufferInfo ( size_t  bufferIndex,
gc::BUFFER_INFO_CMD  cmd 
)

Get information of buffer at index bufferIndex.

Template Parameters
TThe C++ type corresponding to the type (GenTL::INFO_DATATYPE_LIST) of data to get
Parameters
bufferIndexthe index of the buffer to query (see BufferIndexRange)
cmdcmd values belong to either GenTL::BUFFER_INFO_CMD_LIST or GenTL::EuresysCustomGenTL::BUFFER_INFO_CUSTOM_CMD_LIST

◆ getBufferData()

NewBufferData getBufferData ( size_t  bufferIndex)

Get handle details of buffer at index bufferIndex.

Parameters
bufferIndexthe index of the buffer to query (see BufferIndexRange)

◆ isOpen()

bool isOpen ( )

Check if a port has been opened.

Template Parameters
PPort Module to check (Available GenTL/Port Modules)

◆ gcReadPortData()

void gcReadPortData ( uint64_t  address,
void *  data,
size_t  size 
)

Read data from port.

Template Parameters
PPort Module to use (Available GenTL/Port Modules)
Parameters
addressbyte address to read from
dataoutput buffer
sizenumber of bytes to read

◆ gcWritePortData()

void gcWritePortData ( uint64_t  address,
const void *  data,
size_t  size 
)

Write data to port.

Template Parameters
PPort Module to use (Available GenTL/Port Modules)
Parameters
addressbyte address to write to
datainput buffer containing the data to write
sizenumber of bytes to write

◆ gcReadPort()

std::vector<char> gcReadPort ( uint64_t  address,
size_t  size 
)

Read size bytes from specified port at given address.

Template Parameters
PPort Module to use (Available GenTL/Port Modules)
Parameters
addressbyte address to read from
sizenumber of bytes to read

◆ gcWritePort()

void gcWritePort ( uint64_t  address,
const std::vector< char > &  data 
)

Write data.size() bytes to specified port at given address.

Template Parameters
PPort Module to use (Available GenTL/Port Modules)
Parameters
addressbyte address to write to
datainput buffer containing the data to write

◆ gcReadPortValue()

V gcReadPortValue ( uint64_t  address)

Read a single value from specified port at given address.

Template Parameters
PPort Module to use (Available GenTL/Port Modules)
VThe C++ type corresponding to the value to read
Parameters
addressbyte address to read from

◆ gcWritePortValue()

void gcWritePortValue ( uint64_t  address,
value 
)

Write a single value to specified port at given address.

Template Parameters
PPort Module to use (Available GenTL/Port Modules)
VThe C++ type corresponding to the value to write
Parameters
addressbyte address to write to
valuevalue to write as a sequence of bytes

◆ gcReadPortString()

std::string gcReadPortString ( uint64_t  address,
size_t  size 
)

Read size bytes as null-terminated string from specified port at given address.

Template Parameters
PPort Module to use (Available GenTL/Port Modules)
Parameters
addressbyte address to read from
sizenumber of bytes to read
Note
any trailing null character will be trimmed

◆ getInteger()

int64_t getInteger ( const std::string &  feature)

Get Integer (INT64) value of specified GenApi Port Module feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to read (EGenTL::genapiGetInteger)

◆ getFloat()

double getFloat ( const std::string &  feature)

Get Float (DOUBLE) value of specified GenApi Port Module feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to read (EGenTL::genapiGetFloat)

◆ getString()

std::string getString ( const std::string &  feature)

Get String value of specified GenApi Port Module feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to read (EGenTL::genapiGetString)

◆ getStringData()

void getStringData ( const std::string &  feature,
std::vector< char > &  data 
)

Get String data of specified GenApi Port Module feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to read (EGenTL::genapiGetString)
dataan optionally resized vector

◆ getStringList()

std::vector<std::string> getStringList ( const std::string &  what)

Get list of String values returned by some query on GenApi Port Module.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
whatEuresys specific query to perform, such queries are built using the helpers from Euresys::query

◆ getRegister()

void getRegister ( const std::string &  feature,
void *  data,
size_t  size 
)

Read data of specified GenApi Port Module register feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to read (EGenTL::genapiGetRegister)
dataoutput buffer
sizenumber of bytes to read

◆ setInteger()

void setInteger ( const std::string &  feature,
int64_t  value 
)

Set Integer (INT64) value of specified GenApi Port Module feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to modify (EGenTL::genapiSetInteger)
valuevalue to write

◆ setFloat()

void setFloat ( const std::string &  feature,
double  value 
)

Set Float (DOUBLE) value of specified GenApi Port Module feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to modify (EGenTL::genapiSetFloat)
valuevalue to write

◆ setString()

void setString ( const std::string &  feature,
const std::string &  value 
)

Set String value of specified GenApi Port Module feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to modify (EGenTL::genapiSetString) or Euresys specific action to perform, such actions are built using the helpers from Euresys::action
valuevalue to write (or parameter of the action to perform)

◆ setRegister()

void setRegister ( const std::string &  feature,
const void *  data,
size_t  size 
)

Write data to specified GenApi Port Module register feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to modify (EGenTL::genapiSetRegister)
datainput buffer containing the data to write
sizenumber of bytes to write

◆ execute()

void execute ( const std::string &  command)

Execute specified GenApi Port Module command feature.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
commandname of feature to execute (EGenTL::genapiExecuteCommand)

◆ attachEvent()

void attachEvent ( uint64_t  eventId,
const void *  buffer,
size_t  size 
)

Attach GenApi event to specified GenApi Port Module.

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
eventIdGenApi event identifier
bufferoptional event data associated to the event
sizesize of the optional event data in bytes

◆ invalidate()

void invalidate ( const std::string &  feature)

Invalidate cache of specified GenApi Port Module feature (and its dependencies)

Template Parameters
PGenApi Port Module to use (Available GenTL/Port Modules)
Parameters
featurename of feature to invalidate (EGenTL::genapiInvalidate)
Note
this only invalidates the cache (the feature itself will not be changed)

◆ runScript()

void runScript ( const std::string &  script,
void *  context = 0 
)

Run a Euresys GenApi script.

Parameters
scriptEuresys GenApi script to run, this can be either a location (path) or some actual script statements (EGenTL::genapiRunScript)
contextan optional context that is passed to the callback onScriptUiCallback

◆ interruptScript()

void interruptScript ( const std::string &  scriptId)

Interrupt the execution of a running Euresys GenApi script.

Parameters
scriptIdIdentifier of the script to interrupt. It is returned by the user interface callback with operation "scriptid" and parameter name "id" (EGenTL::genapiInterruptScript)
Precondition
interruptScript cannot be called from onScriptUiCallback

◆ onScriptUiCallback()

virtual ge::GENAPI_UI_CALLBACK_RET_CODE onScriptUiCallback ( const std::string &  operation,
void *  context,
const std::map< std::string, std::string > &  args,
std::string &  value 
)
virtual

◆ memento() [1/2]

void memento ( const std::string &  text)

Output text to Memento.

Note
text is inserted into the stream of Memento traces under the Kind "User0" with the verbosity MEMENTO_VERBOSITY_INFO

◆ memento() [2/2]

void memento ( unsigned char  verbosity,
unsigned char  kind,
const std::string &  text 
)

Output text to Memento with specified verbosity and user kind.

Parameters
verbosity
  • MEMENTO_VERBOSITY_CRITICAL
  • MEMENTO_VERBOSITY_ERROR
  • MEMENTO_VERBOSITY_WARNING
  • MEMENTO_VERBOSITY_NOTICE
  • MEMENTO_VERBOSITY_INFO
  • MEMENTO_VERBOSITY_DEBUG
  • MEMENTO_VERBOSITY_VERBOSE
kinduser kind identifier, from 0 to 15
  • 0 to output trace under the Kind "User0"
  • 1 to output trace under the Kind "User1"
  • ...
  • 10 (0xA) to output trace under the Kind "UserA"
  • 11 (0xB) to output trace under the Kind "UserB"
  • 12 (0xC) to output trace under the Kind "UserC"
  • 13 (0xD) to output trace under the Kind "UserD"
  • 14 (0xE) to output trace under the Kind "UserE"
  • 15 (0xF) to output trace under the Kind "UserF"
textstring to output

◆ mementoWaveUp()

void mementoWaveUp ( unsigned char  kind,
unsigned char  id 
)

Inject a user analyzer event UP into the memento logging system with a "+1" semantic on the user wave form of the analyzer event specified by id.

Note
The id values from 0 to 15 are mapped onto "UserWave0" to "UserWaveF"
The display name of these 15 user analyzer events can be changed in the Analyzer Configurator panel of the Memento application using the Alias property found in the Advanced tab of the Analyzer Configurator panel
Parameters
kinduser kind identifier, from 0 to 15, mapped onto "User0" to "UserF"
iduser analyzer event identifier, from 0 to 15, mapped onto "UserWave0" to "UserWaveF"

◆ mementoWaveDown()

void mementoWaveDown ( unsigned char  kind,
unsigned char  id 
)

Inject a user analyzer event DOWN into the memento logging system with a "-1" semantic on the user wave form of the analyzer event specified by id.

Note
The id values from 0 to 15 are mapped onto "UserWave0" to "UserWaveF"
The display name of these 15 user analyzer events can be changed in the Analyzer Configurator panel of the Memento application using the Alias property found in the Advanced tab of the Analyzer Configurator panel
Parameters
kinduser kind identifier, from 0 to 15, mapped onto "User0" to "UserF"
iduser analyzer event identifier, from 0 to 15, mapped onto "UserWave0" to "UserWaveF"

◆ mementoWaveReset()

void mementoWaveReset ( unsigned char  kind,
unsigned char  id 
)

Inject a user analyzer event RESET into the memento logging system with a "reset to 0" semantic on the user wave form of the analyzer event specified by id.

Note
The id values from 0 to 15 are mapped onto "UserWave0" to "UserWaveF"
The display name of these 15 user analyzer events can be changed in the Analyzer Configurator panel of the Memento application using the Alias property found in the Advanced tab of the Analyzer Configurator panel
Parameters
kinduser kind identifier, from 0 to 15, mapped onto "User0" to "UserF"
iduser analyzer event identifier, from 0 to 15, mapped onto "UserWave0" to "UserWaveF"

◆ mementoWaveValue()

void mementoWaveValue ( unsigned char  kind,
unsigned char  id,
uint64_t  value 
)

Inject a user analyzer event VALUE into the memento logging system with a "set to value" semantic on the user wave form of the analyzer event specified by id.

Note
The id values from 0 to 15 are mapped onto "UserWaveValue0" to "UserWaveValueF"
The display name of these 15 user analyzer events can be changed in the Analyzer Configurator panel of the Memento application using the Alias property found in the Advanced tab of the Analyzer Configurator panel
Parameters
kinduser kind identifier, from 0 to 15, mapped onto "User0" to "UserF"
iduser analyzer event identifier, from 0 to 15, mapped onto "UserWaveValue0" to "UserWaveValueF"
valuevalue of the analyzer event

◆ mementoWaveNoValue()

void mementoWaveNoValue ( unsigned char  kind,
unsigned char  id 
)

Inject a user analyzer event NOVALUE into the memento logging system with a "disable value" semantic on the user wave form of the analyzer event specified by id.

Note
The id values from 0 to 15 are mapped onto "UserWaveValue0" to "UserWaveValueF"
The display name of these 15 user analyzer events can be changed in the Analyzer Configurator panel of the Memento application using the Alias property found in the Advanced tab of the Analyzer Configurator panel
Parameters
kinduser kind identifier, from 0 to 15, mapped onto "User0" to "UserF"
iduser analyzer event identifier, from 0 to 15, mapped onto "UserWaveValue0" to "UserWaveValueF"

◆ enableEvent()

void enableEvent ( )

Enable event handling for the specified event.

Template Parameters
DATAthe event(s) to enable (Available Event DATA types to enable)
Note
by default NewBufferData is enabled in method start, unless explicitly disabled beforehand
under the hood, this method registers the corresponding GenTL event(s) to the system.

◆ disableEvent()

void disableEvent ( )

Disable event handling for the specified event.

Template Parameters
DATAthe event(s) to disable (Available Event DATA types to enable)
Note
under the hood, this method unregisters the corresponding GenTL event(s) from the system.

◆ flushEvent()

void flushEvent ( )

Flush the event queue(s)

Template Parameters
DATAthe event(s) to flush (Available Event DATA types to enable)

◆ pop() [1/2]

NewBufferData pop ( uint64_t  timeout = GENTL_INFINITE)

Return a NewBufferData structure (to be given to ScopedBuffer or Buffer)

Parameters
timeouttimeout in milliseconds
Precondition
only available for EGrabber configuration CallbackOnDemand
NewBufferData event is enabled
EGrabber is not already waiting for NewBufferData event in another thread
Note
only the most important exceptions are listed below
Exceptions
gentl_errorGenTL::GC_ERR_ABORT when cancelPop
gentl_errorGenTL::GC_ERR_INVALID_HANDLE when NewBufferData event is disabled
gentl_errorGenTL::GC_ERR_TIMEOUT when pop times out before an event occurs
client_errorwith message "EGrabber is busy in another thread" if EGrabber is already waiting for NewBufferData event in another thread with either pop or processEvent
client_errorwith message "EGrabber has no registered event for this filter" if NewBufferData event is not enabled

◆ pop() [2/2]

size_t pop ( OneOf< DATA1, DATA2, DATA3, DATA4, DATA5, DATA6, DATA7, DATA8 > &  oneOf,
int &  position,
uint64_t  timeout = GENTL_INFINITE 
)

Get the oldest event from a series of requested events described in OneOf.

Parameters
oneOfdescription of events to wait for
position1-based position of the popped event data in the OneOf structure
timeouttimeout in milliseconds
Returns
the number of pending events
Precondition
only available for EGrabber configuration CallbackOnDemand
Request event types are enabled
EGrabber is not already waiting for one of the requested event in another thread
Note
only the most important exceptions are listed below
Exceptions
gentl_errorGenTL::GC_ERR_ABORT when cancelPop or cancelEvent
gentl_errorGenTL::GC_ERR_INVALID_HANDLE when a requested event is disabled
gentl_errorGenTL::GC_ERR_TIMEOUT when pop times out before an event occurs
client_errorwith message "EGrabber is busy in another thread" if EGrabber is already waiting for a requested event in another thread with either pop or processEvent
client_errorwith message "EGrabber has no registered event for this filter" if no requested event is enabled

◆ cancelPop()

void cancelPop ( )

Cancel a waiting pop.

Precondition
only available for EGrabber configuration CallbackOnDemand
Note
any waiting pop will be aborted by throwing a gentl_error (GenTL::GC_ERR_ABORT) exception
cancelPop is equivalent to cancelEvent<NewBufferData>

◆ processEvent()

size_t processEvent ( uint64_t  timeout = GENTL_INFINITE)

Invoke the corresponding Event Callback(s)

Precondition
events are enabled (enableEvent<DATA>)
events are available
Template Parameters
ANYDATAthe set of events to process (Available Event DATA types to process)
Returns
the number of pending events when the callback returned
Precondition
only available for EGrabber configuration CallbackOnDemand
EGrabber is not already waiting for one of ANYDATA event in another thread
Note
only the most important exceptions are listed below
Exceptions
gentl_errorGenTL::GC_ERR_ABORT when cancelEvent
gentl_errorGenTL::GC_ERR_INVALID_HANDLE when corresponding event is disabled
gentl_errorGenTL::GC_ERR_TIMEOUT when processEvent times out before an event occurs
client_errorwith message "EGrabber is busy in another thread" if EGrabber is already waiting for one of ANYDATA event in another thread with pop or processEvent
client_errorwith message "EGrabber has no registered event for this filter" if none of ANYDATA event is enabled

◆ cancelEvent()

void cancelEvent ( )

Cancel a waiting processEvent<ANYDATA> the current processEvent<ANYDATA> will abort by throwing a gentl_error (GenTL::GC_ERR_ABORT) exception.

Template Parameters
ANYDATAthe set of events to cancel (Available Event DATA types to process)
Precondition
only available for EGrabber configuration CallbackOnDemand

◆ getPendingEventCount()

size_t getPendingEventCount ( )

Get the number of pending events in the different DATA queues.

Template Parameters
ANYDATAthe set of event queues to query (Available Event DATA types to process)
Precondition
only available for EGrabber configuration CallbackOnDemand

◆ onNewBufferEvent()

virtual void onNewBufferEvent ( const NewBufferData data)
virtual

◆ onIoToolboxEvent()

virtual void onIoToolboxEvent ( const IoToolboxData data)
virtual

◆ onCicEvent()

virtual void onCicEvent ( const CicData data)
virtual
Precondition
enableEvent<CicData>

◆ onDataStreamEvent()

virtual void onDataStreamEvent ( const DataStreamData data)
virtual

◆ onCxpInterfaceEvent()

virtual void onCxpInterfaceEvent ( const CxpInterfaceData data)
virtual

◆ onDeviceErrorEvent()

virtual void onDeviceErrorEvent ( const DeviceErrorData data)
virtual

◆ onCxpDeviceEvent()

virtual void onCxpDeviceEvent ( const CxpDeviceData data)
virtual

◆ onRemoteDeviceEvent()

virtual void onRemoteDeviceEvent ( const RemoteDeviceData data)
virtual

◆ onThreadStart()

virtual void onThreadStart ( EventType  type)
virtual

◆ onThreadStop()

virtual void onThreadStop ( EventType  type)
virtual

◆ getLastEventGrabberIndex()

int getLastEventGrabberIndex ( )

Get the grabber index of the last event received on the current thread.

◆ grabbers()

EGrabberGenICam grabbers ( int  ix)

Access the GenICam interface of a specific underlying grabber.

Parameters
ixthe index of the grabber to access
Note
this is useful when the EGrabber instance is managing a camera composed by several remote devices and a remote device needs to be queried or configured independently

◆ shutdown()

virtual void shutdown ( )
virtual

Explicitly shutdown an EGrabber object.

Note
this is useful to completely shutdown an EGrabber (including any pending or executing callback) from the destructor of a derived class when callbacks use derived class resources; this is required if callbacks are still executing when destroying grabbers using CallbackMultiThread or CallbackSingleThread models

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