diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-16 17:24:31 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-03-29 00:04:47 +0200 |
commit | 1ebb642f192f93144b4383f3e756da4675114cb0 (patch) | |
tree | a3a6b4c0525c2f0f1ca80aece592113a98de3bcc /tracker-trackhat/dialog.cpp | |
parent | 4f8ec1a2ab434c3896763685fb5dfba7194be143 (diff) |
tracker/trackhat: buffer flush
Diffstat (limited to 'tracker-trackhat/dialog.cpp')
-rw-r--r-- | tracker-trackhat/dialog.cpp | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/tracker-trackhat/dialog.cpp b/tracker-trackhat/dialog.cpp index b51fbc3b..7e38bf52 100644 --- a/tracker-trackhat/dialog.cpp +++ b/tracker-trackhat/dialog.cpp @@ -24,30 +24,41 @@ trackhat_dialog::trackhat_dialog() for (auto x : model_types) ui.model_type->addItem(QIcon{}, tr(x.name), (QVariant)(int)x.t); + // model + tie_setting(t.model, ui.model_type); tie_setting(t.min_pt_size, ui.min_point_size); tie_setting(t.max_pt_size, ui.max_point_size); - ui.exposure_label->setValue((int)*t.exposure); - ui.gain_label->setValue((int)*t.gain); + // exposure + tie_setting(t.exposure, ui.exposure_slider); tie_setting(t.gain, ui.gain_slider); - - ui.point_filter_label->setValue((int)*t.point_filter_coefficient); - tie_setting(t.enable_point_filter, ui.enable_point_filter); - tie_setting(t.point_filter_coefficient, ui.point_filter_slider); + ui.exposure_label->setValue((int)*t.exposure); + ui.gain_label->setValue((int)*t.gain); connect(&t.exposure, value_::value_changed<slider_value>(), ui.exposure_label, - [this] { ui.exposure_label->setValue((int)*t.exposure); }, Qt::QueuedConnection); + [this] { ui.exposure_label->setValue((int)*t.exposure); }, Qt::QueuedConnection); connect(&t.gain, value_::value_changed<slider_value>(), ui.gain_label, [this] { ui.gain_label->setValue((int)*t.gain); }, Qt::QueuedConnection); - connect(&t.point_filter_coefficient, value_::value_changed<slider_value>(), ui.point_filter_label, - [this] { ui.point_filter_label->setValue((int)*t.point_filter_coefficient); }, Qt::QueuedConnection); + // threshold - connect(&poll_timer, &QTimer::timeout, this, &trackhat_dialog::poll_tracker_info); - connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &trackhat_dialog::doOK); - connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &trackhat_dialog::doCancel); + 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); @@ -57,22 +68,20 @@ trackhat_dialog::trackhat_dialog() ui.threshold_2_label->setValue((int)*t.threshold_2); }, Qt::QueuedConnection); - ui.threshold_2_slider->setValue(std::min(ui.threshold_2_slider->value(), ui.threshold_slider->value()-1)); + // point filter - 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); + tie_setting(t.enable_point_filter, ui.enable_point_filter); + tie_setting(t.point_filter_coefficient, ui.point_filter_slider); + ui.point_filter_label->setValue((int)*t.point_filter_coefficient); - 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); + 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); - ui.threshold_label->setValue((int)*t.threshold); - ui.threshold_2_label->setValue((int)*t.threshold_2); - tie_setting(t.threshold, ui.threshold_slider); - tie_setting(t.threshold_2, ui.threshold_2_slider); + // stuff + + connect(&poll_timer, &QTimer::timeout, this, &trackhat_dialog::poll_tracker_info); + connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &trackhat_dialog::doOK); + connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &trackhat_dialog::doCancel); } void trackhat_dialog::register_tracker(ITracker* tracker) |