From 9a0822c445e56580fb3034224191ec825ea0274a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 13 Oct 2017 15:05:05 +0200 Subject: options/tie: change "tie" overloads Adjust usages. There are ODR issues with MSVC and it doesn't support C++17 "static inline constexpr" _variables_. Otherwise, "signal_fun" could be a variable and not a function. The usages in accela/ewma2 dialog are more verbose now but the original API was silly. --- tracker-pt/ftnoir_tracker_pt_dialog.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tracker-pt') diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp index 6b31ac8a..a4b8c668 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp +++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp @@ -93,6 +93,23 @@ TrackerDialog_PT::TrackerDialog_PT() ui.blob_color->setItemData(k, int(color_types[k])); tie_setting(s.blob_color, ui.blob_color); + + tie_setting(s.threshold, ui.threshold_value_display, [this](int x) { + if (!s.auto_threshold) + return tr("Brightness %1/255").arg(x); + else + { + CamInfo info; + int w = 640, h = 480; + + if (tracker && tracker->get_cam_info(&info) && info.res_x * info.res_y != 0) + w = info.res_x, h = info.res_y; + + double value = PointExtractor::threshold_radius_value(w, h, x); + + return tr("LED radius %1 pixels").arg(value, 0, 'f', 2); + } + }); } void TrackerDialog_PT::startstop_trans_calib(bool start) -- cgit v1.2.3