ifw-ccf  1.0.0
List of all members
ccf::protocols::aravis::ComAdptAravis Class Reference

CCF Com. Int. implementing communication based on the Aravis open-source glib/gobject-based library for Genicam cameras. More...

#include <comAdptAravis.hpp>

Inheritance diagram for ccf::protocols::aravis::ComAdptAravis:
ccf::common::ComAdptBase ccf::common::Base

Public Attributes

Various constants.
const double CONNECT_TIMEOUT = 10.0
 
const double FRAME_REC_THR_SLEEP_TIME = 0.0005
 
const uint16_t MAX_NB_OF_RECEP_BUFFERS = 100
 
const uint16_t NB_OF_INPUT_BUFFERS = 5
 
const int32_t DEFAULT_PACKET_SIZE = 1500
 
const uint32_t STREAM_BYTES_PER_SECOND_MIN = 1000000
 
const uint32_t STREAM_BYTES_PER_SECOND_MAX = 248000000
 

GigE Vision parameter names.

const std::string GIGE_PAR_ACQUISITION_ABORT = "AcquisitionAbort"
 
const std::string GIGE_PAR_ACQUISITION_MODE = "AcquisitionMode"
 
const std::string GIGE_PAR_ACQUISITION_START = "AcquisitionStart"
 
const std::string GIGE_PAR_ACQUISITION_STOP = "AcquisitionStop"
 
const std::string GIGE_PAR_DEVICE_VENDOR_NAME = "DeviceVendorName"
 
const std::string GIGE_PAR_PACKET_SIZE = "PacketSize"
 
const std::string GIGE_PAR_PAYLOAD_SIZE = "PayloadSize"
 
const std::string GIGE_PAR_PIXELFORMAT = "PixelFormat"
 
const std::string GIGE_PAR_SENSOR_BITS = "SensorBits"
 
const std::string GIGE_PAR_SENSOR_HEIGHT = "SensorHeight"
 
const std::string GIGE_PAR_SENSOR_TYPE = "SensorType"
 
const std::string GIGE_PAR_SENSOR_WIDTH = "SensorWidth"
 
const std::string GIGE_PAR_STREAM_BYTES_PER_SECOND = "StreamBytesPerSecond"
 
const std::string GIGE_PAR_TIMESTAMP_TICK_FREQ = "TimestampTickFreq"
 
const std::string GIGE_PAR_FRAME_TRIGGER_MODE = "FrameStartTriggerMode"
 
const std::string GIGE_PAR_TRIGGER_MODE = "TriggerMode"
 
const std::string GIGE_PAR_TRIGGER_SOURCE = "TriggerSource"
 
const std::map< int, std::string > ARV_BUFFER_STATUS_STRING
 
ccf::common::ExpoMode p_expo_mode
 
bool p_exec_fr_acq_thr
 
bool p_term_fr_acq_thr
 
int32_t p_cur_buffer_index
 
ArvDevice * p_device
 
ArvFrame p_frame_buffers [100]
 
bool p_frame_buffers_in_use [100]
 
uint32_t p_frame_count
 
bool p_ignore_frame_skipping
 
double p_last_missing_data_log
 
int32_t p_payload_size
 
std::map< ArvBufferStatus, std::string > p_status_map
 
ArvStream * p_stream
 
int32_t p_acq_thr_buf_index
 
bool p_waiting_for_frame
 
double p_timestamp_frequency
 
std::thread * p_fr_acq_thr
 
struct sched_param p_fr_acq_thr_sched_par
 
std::string m_vendor
 
int32_t m_bytes_per_pixel
 
int32_t m_sensor_height
 
int32_t m_sensor_width
 
double m_cur_expo_time
 
double m_cur_expo_frame_rate
 
int32_t m_cur_expo_bin_x
 
int32_t m_cur_expo_bin_y
 
int32_t m_cur_expo_win_start_x
 
int32_t m_cur_expo_win_start_y
 
int32_t m_cur_expo_win_width
 
int32_t m_cur_expo_win_height
 
 ComAdptAravis ()
 
