diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 07:49:44 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-10 07:49:44 +0100 |
commit | a9ca349966dde20a8e9030c35c4a79f42c6e642b (patch) | |
tree | 2e75f801a7ede208a839069b45121280f41e8e8a /tracker-pt/ftnoir_tracker_pt.cpp | |
parent | 9560aa09d5a8adcf2f72d5056821b5a75c0bfc6a (diff) |
tracker/pt: cleanup
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.cpp')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index 1fbd4373..ca81ff40 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -9,17 +9,16 @@ #include "ftnoir_tracker_pt.h" #include "compat/camera-names.hpp" #include "compat/math-imports.hpp" -#include <QHBoxLayout> + #include <cmath> +#include <functional> + +#include <QHBoxLayout> #include <QDebug> #include <QFile> #include <QCoreApplication> -#include <functional> -Tracker_PT::Tracker_PT() : - point_count(0), - commands(0), - ever_success(false) +Tracker_PT::Tracker_PT() { cv::setBreakOnError(true); @@ -30,25 +29,13 @@ Tracker_PT::Tracker_PT() : Tracker_PT::~Tracker_PT() { - set_command(ABORT); + requestInterruption(); wait(); QMutexLocker l(&camera_mtx); camera.stop(); } -void Tracker_PT::set_command(Command command) -{ - //QMutexLocker lock(&mutex); - commands |= command; -} - -void Tracker_PT::reset_command(Command command) -{ - //QMutexLocker lock(&mutex); - commands &= ~command; -} - void Tracker_PT::run() { cv::setNumThreads(1); @@ -59,7 +46,7 @@ void Tracker_PT::run() QTextStream log_stream(&log_file); #endif - while((commands & ABORT) == 0) + while(!isInterruptionRequested()) { CamInfo cam_info; bool new_frame = false; |