Skip to content
Snippets Groups Projects
Commit 8711187a authored by roangel's avatar roangel
Browse files

trying to solve problem with saving in DB. crashes

parent e8736ca1
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@
#ifdef CATKIN_MAKE
#include "d_fall_pps/UnlabeledMarker.h"
#include "d_fall_pps/CMRead.h"
#include "d_fall_pps/CrazyflieEntry.h"
#endif
#include <string>
......@@ -697,23 +698,26 @@ void MainGUIWindow::on_save_in_DB_button_clicked()
CrazyflieDB tmp_db;
for(int i = 0; cf_linker->links.size(); i++)
{
tmp_db.crazyflieEntries[i].crazyflieContext.crazyflieName = cf_linker->links[i].cf_name;
tmp_db.crazyflieEntries[i].crazyflieContext.localArea.crazyfly_zone_index = cf_linker->links[i].cf_zone_index;
for(int j = 0; j < scene->crazyfly_zones.size(); j++)
{
if(cf_linker->links[i].cf_zone_index == scene->crazyfly_zones[j]->getIndex())
{
QRectF rect = scene->crazyfly_zones[j]->rect();
tmp_db.crazyflieEntries[i].crazyflieContext.localArea.xmin = rect.x() * FROM_UNITS_TO_METERS;
tmp_db.crazyflieEntries[i].crazyflieContext.localArea.xmax = (rect.x() + rect.width()) * FROM_UNITS_TO_METERS;
tmp_db.crazyflieEntries[i].crazyflieContext.localArea.ymin = (rect.y() - rect.height()) * FROM_UNITS_TO_METERS;
tmp_db.crazyflieEntries[i].crazyflieContext.localArea.ymax = rect.y() * FROM_UNITS_TO_METERS;
break;
}
}
tmp_db.crazyflieEntries[i].studentID = cf_linker->links[i].student_id;
CrazyflieEntry tmp_entry;
ROS_INFO("for loop iteration");
tmp_entry.crazyflieContext.crazyflieName = cf_linker->links[i].cf_name;
// tmp_entry.crazyflieContext.localArea.crazyfly_zone_index = cf_linker->links[i].cf_zone_index;
// tmp_entry.studentID = cf_linker->links[i].student_id;
// for(int j = 0; j < scene->crazyfly_zones.size(); j++)
// {
// if(cf_linker->links[i].cf_zone_index == scene->crazyfly_zones[j]->getIndex())
// {
// QRectF rect = scene->crazyfly_zones[j]->rect();
// tmp_entry.crazyflieContext.localArea.xmin = rect.x() * FROM_UNITS_TO_METERS;
// tmp_entry.crazyflieContext.localArea.xmax = (rect.x() + rect.width()) * FROM_UNITS_TO_METERS;
// tmp_entry.crazyflieContext.localArea.ymin = (rect.y() - rect.height()) * FROM_UNITS_TO_METERS;
// tmp_entry.crazyflieContext.localArea.ymax = rect.y() * FROM_UNITS_TO_METERS;
// }
// }
// tmp_db.crazyflieEntries.push_back(tmp_entry);
}
m_data_base = tmp_db;
// m_data_base = tmp_db;
}
void MainGUIWindow::on_load_from_DB_button_clicked()
......
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