summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-20 06:33:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-03-20 06:33:41 +0100
commit7caff8660647f77deba9e2ff3eda6127996732bd (patch)
treed154e677edc07c5a037525ca0a603855d5bcd677
parent7536ac46d919ab2a85d6ea3876e3a725af971e3f (diff)
tracker/pt: rename slot
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp12
-rw-r--r--tracker-pt/ftnoir_tracker_pt.h2
2 files changed, 5 insertions, 9 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index f9a10723..e35acc0e 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -23,7 +23,7 @@ Tracker_PT::Tracker_PT() :
commands(0),
ever_success(false)
{
- connect(s.b.get(), SIGNAL(saving()), this, SLOT(apply_settings()), Qt::DirectConnection);
+ connect(s.b.get(), SIGNAL(saving()), this, SLOT(maybe_reopen_camera()), Qt::DirectConnection);
connect(&s.fov, SIGNAL(valueChanged(int)), this, SLOT(set_fov(int)), Qt::DirectConnection);
set_fov(s.fov);
}
@@ -59,7 +59,7 @@ void Tracker_PT::run()
QTextStream log_stream(&log_file);
#endif
- apply_settings();
+ maybe_reopen_camera();
while((commands & ABORT) == 0)
{
@@ -127,10 +127,8 @@ void Tracker_PT::run()
qDebug() << "pt: thread stopped";
}
-void Tracker_PT::apply_settings()
+void Tracker_PT::maybe_reopen_camera()
{
- qDebug() << "pt: applying settings";
-
QMutexLocker l(&camera_mtx);
Camera::open_status status = camera.start(camera_name_to_index(s.camera_name), s.cam_fps, s.cam_res_x, s.cam_res_y);
@@ -139,15 +137,13 @@ void Tracker_PT::apply_settings()
{
case Camera::open_error:
qDebug() << "can't start camera" << s.camera_name;
- return;
+ break;
case Camera::open_ok_change:
frame = cv::Mat();
break;
case Camera::open_ok_no_change:
break;
}
-
- qDebug() << "pt: done applying settings";
}
void Tracker_PT::set_fov(int value)
diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h
index 26d935f0..b7b0019a 100644
--- a/tracker-pt/ftnoir_tracker_pt.h
+++ b/tracker-pt/ftnoir_tracker_pt.h
@@ -51,7 +51,7 @@ public:
int get_n_points();
bool get_cam_info(CamInfo* info);
public slots:
- void apply_settings();
+ void maybe_reopen_camera();
void set_fov(int value);
protected:
void run() override;