loading settings from bluefox xml. something is not correct for ROS format., needs to be fixed

parent b501e5f4
......@@ -17,7 +17,7 @@
namespace CMvbluefox3 {
CMvbluefox3::CMvbluefox3(const mvIMPACT::acquire::Device *device)
CMvbluefox3::CMvbluefox3(const mvIMPACT::acquire::Device *device, const std::string &sett_path)
{
// Initialize vars
this->device_ = new mvIMPACT::acquire::Device(*device);
......@@ -26,7 +26,7 @@ CMvbluefox3::CMvbluefox3(const mvIMPACT::acquire::Device *device)
this->depth_ = 8;
this->bytes_per_pixel_ = 1;
OpenDevice();
OpenDevice(sett_path);
}
CMvbluefox3::~CMvbluefox3()
......@@ -47,7 +47,7 @@ CMvbluefox3::~CMvbluefox3()
DelPtr(this->stats_);
}
void CMvbluefox3::OpenDevice(void)
void CMvbluefox3::OpenDevice(const std::string &sett_path)
{
// Open the device
try { this->device_->open(); }
......@@ -70,7 +70,11 @@ void CMvbluefox3::OpenDevice(void)
this->bf_sets_->imageDestination.restoreDefault();
this->bf_sets_->imageProcessing.restoreDefault();
SetConfig(this->params_,true);
if (!sett_path.empty())
LoadSettings(sett_path);
// Uncomment this function in case of filling manually the parameters before creating the CMvbluefox3 object externally, otherwise LoadSettings function will be used.
// SetConfig(this->params_,true);
}
void CMvbluefox3::CloseDevice(void)
......@@ -87,6 +91,13 @@ void CMvbluefox3::CloseDevice(void)
}
}
void CMvbluefox3::LoadSettings(const std::string &path)
{
std::cout << "[mvBlueFOX3]: Loading stored settings for " << this->device_->product.readS() << " " << this->device_->serial.readS() << " from path: " << path << "." << std::endl;
this->fi_->loadSetting(path,TStorageFlag(sfFile));
// this->fi_->loadSetting(path,TStorageFlag(sfFile|sfIgnoreBasicData));
}
std::string CMvbluefox3::GetProduct(void)
{
if (this->device_==NULL)
......
......@@ -176,7 +176,7 @@ class CMvbluefox3
*
* Open device.
*/
void OpenDevice(void);
void OpenDevice(const std::string &sett_path = std::string());
/**
* \brief Get image request format
......@@ -357,7 +357,7 @@ class CMvbluefox3
*
* Class constructor.
*/
CMvbluefox3(const mvIMPACT::acquire::Device *device);
CMvbluefox3(const mvIMPACT::acquire::Device *device, const std::string &sett_path = std::string());
/**
* \brief Class destructor
......@@ -372,6 +372,13 @@ class CMvbluefox3
* Close device.
*/
void CloseDevice(void);
/**
* \brief Load camera settings (previously stored with wxPropView
*
* Load camera settings (previously stored with wxPropView.
*/
void LoadSettings(const std::string &path);
/**
* \brief Get device product name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment