diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-03-29 00:02:24 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-03-29 00:04:50 +0200 |
commit | 2357b5afb43d314546e14e2269bf1602e94344f9 (patch) | |
tree | 7bb154380841373d43a68591d662e1ab8d0c1675 | |
parent | 6173590161f8ca4d84c030820c9f47e1f6a52561 (diff) |
tracker/trackhat: add point filter deadzone
-rw-r--r-- | tracker-trackhat/dialog.cpp | 6 | ||||
-rw-r--r-- | tracker-trackhat/dialog.ui | 102 | ||||
-rw-r--r-- | tracker-trackhat/trackhat.hpp | 1 |
3 files changed, 85 insertions, 24 deletions
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<slider_value>(), 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<slider_value>(), 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 @@ <x>0</x> <y>0</y> <width>365</width> - <height>485</height> + <height>510</height> </rect> </property> <property name="minimumSize"> @@ -336,6 +336,67 @@ <property name="bottomMargin"> <number>0</number> </property> + <item row="0" column="2"> + <widget class="QDoubleSpinBox" name="point_filter_label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="buttonSymbols"> + <enum>QAbstractSpinBox::NoButtons</enum> + </property> + <property name="suffix"> + <string> px</string> + </property> + <property name="decimals"> + <number>2</number> + </property> + <property name="maximum"> + <double>300.000000000000000</double> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSlider" name="point_filter_limit"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximum"> + <number>99</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_8"> + <property name="text"> + <string>Limit</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_10"> + <property name="text"> + <string>Deadzone</string> + </property> + </widget> + </item> <item row="0" column="0"> <widget class="QCheckBox" name="enable_point_filter"> <property name="text"> @@ -343,10 +404,10 @@ </property> </widget> </item> - <item row="0" column="2"> - <widget class="QDoubleSpinBox" name="point_filter_label"> + <item row="1" column="2"> + <widget class="QDoubleSpinBox" name="point_filter_limit_label"> <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -363,14 +424,17 @@ <property name="buttonSymbols"> <enum>QAbstractSpinBox::NoButtons</enum> </property> + <property name="prefix"> + <string/> + </property> <property name="suffix"> - <string> px</string> + <string/> </property> <property name="decimals"> <number>2</number> </property> <property name="maximum"> - <double>300.000000000000000</double> + <double>1.000000000000000</double> </property> </widget> </item> @@ -390,8 +454,8 @@ </property> </widget> </item> - <item row="1" column="1"> - <widget class="QSlider" name="point_filter_limit"> + <item row="2" column="1"> + <widget class="QSlider" name="point_filter_deadzone"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> <horstretch>0</horstretch> @@ -399,17 +463,17 @@ </sizepolicy> </property> <property name="maximum"> - <number>99</number> + <number>100</number> </property> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QDoubleSpinBox" name="point_filter_limit_label"> + <item row="2" column="2"> + <widget class="QDoubleSpinBox" name="point_filter_deadzone_label"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -426,24 +490,14 @@ <property name="buttonSymbols"> <enum>QAbstractSpinBox::NoButtons</enum> </property> - <property name="prefix"> - <string/> - </property> <property name="suffix"> - <string/> + <string> px</string> </property> <property name="decimals"> <number>2</number> </property> <property name="maximum"> - <double>1.000000000000000</double> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_8"> - <property name="text"> - <string>Limit</string> + <double>300.000000000000000</double> </property> </widget> </item> 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<bool> enable_point_filter{b, "enable-point-filter", true }; value<slider_value> point_filter_coefficient{b, "point-filter-coefficient", { 1.5, 1, 4 }}; value<slider_value> point_filter_limit { b, "point-filter-limit", { 0.1, 0.01, 1 }}; + value<slider_value> point_filter_deadzone { b, "point-filter-deadzone", {0, 0, 1}}; }; class setting_receiver : public QObject |