summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt_dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-08-15 13:44:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-08-15 13:44:42 +0200
commit558491c9ee7262b4f84e192b0627194a39e884dc (patch)
tree9f4beeed8b3a7215f543b573e2f5f42f6bd90e39 /tracker-pt/ftnoir_tracker_pt_dialog.cpp
parentebcb655842a184ad7f0c3abfabbf04e349fc7a53 (diff)
tracker/pt: make calibration less confusing in dialog
- change button text to "stop calibration" and "start calibration" respectively. - gray out the values while calibration is running - run calibration at 10 Hz on a separate timer from dialog update Issue: #416
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt_dialog.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt_dialog.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
index 307be1f2..88465c42 100644
--- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp
+++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp
@@ -8,12 +8,13 @@
#include "ftnoir_tracker_pt_dialog.h"
-#include <QMessageBox>
-#include <QDebug>
+#include "compat/camera-names.hpp"
#include <opencv2/core/core.hpp>
#include <memory>
-#include "compat/camera-names.hpp"
#include <vector>
+#include <QMessageBox>
+#include <QString>
+#include <QDebug>
//-----------------------------------------------------------------------------
TrackerDialog_PT::TrackerDialog_PT()
@@ -73,6 +74,9 @@ TrackerDialog_PT::TrackerDialog_PT()
connect(&timer,SIGNAL(timeout()), this,SLOT(poll_tracker_info()));
connect(ui.camera_settings, SIGNAL(clicked()), this, SLOT(camera_settings()));
timer.start(250);
+
+ connect(&calib_timer, &QTimer::timeout, this, &TrackerDialog_PT::trans_calib_step);
+ calib_timer.setInterval(100);
}
void TrackerDialog_PT::camera_settings()
@@ -88,6 +92,7 @@ void TrackerDialog_PT::startstop_trans_calib(bool start)
if (start)
{
qDebug()<<"TrackerDialog:: Starting translation calibration";
+ calib_timer.start();
trans_calib.reset();
trans_calib_running = true;
s.t_MH_x = 0;
@@ -96,6 +101,7 @@ void TrackerDialog_PT::startstop_trans_calib(bool start)
}
else
{
+ calib_timer.stop();
qDebug()<<"TrackerDialog:: Stopping translation calibration";
trans_calib_running = false;
{
@@ -105,6 +111,15 @@ void TrackerDialog_PT::startstop_trans_calib(bool start)
s.t_MH_z = tmp[2];
}
}
+ ui.tx_spin->setEnabled(!start);
+ ui.ty_spin->setEnabled(!start);
+ ui.tz_spin->setEnabled(!start);
+ ui.tcalib_button->setText(progn(
+ if (start)
+ return QStringLiteral("Stop calibration");
+ else
+ return QStringLiteral("Start calibration");
+ ));
}
void TrackerDialog_PT::poll_tracker_info()
@@ -145,6 +160,8 @@ void TrackerDialog_PT::trans_calib_step()
Affine X_CM = tracker->pose();
trans_calib.update(X_CM.R, X_CM.t);
}
+ else
+ startstop_trans_calib(false);
}
void TrackerDialog_PT::save()