virtual ~ComAdptAravis ()
 
virtual void InitialiseUser ()
 
virtual void CheckConnectionUser (bool &connected)
 
virtual void CheckStatusUser (ccf::common::HwStatus &status, std::string &message)
 
virtual void ConnectUser ()
 
virtual void DisconnectUser ()
 
virtual bool IsConnectedUser () const
 
virtual void ReadUser (const std::string &name, ctd::param::Parameter &par)
 
virtual void ReceiveUser (ccf::common::DataFrame &frame, bool &frame_received, const double timeout, bool &timed_out)
 
virtual void ScanUser (std::vector< ctd::param::Parameter > &pars)
 
virtual void StartUser ()
 
virtual void StopUser ()
 
virtual void WriteUser (const ctd::param::Parameter &par)
 
virtual double GetTheoreticFrameRateUser ()
 
virtual void _AdjustStreamBytesPerSecHook ()
 
virtual int8_t _ReadBasicParsHook ()
 
virtual int8_t _WriteParHook (ctd::param::Parameter &par, bool &ignore_unknown)
 
bool GetAcqThrExecFlag ()
 
void _Reset ()
 
void _ClearCamHandle ()
 

Additional Inherited Members

- Public Member Functions inherited from ccf::common::ComAdptBase
 ComAdptBase ()
 
virtual ~ComAdptBase ()
 
ccf::common::ConfigBaseCfg ()
 Return reference to general configuration object (singleton). More...
 
const std::string & GetCameraAddress () const
 Return the address of the camera from the configuration. More...
 
const std::string & GetId () const
 Get the ID of the associated camera. More...
 
void SetHostAdddress (const std::string &host_address)
 Set the address of the host (network interface) used for communicating with the camera. More...
 
const std::string & GetHostAddress ()
 Return the address of the host (network interface) used for communicating with the camera. More...
 
void SetIsSimAdapter (const bool is_sim)
 Set the Simulation Adapter Flag. More...
 
bool GetIsSimAdapter () const
 Return the Simulation Adapter Flag. More...
 
void SetProtocol (const std::string &protocol)
 Set the communication protocol used. More...
 
const std::string & GetProtocol () const
 Return the communication protocol used. More...
 
template<class TYPE >
TYPE GetCameraProperty (const std::string &property)
 
bool HasCameraProperty (const std::string &property, std::string &value)
 
double GetTheoreticFrameRate ()
 Render the theoritic, possible achievable frame rate (frame/s). More...
 
void LoadCameraNameMapping (const std::string &name_mapping_file)
 
void Initialise (const bool re_init=false)
 
void SetCameraAddress (const std::string &address)
 Set the internal address, e.g. URI, used for communicating with the camera. More...
 
void CheckConnection (bool &connected)
 Check if the connection to the camera is OK. More...
 
void CheckStatus (ccf::common::HwStatus &status, std::string &message)
 Check the status of the camera (health status). More...
 
bool IsConnected () const
 Returns true if the connection to the camera is established and valid. More...
 
void Connect ()
 
void Disconnect ()
 Disconnect from the camera. More...
 
void WriteAdapterProps ()
 
virtual void WriteAdapterPropsUser ()
 
void SetIsConnected (const bool connected)
 
bool GetAllowLostFrames () const
 Return flag (cfg par) indicating if lost frames shall be ignored silently. More...
 
uint64_t IncLostFramesCount ()
 Increment the counter of lost frames. The new value is returned. More...
 
uint64_t GetLostFramesCount () const
 Return the number of lost frames currently registered. More...
 
void ResetLostFramesCount ()
 Reset the lost frames counter. More...
 
void Read (const std::string &name, ctd::param::Parameter &par)
 
void Read (const std::vector< std::string > &names, std::vector< ctd::param::Parameter > &pars)
 
std::string Read (const std::string &name)
 
template<class TYPE >
TYPE Read (const std::string &name)
 Template method to read a parameter, taking care of the conversion to the desired user representation. More...
 
void Write (const ctd::param::Parameter &par)
 
void Write (const std::vector< ctd::param::Parameter > &pars)
 
template<class TYPE >
void Write (const std::string &name, const TYPE &value)
 Template method to write a parameter, taking care of converting the user data into the internal type. More...
 
void Receive (ccf::common::DataFrame &frame, bool &frame_received, const double timeout, bool &timed_out)
 
void Scan (std::vector< ctd::param::Parameter > &pars)
 Scan the address of the associated camera and store the parameters in the vector. More...
 
void Start ()
 Start the image acquisition in the camera. More...
 
void Stop ()
 Stop the image acquisition in the camera. More...
 
void HandleSetup ()
 
void HandleParPreWrite (ctd::param::Parameter &par)
 
void HandleParPostWrite (ctd::param::Parameter &par)
 Invoked after writing to the camera in case additional processing and downloading of parameters is needed. More...
 
void HandleParPostRead (ctd::param::Parameter &par)
 Invoked before reading a parameter from the camera, in case speciel handling is needed. More...
 
void MapParForDevice (ctd::param::Parameter &par) const
 
void MapParFromDevice (ctd::param::Parameter &par) const
 
bool HasNameMapping (const std::string &name) const
 Return true if a mapping is defined in the Camera Name Mapping for the given name. More...
 
virtual void SetCameraAddressUser (const std::string &address)
 
virtual bool HasCameraPropertyUser (const std::string &property, std::string &value)
 
virtual void ReadUser (const std::vector< std::string > &names, std::vector< ctd::param::Parameter > &pars)
 
virtual void WriteUser (const std::vector< ctd::param::Parameter > &pars)
 
virtual void HandleSetupUser ()
 
virtual void HandleParPreWriteUser (ctd::param::Parameter &par)
 
virtual void HandleParPostWriteUser (ctd::param::Parameter &par)
 
virtual void HandleParPostReadUser (ctd::param::Parameter &par)
 
- Public Member Functions inherited from ccf::common::Base
 Base ()
 
 ~Base ()
 
const std::string & GetClassName () const
 Return the allocated name of the class. More...
 
- Static Public Member Functions inherited from ccf::common::Base
static ccf::mptk::ManagerMptk ()
 Return reference to internal MPTK instance (singleton). More...
 
static void SetLogLevel (const ccf::common::LogLevel log_level)
 Set the log level. More...
 
static ccf::common::LogLevel GetLogLevel ()
 Return the current CCF log level. More...
 
- Protected Member Functions inherited from ccf::common::Base
void SetClassName (const std::string &class_name)
 Set the name of the class in question. More...
 
- Protected Attributes inherited from ccf::common::ComAdptBase
bool m_is_connected
 

Detailed Description

CCF Com. Int. implementing communication based on the Aravis open-source glib/gobject-based library for Genicam cameras.

Implements ccf::common::ComAdptBase.

Constructor & Destructor Documentation

◆ ComAdptAravis()

ccf::protocols::aravis::ComAdptAravis::ComAdptAravis ( )

◆ ~ComAdptAravis()

ccf::protocols::aravis::ComAdptAravis::~ComAdptAravis ( )
virtual

Member Function Documentation

◆ _AdjustStreamBytesPerSecHook()

void ccf::protocols::aravis::ComAdptAravis::_AdjustStreamBytesPerSecHook ( )
virtual

◆ _ClearCamHandle()

void ccf::protocols::aravis::ComAdptAravis::_ClearCamHandle ( )
protected

◆ _ReadBasicParsHook()

int8_t ccf::protocols::aravis::ComAdptAravis::_ReadBasicParsHook ( )
virtual

◆ _Reset()

void ccf::protocols::aravis::ComAdptAravis::_Reset ( )
protected

◆ _WriteParHook()

int8_t ccf::protocols::aravis::ComAdptAravis::_WriteParHook ( ctd::param::Parameter &  par,
bool &  ignore_unknown 
)
virtual

◆ CheckConnectionUser()

void ccf::protocols::aravis::ComAdptAravis::CheckConnectionUser ( bool &  connected)
virtual

Specific implementation of the connection check algorithm. See also "CheckConnection()".

Reimplemented from ccf::common::ComAdptBase.

◆ CheckStatusUser()

void ccf::protocols::aravis::ComAdptAravis::CheckStatusUser ( ccf::common::HwStatus status,
std::string &  message 
)
virtual

Specific implementation of the status check algorithm. See also "CheckStatus()".

Reimplemented from ccf::common::ComAdptBase.

◆ ConnectUser()

void ccf::protocols::aravis::ComAdptAravis::ConnectUser ( )
virtual

Specific implementation of the connection algorithm to connect to the camera. See also "Connect()".

Reimplemented from ccf::common::ComAdptBase.

◆ DisconnectUser()

void ccf::protocols::aravis::ComAdptAravis::DisconnectUser ( )
virtual

Specific implementation of the algorithm to disconnect from the camera. See also "Disconnect()".

Reimplemented from ccf::common::ComAdptBase.

◆ GetAcqThrExecFlag()

bool ccf::protocols::aravis::ComAdptAravis::GetAcqThrExecFlag ( )

◆ GetTheoreticFrameRateUser()

double ccf::protocols::aravis::ComAdptAravis::GetTheoreticFrameRateUser ( )
virtual

Specific implementation of the algorithm to estimate the theoretic frame rate. Need normally not to be provided for specific Communication Adapters. See also "GetTheoreticFrameRate()".

Reimplemented from ccf::common::ComAdptBase.

◆ InitialiseUser()

void ccf::protocols::aravis::ComAdptAravis::InitialiseUser ( )
virtual

Specific implementation of the adapter/camera initialisation. See also "Initialise()".

Reimplemented from ccf::common::ComAdptBase.

◆ IsConnectedUser()

bool ccf::protocols::aravis::ComAdptAravis::IsConnectedUser ( ) const
virtual

Specific implementation of the algorithm to determine if a connection to the camera is established. See also "IsConnected()".

Reimplemented from ccf::common::ComAdptBase.

◆ ReadUser()

void ccf::protocols::aravis::ComAdptAravis::ReadUser ( const std::string &  name,
ctd::param::Parameter &  par 
)
virtual

Specific implementation of the reading of single parameter from the camera. See also "Read(single)".

Reimplemented from ccf::common::ComAdptBase.

◆ ReceiveUser()

void ccf::protocols::aravis::ComAdptAravis::ReceiveUser ( ccf::common::DataFrame frame,
bool &  frame_received,
const double  timeout,
bool &  timed_out 
)
virtual

Specific implementation of the frame reception. See also "Receive()".

Reimplemented from ccf::common::ComAdptBase.

◆ ScanUser()

void ccf::protocols::aravis::ComAdptAravis::ScanUser ( std::vector< ctd::param::Parameter > &  pars)
virtual

Specific implementation of the scanning of the defined parameters in the camera namespace. See also "Scan()".

Reimplemented from ccf::common::ComAdptBase.

◆ StartUser()

void ccf::protocols::aravis::ComAdptAravis::StartUser ( )
virtual

Specific implementation of the algorithm to start the image acquisition in the camera. See also "Start()".

Reimplemented from ccf::common::ComAdptBase.

◆ StopUser()

void ccf::protocols::aravis::ComAdptAravis::StopUser ( )
virtual

Specific implementation of the algorithm to stop the image acquisition in the camera. See also "Stop()".

Reimplemented from ccf::common::ComAdptBase.

◆ WriteUser()

void ccf::protocols::aravis::ComAdptAravis::WriteUser ( const ctd::param::Parameter &  par)
virtual

Specific implementation of the algorithm to write single parameters to the camera. See also "Write(single)".

Reimplemented from ccf::common::ComAdptBase.

Member Data Documentation

◆ ARV_BUFFER_STATUS_STRING

const std::map<int, std::string> ccf::protocols::aravis::ComAdptAravis::ARV_BUFFER_STATUS_STRING
Initial value:
=
{
{ARV_BUFFER_STATUS_UNKNOWN, "Unknown error"},
{ARV_BUFFER_STATUS_SUCCESS, "Success"},
{ARV_BUFFER_STATUS_CLEARED, "Buffer cleared"},
{ARV_BUFFER_STATUS_TIMEOUT, "Timeout"},
{ARV_BUFFER_STATUS_MISSING_PACKETS, "Missing packets"},
{ARV_BUFFER_STATUS_WRONG_PACKET_ID, "Wrong packet ID"},
{ARV_BUFFER_STATUS_SIZE_MISMATCH, "Size mismatch"},
{ARV_BUFFER_STATUS_FILLING, "Buffer filling"},
{ARV_BUFFER_STATUS_ABORTED, "Aborted"}
}

◆ CONNECT_TIMEOUT

const double ccf::protocols::aravis::ComAdptAravis::CONNECT_TIMEOUT = 10.0

◆ DEFAULT_PACKET_SIZE

const int32_t ccf::protocols::aravis::ComAdptAravis::DEFAULT_PACKET_SIZE = 1500

◆ FRAME_REC_THR_SLEEP_TIME

const double ccf::protocols::aravis::ComAdptAravis::FRAME_REC_THR_SLEEP_TIME = 0.0005

◆ GIGE_PAR_ACQUISITION_ABORT

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_ACQUISITION_ABORT = "AcquisitionAbort"

◆ GIGE_PAR_ACQUISITION_MODE

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_ACQUISITION_MODE = "AcquisitionMode"

◆ GIGE_PAR_ACQUISITION_START

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_ACQUISITION_START = "AcquisitionStart"

◆ GIGE_PAR_ACQUISITION_STOP

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_ACQUISITION_STOP = "AcquisitionStop"

◆ GIGE_PAR_DEVICE_VENDOR_NAME

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_DEVICE_VENDOR_NAME = "DeviceVendorName"

◆ GIGE_PAR_FRAME_TRIGGER_MODE

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_FRAME_TRIGGER_MODE = "FrameStartTriggerMode"

◆ GIGE_PAR_PACKET_SIZE

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_PACKET_SIZE = "PacketSize"

◆ GIGE_PAR_PAYLOAD_SIZE

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_PAYLOAD_SIZE = "PayloadSize"

◆ GIGE_PAR_PIXELFORMAT

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_PIXELFORMAT = "PixelFormat"

◆ GIGE_PAR_SENSOR_BITS

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_SENSOR_BITS = "SensorBits"

◆ GIGE_PAR_SENSOR_HEIGHT

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_SENSOR_HEIGHT = "SensorHeight"

◆ GIGE_PAR_SENSOR_TYPE

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_SENSOR_TYPE = "SensorType"

◆ GIGE_PAR_SENSOR_WIDTH

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_SENSOR_WIDTH = "SensorWidth"

◆ GIGE_PAR_STREAM_BYTES_PER_SECOND

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_STREAM_BYTES_PER_SECOND = "StreamBytesPerSecond"

◆ GIGE_PAR_TIMESTAMP_TICK_FREQ

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_TIMESTAMP_TICK_FREQ = "TimestampTickFreq"

◆ GIGE_PAR_TRIGGER_MODE

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_TRIGGER_MODE = "TriggerMode"

◆ GIGE_PAR_TRIGGER_SOURCE

const std::string ccf::protocols::aravis::ComAdptAravis::GIGE_PAR_TRIGGER_SOURCE = "TriggerSource"

◆ m_bytes_per_pixel

int32_t ccf::protocols::aravis::ComAdptAravis::m_bytes_per_pixel
protected

◆ m_cur_expo_bin_x

int32_t ccf::protocols::aravis::ComAdptAravis::m_cur_expo_bin_x
protected

◆ m_cur_expo_bin_y

int32_t ccf::protocols::aravis::ComAdptAravis::m_cur_expo_bin_y
protected

◆ m_cur_expo_frame_rate

double ccf::protocols::aravis::ComAdptAravis::m_cur_expo_frame_rate
protected

◆ m_cur_expo_time

