diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-18 17:59:57 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-19 14:46:28 +0200 |
commit | bfc13c7fcb444d97796589249e2664b37e20f471 (patch) | |
tree | 4a8f8805d1fecae7e5be015419f77cb2d1a4a325 | |
parent | 562785b09f4641dd71eb36d36bd92c945e0bd7cf (diff) |
tracker/pt: don't call calibration twice
Also simplify timer logic.
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt_dialog.cpp | 15 | ||||
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt_dialog.h | 1 |
2 files changed, 4 insertions, 12 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp index a5108ec1..68740801 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp +++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp @@ -14,11 +14,9 @@ #include <QString> #include <QDebug> -//----------------------------------------------------------------------------- TrackerDialog_PT::TrackerDialog_PT() - : tracker(NULL), - timer(this), - trans_calib_running(false) + : tracker(nullptr), + timer(this) { ui.setupUi( this ); @@ -87,7 +85,6 @@ void TrackerDialog_PT::startstop_trans_calib(bool start) qDebug()<<"TrackerDialog:: Starting translation calibration"; calib_timer.start(); trans_calib.reset(); - trans_calib_running = true; s.t_MH_x = 0; s.t_MH_y = 0; s.t_MH_z = 0; @@ -96,7 +93,6 @@ void TrackerDialog_PT::startstop_trans_calib(bool start) { calib_timer.stop(); qDebug()<<"TrackerDialog:: Stopping translation calibration"; - trans_calib_running = false; { auto tmp = trans_calib.get_estimate(); s.t_MH_x = int(tmp[0]); @@ -135,14 +131,11 @@ void TrackerDialog_PT::poll_tracker_info() else to_print += " BAD!"; ui.pointinfo_label->setText(to_print); - - // update calibration - if (trans_calib_running) trans_calib_step(); } else { - ui.caminfo_label->setText("Tracker offline"); - ui.pointinfo_label->setText(""); + ui.caminfo_label->setText(QStringLiteral("Tracker offline")); + ui.pointinfo_label->setText(QStringLiteral("")); } } diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.h b/tracker-pt/ftnoir_tracker_pt_dialog.h index b5adea51..e6b1cf30 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.h +++ b/tracker-pt/ftnoir_tracker_pt_dialog.h @@ -41,7 +41,6 @@ private: QTimer timer, calib_timer; TranslationCalibrator trans_calib; - bool trans_calib_running; Ui::UICPTClientControls ui; }; |