From 2357b5afb43d314546e14e2269bf1602e94344f9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 29 Mar 2022 00:02:24 +0200 Subject: tracker/trackhat: add point filter deadzone --- tracker-trackhat/dialog.cpp | 6 +++ tracker-trackhat/dialog.ui | 102 ++++++++++++++++++++++++++++++++---------- tracker-trackhat/trackhat.hpp | 1 + 3 files changed, 85 insertions(+), 24 deletions(-) (limited to 'tracker-trackhat') diff --git a/tracker-trackhat/dialog.cpp b/tracker-trackhat/dialog.cpp index 4c0170d2..cf0f67db 100644 --- a/tracker-trackhat/dialog.cpp +++ b/tracker-trackhat/dialog.cpp @@ -79,6 +79,12 @@ trackhat_dialog::trackhat_dialog() connect(&t.point_filter_coefficient, value_::value_changed(), ui.point_filter_label, [this] { ui.point_filter_label->setValue(*t.point_filter_coefficient); }, Qt::QueuedConnection); + tie_setting(t.point_filter_deadzone, ui.point_filter_deadzone); + ui.point_filter_deadzone_label->setValue(*t.point_filter_deadzone); + + connect(&t.point_filter_deadzone, value_::value_changed(), ui.point_filter_deadzone_label, + [this] { ui.point_filter_deadzone_label->setValue(*t.point_filter_deadzone); }, Qt::QueuedConnection); + // stuff connect(&poll_timer, &QTimer::timeout, this, &trackhat_dialog::poll_tracker_info); diff --git a/tracker-trackhat/dialog.ui b/tracker-trackhat/dialog.ui index 73c67a06..d39b1778 100644 --- a/tracker-trackhat/dialog.ui +++ b/tracker-trackhat/dialog.ui @@ -7,7 +7,7 @@ 0 0 365 - 485 + 510 @@ -336,6 +336,67 @@ 0 + + + + + 0 + 0 + + + + Qt::NoFocus + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + px + + + 2 + + + 300.000000000000000 + + + + + + + + 0 + 0 + + + + 99 + + + Qt::Horizontal + + + + + + + Limit + + + + + + + Deadzone + + + @@ -343,10 +404,10 @@ - - + + - + 0 0 @@ -363,14 +424,17 @@ QAbstractSpinBox::NoButtons + + + - px + 2 - 300.000000000000000 + 1.000000000000000 @@ -390,8 +454,8 @@ - - + + 0 @@ -399,17 +463,17 @@ - 99 + 100 Qt::Horizontal - - + + - + 0 0 @@ -426,24 +490,14 @@ QAbstractSpinBox::NoButtons - - - - + px 2 - 1.000000000000000 - - - - - - - Limit + 300.000000000000000 diff --git a/tracker-trackhat/trackhat.hpp b/tracker-trackhat/trackhat.hpp index c844a520..04ccfa4c 100644 --- a/tracker-trackhat/trackhat.hpp +++ b/tracker-trackhat/trackhat.hpp @@ -41,6 +41,7 @@ struct trackhat_settings : opts value enable_point_filter{b, "enable-point-filter", true }; value point_filter_coefficient{b, "point-filter-coefficient", { 1.5, 1, 4 }}; value point_filter_limit { b, "point-filter-limit", { 0.1, 0.01, 1 }}; + value point_filter_deadzone { b, "point-filter-deadzone", {0, 0, 1}}; }; class setting_receiver : public QObject -- cgit v1.2.3