diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-04 11:25:54 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-04-04 11:25:54 +0200 |
commit | 3311da2af8cfc8ac6d83edc6a4aab6ef8a99c31b (patch) | |
tree | 419cd706bca624effac2d4ab3bdff182dad4e62f | |
parent | 30642f0760d09478ec8778e76dc9a92261f73693 (diff) |
tracker/trackhat: remove fuzz slider
-rw-r--r-- | tracker-trackhat/camera.cpp | 2 | ||||
-rw-r--r-- | tracker-trackhat/dialog.cpp | 16 | ||||
-rw-r--r-- | tracker-trackhat/dialog.ui | 122 | ||||
-rw-r--r-- | tracker-trackhat/lang/nl_NL.ts | 4 | ||||
-rw-r--r-- | tracker-trackhat/lang/ru_RU.ts | 4 | ||||
-rw-r--r-- | tracker-trackhat/lang/stub.ts | 4 | ||||
-rw-r--r-- | tracker-trackhat/lang/zh_CN.ts | 4 | ||||
-rw-r--r-- | tracker-trackhat/settings.cpp | 2 | ||||
-rw-r--r-- | tracker-trackhat/trackhat.hpp | 1 |
9 files changed, 40 insertions, 119 deletions
diff --git a/tracker-trackhat/camera.cpp b/tracker-trackhat/camera.cpp index 49e20e41..033fd532 100644 --- a/tracker-trackhat/camera.cpp +++ b/tracker-trackhat/camera.cpp @@ -54,7 +54,7 @@ trackhat_camera::trackhat_camera() s.set_raii_dtor_state(false); t.set_raii_dtor_state(false); - for (auto* slider : { &t.exposure, &t.gain, &t.threshold, &t.threshold_2 }) + for (auto* slider : { &t.exposure, &t.gain, &t.threshold, }) { QObject::connect(slider, options::value_::value_changed<options::slider_value>(), &sig, &trackhat_impl::setting_receiver::settings_changed, diff --git a/tracker-trackhat/dialog.cpp b/tracker-trackhat/dialog.cpp index cf0f67db..2a7bf119 100644 --- a/tracker-trackhat/dialog.cpp +++ b/tracker-trackhat/dialog.cpp @@ -46,30 +46,14 @@ trackhat_dialog::trackhat_dialog() // threshold - connect(ui.threshold_slider, &QSlider::valueChanged, this, [this] (int value) { - if (value <= ui.threshold_2_slider->value()) - ui.threshold_2_slider->setValue(value-1); - }, Qt::DirectConnection); - - connect(ui.threshold_2_slider, &QSlider::valueChanged, this, [this] (int value) { - if (value >= ui.threshold_slider->value()) - ui.threshold_slider->setValue(value+1); - }, Qt::DirectConnection); - tie_setting(t.threshold, ui.threshold_slider); - tie_setting(t.threshold_2, ui.threshold_2_slider); ui.threshold_label->setValue((int)*t.threshold); - ui.threshold_2_label->setValue((int)*t.threshold_2); connect(&t.threshold, value_::value_changed<slider_value>(), ui.threshold_label, [=] { ui.threshold_label->setValue((int)*t.threshold); }, Qt::QueuedConnection); - connect(&t.threshold_2, value_::value_changed<slider_value>(), ui.threshold_2_label, [=] { - ui.threshold_2_label->setValue((int)*t.threshold_2); - }, Qt::QueuedConnection); - // point filter tie_setting(t.enable_point_filter, ui.enable_point_filter); diff --git a/tracker-trackhat/dialog.ui b/tracker-trackhat/dialog.ui index d39b1778..6bb7f515 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>510</height> + <height>485</height> </rect> </property> <property name="minimumSize"> @@ -65,27 +65,41 @@ </property> </widget> </item> - <item row="2" column="2"> - <widget class="QSpinBox" name="threshold_label"> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + <item row="2" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Threshold</string> </property> - <property name="readOnly"> - <bool>true</bool> + </widget> + </item> + <item row="2" column="1"> + <widget class="QSlider" name="threshold_slider"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="buttonSymbols"> - <enum>QAbstractSpinBox::NoButtons</enum> + <property name="minimum"> + <number>64</number> </property> <property name="maximum"> - <number>999</number> + <number>254</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="0" column="2"> - <widget class="QSpinBox" name="exposure_label"> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Gain</string> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QSpinBox" name="threshold_label"> <property name="focusPolicy"> <enum>Qt::NoFocus</enum> </property> @@ -103,13 +117,6 @@ </property> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Threshold</string> - </property> - </widget> - </item> <item row="1" column="2"> <widget class="QSpinBox" name="gain_label"> <property name="focusPolicy"> @@ -129,67 +136,8 @@ </property> </widget> </item> - <item row="2" column="1"> - <widget class="QSlider" name="threshold_slider"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>64</number> - </property> - <property name="maximum"> - <number>254</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Exposure</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Gain</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_7"> - <property name="text"> - <string>Fuzz</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QSlider" name="threshold_2_slider"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>254</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QSpinBox" name="threshold_2_label"> + <item row="0" column="2"> + <widget class="QSpinBox" name="exposure_label"> <property name="focusPolicy"> <enum>Qt::NoFocus</enum> </property> @@ -207,6 +155,13 @@ </property> </widget> </item> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Exposure</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -642,7 +597,6 @@ <tabstop>exposure_slider</tabstop> <tabstop>gain_slider</tabstop> <tabstop>threshold_slider</tabstop> - <tabstop>threshold_2_slider</tabstop> <tabstop>model_type</tabstop> <tabstop>min_point_size</tabstop> <tabstop>max_point_size</tabstop> diff --git a/tracker-trackhat/lang/nl_NL.ts b/tracker-trackhat/lang/nl_NL.ts index 34639a9d..50fdef30 100644 --- a/tracker-trackhat/lang/nl_NL.ts +++ b/tracker-trackhat/lang/nl_NL.ts @@ -60,10 +60,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Fuzz</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Model</source> <translation type="unfinished"></translation> </message> diff --git a/tracker-trackhat/lang/ru_RU.ts b/tracker-trackhat/lang/ru_RU.ts index 939cb91e..23c14ed4 100644 --- a/tracker-trackhat/lang/ru_RU.ts +++ b/tracker-trackhat/lang/ru_RU.ts @@ -60,10 +60,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Fuzz</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Model</source> <translation type="unfinished"></translation> </message> diff --git a/tracker-trackhat/lang/stub.ts b/tracker-trackhat/lang/stub.ts index d4c0e011..17ca6da6 100644 --- a/tracker-trackhat/lang/stub.ts +++ b/tracker-trackhat/lang/stub.ts @@ -24,10 +24,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Fuzz</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Model</source> <translation type="unfinished"></translation> </message> diff --git a/tracker-trackhat/lang/zh_CN.ts b/tracker-trackhat/lang/zh_CN.ts index 566a298a..1c7f83ae 100644 --- a/tracker-trackhat/lang/zh_CN.ts +++ b/tracker-trackhat/lang/zh_CN.ts @@ -60,10 +60,6 @@ <translation type="unfinished"></translation> </message> <message> - <source>Fuzz</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Model</source> <translation type="unfinished"></translation> </message> diff --git a/tracker-trackhat/settings.cpp b/tracker-trackhat/settings.cpp index 55ba5928..f9a866bf 100644 --- a/tracker-trackhat/settings.cpp +++ b/tracker-trackhat/settings.cpp @@ -83,7 +83,7 @@ bool trackhat_camera::init_regs() auto exp = (uint8_t)t.exposure; auto exp2 = (uint8_t)(exp == 0xff ? 0xf0 : 0xff); auto thres = (uint8_t)t.threshold; - auto thres2 = (uint8_t)std::clamp((int)*t.threshold_2, 0, std::max(64, thres-1)); + auto thres2 = (uint8_t)3; auto gain = (uint8_t)((int)*t.gain); auto gain_c = (uint8_t)(gain/0x10); diff --git a/tracker-trackhat/trackhat.hpp b/tracker-trackhat/trackhat.hpp index ff6f2eec..1e1857f5 100644 --- a/tracker-trackhat/trackhat.hpp +++ b/tracker-trackhat/trackhat.hpp @@ -34,7 +34,6 @@ struct trackhat_settings : opts value<slider_value> exposure{b, "exposure", {0x80, 0x10, 0xff}}; value<slider_value> gain{b, "gain", {16, 0, 47}}; value<slider_value> threshold{b, "threshold", {0x97, 64, 0xfe}}; - value<slider_value> threshold_2{b, "threshold-2", {0x03, 1, 0xfe}}; value<model_type> model{b, "model", model_mini_clip_left}; value<double> min_pt_size{b, "min-point-size", 10}; value<double> max_pt_size{b, "max-point-size", 50}; |