From bfc13c7fcb444d97796589249e2664b37e20f471 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 18 Oct 2016 17:59:57 +0200 Subject: tracker/pt: don't call calibration twice Also simplify timer logic. --- tracker-pt/ftnoir_tracker_pt_dialog.cpp | 15 ++++----------- tracker-pt/ftnoir_tracker_pt_dialog.h | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'tracker-pt') 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 #include -//----------------------------------------------------------------------------- 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; }; -- cgit v1.2.3