summaryrefslogtreecommitdiffhomepage
path: root/filter-accela
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-04-29 16:08:05 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-04-29 16:08:10 +0200
commit9f7031d39055eec241870cbc315bc543fb578c51 (patch)
tree2008dae8d0d73e020bf83ef8bac40c0aef5c0e9a /filter-accela
parent2afbfb1e417914565edb1c7ed14cc1ebf278672d (diff)
filter/accela: format label text
Diffstat (limited to 'filter-accela')
-rw-r--r--filter-accela/ftnoir_filter_accela.h6
-rw-r--r--filter-accela/ftnoir_filter_accela_dialog.cpp63
2 files changed, 12 insertions, 57 deletions
diff --git a/filter-accela/ftnoir_filter_accela.h b/filter-accela/ftnoir_filter_accela.h
index 34e12d26..1c27cf40 100644
--- a/filter-accela/ftnoir_filter_accela.h
+++ b/filter-accela/ftnoir_filter_accela.h
@@ -45,12 +45,6 @@ private:
private slots:
void doOK();
void doCancel();
- void update_ewma_display(const slider_value& value);
- void update_rot_display(const slider_value& value);
- void update_pos_display(const slider_value& value);
- void update_rot_dz_display(const slider_value& value);
- void update_pos_dz_display(const slider_value&);
- void update_rot_nl_slider(const slider_value& sl);
};
class accelaDll : public Metadata
diff --git a/filter-accela/ftnoir_filter_accela_dialog.cpp b/filter-accela/ftnoir_filter_accela_dialog.cpp
index 637bee86..cd836aca 100644
--- a/filter-accela/ftnoir_filter_accela_dialog.cpp
+++ b/filter-accela/ftnoir_filter_accela_dialog.cpp
@@ -20,13 +20,6 @@ dialog_accela::dialog_accela()
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
- connect(&s.rot_sensitivity, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_rot_display(const slider_value&)));
- connect(&s.pos_sensitivity, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_pos_display(const slider_value&)));
- connect(&s.ewma, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_ewma_display(const slider_value&)));
- connect(&s.rot_deadzone, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_rot_dz_display(const slider_value&)));
- connect(&s.pos_deadzone, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_pos_dz_display(const slider_value&)));
- connect(&s.rot_nonlinearity, SIGNAL(valueChanged(const slider_value&)), this, SLOT(update_rot_nl_slider(const slider_value&)));
-
tie_setting(s.rot_sensitivity, ui.rotation_slider);
tie_setting(s.pos_sensitivity, ui.translation_slider);
tie_setting(s.ewma, ui.ewma_slider);
@@ -34,12 +27,18 @@ dialog_accela::dialog_accela()
tie_setting(s.pos_deadzone, ui.trans_dz_slider);
tie_setting(s.rot_nonlinearity, ui.rot_nl_slider);
- update_rot_display(s.rot_sensitivity);
- update_pos_display(s.pos_sensitivity);
- update_ewma_display(s.ewma);
- update_rot_dz_display(s.rot_deadzone);
- update_pos_dz_display(s.pos_deadzone);
- update_rot_nl_slider(s.rot_nonlinearity);
+ tie_setting(s.rot_sensitivity, ui.rot_gain, tr("%1°"), 0, 'g', 4);
+ tie_setting(s.pos_sensitivity, ui.trans_gain, tr("%1mm"));
+ tie_setting(s.ewma, ui.ewma_label, tr("%1ms"));
+ tie_setting(s.rot_deadzone, ui.rot_dz, tr("%1°"), 0, 'g', 4);
+ tie_setting(s.pos_deadzone, ui.trans_dz, tr("%1mm"));
+ tie_setting(s.rot_nonlinearity, ui.rot_nl,
+ tr("<html><head/><body>"
+ "<p>x<span style='vertical-align:super;'>"
+ "%1"
+ "</span></p>"
+ "</body></html>")
+ );
//#define SPLINE_ROT_DEBUG
//#define SPLINE_TRANS_DEBUG
@@ -89,43 +88,5 @@ void dialog_accela::save()
s.b->save();
}
-#define FIELD(x, a) ((a).arg(double((x)), 0, 'g', 4))
-#define LIT(x) QStringLiteral(x)
-
-void dialog_accela::update_rot_display(const slider_value& val)
-{
- static const QString str(QString::fromUtf8("%1°"));
- ui.rot_gain->setText(FIELD(val, str));
-}
-
-void dialog_accela::update_pos_display(const slider_value& val)
-{
- ui.trans_gain->setText(FIELD(val, LIT("%1mm")));
-}
-
-void dialog_accela::update_ewma_display(const slider_value& val)
-{
- ui.ewma_label->setText(FIELD(val, LIT("%1ms")));
-}
-
-void dialog_accela::update_rot_dz_display(const slider_value& val)
-{
- static const QString str(QString::fromUtf8("%1°"));
- ui.rot_dz->setText(FIELD(val, str));
-}
-void dialog_accela::update_pos_dz_display(const slider_value& val)
-{
- ui.trans_dz->setText(FIELD(val, LIT("%1mm")));
-}
-
-void dialog_accela::update_rot_nl_slider(const slider_value& val)
-{
- ui.rot_nl->setText(FIELD(val, LIT(
- "<html><head/><body>"
- "<p>x<span style='vertical-align:super;'>"
- "%1"
- "</span></p>"
- "</body></html>")));
-}