Updated version to 0.3. Now when deleting the memory, RTAB-Map reset the log files at the same time.

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@209 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2011-06-21 17:19:45 +00:00
parent 6a84c99abc
commit fb48cce623
5 changed files with 28 additions and 19 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
####################### #######################
# VERSION # VERSION
####################### #######################
SET(PROJECT_VERSION "0.2.7") SET(PROJECT_VERSION "0.3.0")
STRING(REGEX MATCHALL "[0-9]" PROJECT_VERSION_PARTS "${PROJECT_VERSION}") STRING(REGEX MATCHALL "[0-9]" PROJECT_VERSION_PARTS "${PROJECT_VERSION}")
@@ -211,7 +211,7 @@ IF(WIN32)
SET(CPACK_GENERATOR "NSIS") SET(CPACK_GENERATOR "NSIS")
SET(CPACK_SOURCE_GENERATOR "ZIP") SET(CPACK_SOURCE_GENERATOR "ZIP")
SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(ICON_PATH "${PROJECT_SOURCE_DIR}/${PROJECT_PREFIX}/src/${PROJECT_NAME}.ico") SET(ICON_PATH "${PROJECT_SOURCE_DIR}/app/src/${PROJECT_NAME}.ico")
SET(CPACK_NSIS_MUI_ICON ${ICON_PATH}) SET(CPACK_NSIS_MUI_ICON ${ICON_PATH})
SET(CPACK_NSIS_MUI_UNIICON ${ICON_PATH}) SET(CPACK_NSIS_MUI_UNIICON ${ICON_PATH})
#SET(CPACK_PACKAGE_ICON ${ICON_PATH}) #SET(CPACK_PACKAGE_ICON ${ICON_PATH})
@@ -228,7 +228,7 @@ IF(WIN32)
SET(CPACK_NSIS_MODIFY_PATH ON) SET(CPACK_NSIS_MODIFY_PATH ON)
ELSEIF(APPLE) ELSEIF(APPLE)
# The project is created as a bundle over the main app (see ./${PROJECT_PREFIX}/src). # The project is created as a bundle over the main app (see ./app/src).
# Here we package only this bundle. Note that we set # Here we package only this bundle. Note that we set
# CMAKE_INSTALL_PREFIX to "/" when packaging... # CMAKE_INSTALL_PREFIX to "/" when packaging...
IF(BUILD_AS_BUNDLE) IF(BUILD_AS_BUNDLE)
@@ -239,7 +239,7 @@ ELSEIF(APPLE)
SET(CPACK_SOURCE_GENERATOR "TBZ2") SET(CPACK_SOURCE_GENERATOR "TBZ2")
SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/${PROJECT_PREFIX}/src/${PROJECT_NAME}.icns") SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/app/src/${PROJECT_NAME}.icns")
ELSE() ELSE()
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
+1 -1
View File
@@ -115,7 +115,7 @@ private:
void deleteMemory(); void deleteMemory();
void addSMState(SMState * data); // ownership is transferred void addSMState(SMState * data); // ownership is transferred
SMState * getSMState(); SMState * getSMState();
void setupLogFiles(); void setupLogFiles(bool overwrite = false);
void releaseAllStrategies(); void releaseAllStrategies();
void pushNewState(State newState, const ParametersMap & parameters = ParametersMap()); void pushNewState(State newState, const ParametersMap & parameters = ParametersMap());
void dumpPrediction() const; void dumpPrediction() const;
+15 -6
View File
@@ -110,7 +110,7 @@ std::string Rtabmap::getVersion()
return RTABMAP_VERSION; return RTABMAP_VERSION;
} }
void Rtabmap::setupLogFiles() void Rtabmap::setupLogFiles(bool overwrite)
{ {
// Log files // Log files
if(_foutFloat) if(_foutFloat)
@@ -124,12 +124,21 @@ void Rtabmap::setupLogFiles()
_foutInt = 0; _foutInt = 0;
} }
std::string attributes = "a+"; // append to log files
if(overwrite)
{
// If a file with the same name already exists
// its content is erased and the file is treated
// as a new empty file.
attributes = "w";
}
#ifdef _MSC_VER #ifdef _MSC_VER
fopen_s(&_foutFloat, (_wDir+LOG_F).toStdString().c_str(), "a+"); fopen_s(&_foutFloat, (_wDir+LOG_F).toStdString().c_str(), attributes.c_str());
fopen_s(&_foutInt, (_wDir+LOG_I).toStdString().c_str(), "a+"); fopen_s(&_foutInt, (_wDir+LOG_I).toStdString().c_str(), attributes.c_str());
#else #else
_foutFloat = fopen((_wDir+LOG_F).c_str(), "a+"); _foutFloat = fopen((_wDir+LOG_F).c_str(), attributes.c_str());
_foutInt = fopen((_wDir+LOG_I).c_str(), "a+"); _foutInt = fopen((_wDir+LOG_I).c_str(), attributes.c_str());
#endif #endif
ULOGGER_DEBUG("Log file (int)=%s", (_wDir+LOG_I).c_str()); ULOGGER_DEBUG("Log file (int)=%s", (_wDir+LOG_I).c_str());
@@ -522,7 +531,7 @@ void Rtabmap::deleteMemory()
_reactivateId = 0; _reactivateId = 0;
_highestHypothesisValue = 0; _highestHypothesisValue = 0;
_spreadMargin = 0; _spreadMargin = 0;
this->setupLogFiles(); this->setupLogFiles(true);
} }
void Rtabmap::handleEvent(UEvent* event) void Rtabmap::handleEvent(UEvent* event)
+2 -2
View File
@@ -1061,7 +1061,7 @@ void MainWindow::deleteMemory()
{ {
button = QMessageBox::question(this, button = QMessageBox::question(this,
tr("Deleting memory..."), tr("Deleting memory..."),
tr("The remote database file \"%1\" will be deleted. Are you sure you want to continue? (This cannot be reverted)").arg(dbPath), tr("The remote database file \"%1\" and log files will be deleted. Are you sure you want to continue? (This cannot be reverted)").arg(dbPath),
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes|QMessageBox::No,
QMessageBox::No); QMessageBox::No);
} }
@@ -1069,7 +1069,7 @@ void MainWindow::deleteMemory()
{ {
button = QMessageBox::question(this, button = QMessageBox::question(this,
tr("Deleting memory..."), tr("Deleting memory..."),
tr("The database file \"%1\" (%2 MB) will be deleted. Are you sure you want to continue? (This cannot be reverted)").arg(dbPath).arg(UFile::length(dbPath.toStdString())/1000000), tr("The database file \"%1\" (%2 MB) and log files will be deleted. Are you sure you want to continue? (This cannot be reverted)").arg(dbPath).arg(UFile::length(dbPath.toStdString())/1000000),
QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes|QMessageBox::No,
QMessageBox::No); QMessageBox::No);
} }
+6 -6
View File
@@ -266,7 +266,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>839</width> <width>839</width>
<height>23</height> <height>22</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
@@ -279,17 +279,17 @@
<property name="title"> <property name="title">
<string>Edit</string> <string>Edit</string>
</property> </property>
<addaction name="actionReset_the_memory"/> <addaction name="actionApply_settings_to_the_detector"/>
<addaction name="actionDelete_memory"/> <addaction name="actionClear_cache"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionOpen_working_directory"/> <addaction name="actionOpen_working_directory"/>
<addaction name="actionDelete_memory"/>
<addaction name="separator"/>
<addaction name="actionDump_the_memory"/> <addaction name="actionDump_the_memory"/>
<addaction name="actionDump_the_prediction_matrix"/> <addaction name="actionDump_the_prediction_matrix"/>
<addaction name="actionGenerate_map"/> <addaction name="actionGenerate_map"/>
<addaction name="actionReset_the_memory"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionApply_settings_to_the_detector"/>
<addaction name="separator"/>
<addaction name="actionClear_cache"/>
<addaction name="actionAuto_screen_capture"/> <addaction name="actionAuto_screen_capture"/>
</widget> </widget>
<widget class="QMenu" name="menu6"> <widget class="QMenu" name="menu6">