diff --git a/Findmvbluefox3.cmake b/Findmvbluefox3.cmake index 726358c84b9845d23d0a9a4803de5bb43f880608..234178b9f22b06441ee6b71ea1540dc9c64f02cd 100644 --- a/Findmvbluefox3.cmake +++ b/Findmvbluefox3.cmake @@ -1,5 +1,5 @@ #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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4cf2f529c97621f5244e33c2b57a7e5bc954076d..1f87350828b9c1f1ae09e2bb6613030d61d50f60 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,11 +1,14 @@ # 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) diff --git a/src/examples/mvbluefox3_test.cpp b/src/examples/mvbluefox3_test.cpp index 868d1102e46ba437a248302f6030999c6336e95a..21ed8e48b186a981b85e4812b8a152323e20ec42 100644 --- a/src/examples/mvbluefox3_test.cpp +++ b/src/examples/mvbluefox3_test.cpp @@ -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; diff --git a/src/mvbluefox3.cpp b/src/mvbluefox3.cpp index 81d4707432a113ef8a177917d86e3f5c19770136..be8a3878b90ba7023158c9b5514bb2bbec9e4b05 100644 --- a/src/mvbluefox3.cpp +++ b/src/mvbluefox3.cpp @@ -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 ¶ms, bool ini) +void CMvbluefox3::SetConfig(CParams ¶ms, bool ini) { // Clear request queue this->fi_->imageRequestReset(0, 0); @@ -327,6 +340,12 @@ void CMvbluefox3::Configure(CParams ¶ms, bool ini) params_ = params; } +CParams CMvbluefox3::GetConfig(void) +{ + return this->params_; +} + + void CMvbluefox3::SetImgSize(int &width, int &height) { try{ diff --git a/src/mvbluefox3.h b/src/mvbluefox3.h index df2bb8c4bcdb740168c1bc61e0cd66c96837bf0a..9272fdbcc0586bc7db4eb41772db0aac5ba11fde 100644 --- a/src/mvbluefox3.h +++ b/src/mvbluefox3.h @@ -1,17 +1,15 @@ #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 ¶ms, bool ini = false); + void SetConfig(CParams ¶ms, bool ini = false); + + /** + * \brief Get Configuration. + * + * Get main camera parameters. + */ + CParams GetConfig(void); }; } // End of CMvbluefox3 namespace