double ccf::protocols::aravis::ComAdptAravis::m_cur_expo_time
protected

◆ m_cur_expo_win_height

int32_t ccf::protocols::aravis::ComAdptAravis::m_cur_expo_win_height
protected

◆ m_cur_expo_win_start_x

int32_t ccf::protocols::aravis::ComAdptAravis::m_cur_expo_win_start_x
protected

◆ m_cur_expo_win_start_y

int32_t ccf::protocols::aravis::ComAdptAravis::m_cur_expo_win_start_y
protected

◆ m_cur_expo_win_width

int32_t ccf::protocols::aravis::ComAdptAravis::m_cur_expo_win_width
protected

◆ m_sensor_height

int32_t ccf::protocols::aravis::ComAdptAravis::m_sensor_height
protected

◆ m_sensor_width

int32_t ccf::protocols::aravis::ComAdptAravis::m_sensor_width
protected

◆ m_vendor

std::string ccf::protocols::aravis::ComAdptAravis::m_vendor
protected

◆ MAX_NB_OF_RECEP_BUFFERS

const uint16_t ccf::protocols::aravis::ComAdptAravis::MAX_NB_OF_RECEP_BUFFERS = 100

◆ NB_OF_INPUT_BUFFERS

const uint16_t ccf::protocols::aravis::ComAdptAravis::NB_OF_INPUT_BUFFERS = 5

◆ p_acq_thr_buf_index

int32_t ccf::protocols::aravis::ComAdptAravis::p_acq_thr_buf_index

◆ p_cur_buffer_index

int32_t ccf::protocols::aravis::ComAdptAravis::p_cur_buffer_index

◆ p_device

ArvDevice* ccf::protocols::aravis::ComAdptAravis::p_device

◆ p_exec_fr_acq_thr

bool ccf::protocols::aravis::ComAdptAravis::p_exec_fr_acq_thr

◆ p_expo_mode

ccf::common::ExpoMode ccf::protocols::aravis::ComAdptAravis::p_expo_mode

◆ p_fr_acq_thr

std::thread* ccf::protocols::aravis::ComAdptAravis::p_fr_acq_thr

◆ p_fr_acq_thr_sched_par

struct sched_param ccf::protocols::aravis::ComAdptAravis::p_fr_acq_thr_sched_par

◆ p_frame_buffers

ArvFrame ccf::protocols::aravis::ComAdptAravis::p_frame_buffers[100]

◆ p_frame_buffers_in_use

bool ccf::protocols::aravis::ComAdptAravis::p_frame_buffers_in_use[100]

◆ p_frame_count

uint32_t ccf::protocols::aravis::ComAdptAravis::p_frame_count

◆ p_ignore_frame_skipping

bool ccf::protocols::aravis::ComAdptAravis::p_ignore_frame_skipping

◆ p_last_missing_data_log

double ccf::protocols::aravis::ComAdptAravis::p_last_missing_data_log

◆ p_payload_size

int32_t ccf::protocols::aravis::ComAdptAravis::p_payload_size

◆ p_status_map

std::map<ArvBufferStatus, std::string> ccf::protocols::aravis::ComAdptAravis::p_status_map

◆ p_stream

ArvStream* ccf::protocols::aravis::ComAdptAravis::p_stream

◆ p_term_fr_acq_thr

bool ccf::protocols::aravis::ComAdptAravis::p_term_fr_acq_thr

◆ p_timestamp_frequency

double ccf::protocols::aravis::ComAdptAravis::p_timestamp_frequency

◆ p_waiting_for_frame

bool ccf::protocols::aravis::ComAdptAravis::p_waiting_for_frame

◆ STREAM_BYTES_PER_SECOND_MAX

const uint32_t ccf::protocols::aravis::ComAdptAravis::STREAM_BYTES_PER_SECOND_MAX = 248000000

◆ STREAM_BYTES_PER_SECOND_MIN

const uint32_t ccf::protocols::aravis::ComAdptAravis::STREAM_BYTES_PER_SECOND_MIN = 1000000

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