From 9f6b2d96322490f3511e9218b3c784cfec3e1956 Mon Sep 17 00:00:00 2001 From: "d.kilic" <d.kilic@fz-juelich.de> Date: Thu, 5 Nov 2020 18:08:34 +0100 Subject: [PATCH] Use a constexpr function to determine the filename from the path given by `__FILE__` for use by `debout` --- include/helper.h | 14 +++++++++++++- src/recognition.cpp | 2 -- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/helper.h b/include/helper.h index 67d3f9480..68f07c4b6 100644 --- a/include/helper.h +++ b/include/helper.h @@ -14,11 +14,23 @@ extern QString commandLineOptionsString; // stefans ansatz steht in svt_system (nicht besser); noetig: #include "imagehlp.h" // this ausserhalb von objekt nicht verfuegbar: #define debout cout << typeid(this).name() << "." << __func__ << " in " << __FILE__ << " line " << __LINE__ << ": " +constexpr const char* file_name(const char* path) { + const char* file = path; + while (*path) { + const char current = *path; + ++path; + if (current == '/' || current == '\\') { + file = path; + } + } + return file; +} + // gleiche Variable wie QT benutzt, es gibt auch noch QT_NO_DEBUG and QT_NO_WARNING_OUTPUT #ifdef QT_NO_DEBUG_OUTPUT #define debout // #else - #define debout std::cout << __func__ << " in " << __FILE__ << " line " << __LINE__ << ": " +#define debout std::cout << __func__ << " in " << file_name(__FILE__) << " line " << __LINE__ << ": " #endif #include <iostream> diff --git a/src/recognition.cpp b/src/recognition.cpp index fbf74dcea..c9834fe5b 100644 --- a/src/recognition.cpp +++ b/src/recognition.cpp @@ -1181,9 +1181,7 @@ void findCodeMarker(Mat &img, QList<TrackPoint> *crossList, Control *controlWidg debout << "start detectCodeMarkers : " << getElapsedTime() <<endl; #endif - //debout << "XXX: " << img.locateROI(); aruco::detectMarkers(img/*copy.clone()*/, dictionary, corners, ids, detectorParams, rejected); - debout << "findCodeMarker: dictID: " << codeMarkerWidget->dictList->currentIndex() << endl; // used dictionary #ifdef TIME_MEASUREMENT // "==========: " -- GitLab