Skip to content
Snippets Groups Projects
Commit a67100b8 authored by Angel Santamaria-Navarro's avatar Angel Santamaria-Navarro
Browse files

minor changes. debugging memory leak

parent fc2dadc6
No related branches found
No related tags found
No related merge requests found
#edit the following line to add the librarie's header files
FIND_PATH(mvbluefox3_INCLUDE_DIR mvbluefox3.h /usr/include/iridrivers /usr/local/include/iridrivers)
FIND_PATH(mvbluefox3_INCLUDE_DIR mvbluefox3.h /usr/include/iridrivers/mvbluefox3 /usr/local/include/iridrivers/mvbluefox3)
FIND_LIBRARY(mvbluefox3_LIBRARY
NAMES mvbluefox3
......
# driver source files
SET(sources mvbluefox3.cpp mutex/mutex.cpp mvbluefox3_settings.cpp
exceptions/exceptions.cpp exceptions/mvbluefox3_exceptions.cpp
exceptions/mutex_exceptions.cpp)
SET(sources mvbluefox3.cpp mvbluefox3_settings.cpp)
SET(sources_ex exceptions/exceptions.cpp exceptions/mvbluefox3_exceptions.cpp
exceptions/mutex_exceptions.cpp)
SET(sources_mut mutex/mutex.cpp)
# application header files
SET(headers mvbluefox3.h mutex/mutex.h mvbluefox3_settings.h
mvbluefox3_mvfunc.h exceptions/exceptions.h exceptions/mvbluefox3_exceptions.h exceptions/mutex_exceptions.h)
SET(headers mvbluefox3.h mvbluefox3_settings.h mvbluefox3_mvfunc.h)
SET(headers_ex mvbluefox3.h exceptions/exceptions.h
exceptions/mvbluefox3_exceptions.h exceptions/mutex_exceptions.h)
SET(headers_mut mutex/mutex.h)
#IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release)
......@@ -36,7 +39,7 @@ endif(OpenCV_FOUND)
INCLUDE_DIRECTORIES(. ${mvIMPACT_INCLUDE_DIR})
# create the shared library
ADD_LIBRARY(mvbluefox3 SHARED ${sources})
ADD_LIBRARY(mvbluefox3 SHARED ${sources} ${sources_ex} ${sources_mut})
#if CV then add the libraries
if (USE_CV)
......@@ -51,7 +54,10 @@ INSTALL(TARGETS mvbluefox3
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/iridrivers
ARCHIVE DESTINATION lib/iridrivers)
INSTALL(FILES ${headers} DESTINATION include/iridrivers)
INSTALL(FILES ${headers} DESTINATION include/iridrivers/mvbluefox3)
INSTALL(FILES ${headers_ex} DESTINATION include/iridrivers/mvbluefox3/exceptions)
INSTALL(FILES ${headers_mut} DESTINATION include/iridrivers/mvbluefox3/mutex)
INSTALL(FILES ../Findmvbluefox3.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
INSTALL(FILES ../FindmvIMPACT.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
ADD_SUBDIRECTORY(examples)
......@@ -2,6 +2,10 @@
#include <boost/timer.hpp>
#include <unistd.h>
#ifdef HAVE_OPENCV_H
#include <opencv2/opencv.hpp>
#endif
#define WINDOW_NAME "mvBlueFOX3 TEST"
std::string GetSerialFromUser(void)
......@@ -19,7 +23,7 @@ int main(int argc, char *argv[])
cam_ptr = new CMvbluefox3::CMvbluefox3("F0300141");
CMvbluefox3::CParams params; //default parameters.
cam_ptr->Configure(params);
cam_ptr->SetConfig(params);
#ifdef HAVE_OPENCV_H
std::cout << "[Camera test]: Acquiring images." << std::endl;
......
......@@ -4,6 +4,16 @@
#include <iostream>
#include <sstream>
#ifdef HAVE_OPENCV_H
#include <opencv2/opencv.hpp>
#endif
// comment this line to see the effect of queue underruns
#define DROP_OUTDATED_IMAGES
// uncomment this line to get more output into the console window
//#define VERBOSE_OUTPUT
namespace CMvbluefox3 {
CMvbluefox3::CMvbluefox3(const std::string &serial)
......@@ -19,6 +29,9 @@ CMvbluefox3::CMvbluefox3(const std::string &serial)
this->depth_ = 8;
this->bytes_per_pixel_ = 1;
// displayPropertyData(this->device_->defaultRequestCount);
// WriteProperty(this->device_->defaultRequestCount,1);
// open device
OpenDevice(serial);
}
......@@ -79,7 +92,7 @@ void CMvbluefox3::OpenDevice(const std::string &serial)
this->lut_ctrl_ = new mvIMPACT::acquire::GenICam::LUTControl(this->device_);
this->stats_ = new mvIMPACT::acquire::Statistics(this->device_);
Configure(this->params_,true);
SetConfig(this->params_,true);
}
void CMvbluefox3::CloseDevice(void)
......@@ -244,7 +257,7 @@ int CMvbluefox3::ReqExposeUs(void)
return this->request_->infoExposeTime_us.read();
}
void CMvbluefox3::Configure(CParams &params, bool ini)
void CMvbluefox3::SetConfig(CParams &params, bool ini)
{
// Clear request queue
this->fi_->imageRequestReset(0, 0);
......@@ -327,6 +340,12 @@ void CMvbluefox3::Configure(CParams &params, bool ini)
params_ = params;
}
CParams CMvbluefox3::GetConfig(void)
{
return this->params_;
}
void CMvbluefox3::SetImgSize(int &width, int &height)
{
try{
......
#ifndef _MVBLUEFOX3_H
#define _MVBLUEFOX3_H
#include "mvbluefox3_settings.h"
#include "mvbluefox3_mvfunc.h"
#include "mutex/mutex.h"
#include "mvbluefox3_settings.h"
#include <mvIMPACT_CPP/mvIMPACT_acquire.h>
#include <mvIMPACT_CPP/mvIMPACT_acquire_GenICam.h>
#ifdef HAVE_OPENCV_H
#include <opencv2/opencv.hpp>
#endif
// Forward delcaration
namespace cv { class Mat; }
namespace CMvbluefox3 {
......@@ -132,7 +130,6 @@ class CMvbluefox3
{
private:
CParams params_; // Image parameters.
mvIMPACT::acquire::DeviceManager devMgr_; // Device Manager.
......@@ -420,11 +417,18 @@ class CMvbluefox3
int ReqExposeUs(void);
/**
* \brief Configure device.
* \brief Set Configuration to the device.
*
* Configure main camera parameters.
* Set main camera parameters.
*/
void Configure(CParams &params, bool ini = false);
void SetConfig(CParams &params, bool ini = false);
/**
* \brief Get Configuration.
*
* Get main camera parameters.
*/
CParams GetConfig(void);
};
} // End of CMvbluefox3 namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment